• Including Page URL in the Form#

  • kolkatarsubha Reply #1, 4 months, 1 week ago

    Reply
    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 = "kolkatarsubha@gmail.com";
    $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 :



    Please Help Me .