We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38296
    • 1 Posts
    I want to trac the URL from which the below form was submitted. I am new to php & tried this code :

    PHP Code :


    <?php

    // Receiving variables
    @$full_name = addslashes($_POST['full_name']);
    @$email = addslashes($_POST['email']);
    @$phone = addslashes($_POST['phone']);
    @$pageurl = addslashes($_POST['pageurl']);


    // Validation
    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
    {
    header("Location: error.html");
    exit;
    }

    //Sending Email to form owner
    # Email to Owner
    $pfw_header = "From: $email";
    $pfw_subject = "Booking Request";
    $pfw_email_to = "[email protected]";
    $pfw_message = "full_name: $full_name\n"
    . "email: $email\n"
    . "phone: $phone\n"
    . "pageurl: $pageurl\n";
    @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

    header("Location: thank-you.html");

    ?>

    HTML Form :

    <body>
    <form method="post" action="quick-output.php">
    Name : <input name="full_name" type="text" id="full_name" value="Type Your Name Here" onfocus="this.value=' ' "/>
    Ph No : <input name="phone" type="text" id="phone" value="Type Your Ph No Here" onfocus="this.value=' '"/>
    E Mail ID : <input name="email" type="text" value="Type Your E Mail ID Here" onfocus="this.value=' '"/>
    <input type="submit" name="Submit" value="Book Now" />
    </form>

    </body>

    Please Help Me .