Member Offer
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Contact Form problem

Discussion in 'Website Coding & Programming Forum:' started by PhilBen, Feb 21, 2010.

  1. PhilBen

    PhilBen New Member

    Hi all does anyone know of a free contact form script that graps the ip address and prints it in the email??? I have tried the form iam using but can'y get it to work. Can anyone else get this to work ????

    <?php
    include("global.inc.php");
    $errors=0;
    $error="The following errors occured while processing your form input.<ul>";
    pt_register('POST','Name');
    pt_register('POST','EmailAddress');
    pt_register('POST','Telephone');
    pt_register('POST','WebAddress');
    pt_register('POST','IntrestedIn');
    pt_register('POST','Howdidyouhearaboutus');
    pt_register('POST','Comments');
    $Comments=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $Comments);if($Name=="" || $EmailAddress=="" || $IntrestedIn=="" || $Howdidyouhearaboutus=="" ){
    $errors=1;
    $error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
    }
    if($errors==1) echo $error;
    else{
    $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
    $message="Name: ".$Name."
    Email Address: ".$EmailAddress."
    Telephone: ".$Telephone."
    Web Address: ".$WebAddress."
    Intrested In: ".$IntrestedIn."
    How did you hear about us: ".$Howdidyouhearaboutus."
    Comments: ".$Comments."
    ";
    $message = stripslashes($message);
    mail("------------------","Form Submitted TAG Web Design",$message,"From: Tag Web Design:");
    header("Refresh: 0;url=--------------------------");
    ?><?php
    }
    ?>


    Thanks
    Phil
     

Share This Page