Results 1 to 3 of 3

Thread: Newbie Question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2002
    Posts
    129

    Newbie Question

    Hi Guys

    I have a form that posts data to a php script in a seperate file (form.php) I need this form.php to be accesible only by the form that submits data to it and not accessible as a direct link.

    I remeber from college there is some code to do what im asking but I just can't remeber.

    Thanks in advance for any help guys.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Newbie Question

    You can put the file outside the document root and use the include statement to access it from the PHP script. If you want to POSt the data you will need to have public access to it.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765

    Re: Newbie Question

    You can get the page you came from via the headers right?

    $_SERVER['HTTP_REFERER'];
    But a browser may not always send the page it came from, and users can edit it as well and fake it.

    I guess you could always try making some kind of hash as well and validate it in Form.php... depends how important it is.
    Last edited by Pc_Madness; Dec 7th, 2005 at 04:51 PM.
    Don't Rate my posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width