Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with my submit form :)

    Hello, I have a form where you submit to post on the forum however I wana know if there is a way so that when the user submits the form, on the check.php page there is some type of code that checks that the form was submitted from the correct URL.

    I was thinking something like this:
    PHP Code:
    if ('."http://".$_SERVER['HTTP_REFERER]);)
      echo 
    "preceed or somthing :S";
    else
    echo 
    "error message or somthing :S"
    So basically the form is on "Form.php" and if a user takes the source code and submits the form from "http://theresite.com/form.php" it will give an error, so it will only accept it from "form.php"



    You can find the demo at http://googl3.tk/post.php
    Last edited by Hydros; 01-15-2010 at 06:23 AM.

  • #2
    Regular Coder sea4me's Avatar
    Join Date
    Jan 2009
    Location
    Damn, I don't know...
    Posts
    390
    Thanks
    11
    Thanked 28 Times in 27 Posts
    You mean sumthing like this?
    PHP Code:
    if ($_SERVER['HTTP_REFERER']=='form.php'){
      echo 
    "preceed or somthing :S";
    }
    else{
      echo 
    "error message or somthing :S";

    Use:
    PHP Code:
    header('Location: thankyou.php'); 
    to redirect people to another page

  • #3
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, how can I make it so if it didn't come from form.php they get an error, and the form doesn't go through to the mysql database


  •  

    Posting Permissions

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