Results 1 to 7 of 7

Thread: Form Mailer Problem!

  1. #1
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Question Form Mailer Problem!

    Hi to the php expert's! Im always getting error message on my server with this email form. Hope some1 can fix this. Tnx...

    The script is as follow:



    feedback.php



    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
      <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Form Mailer</title>
    </head>
       <body>
    <h2>Feedback Form</h2>
    <form method="post" action="sendemail.php">
    PHP Code:
    <?php
    $ipi 
    getenv("REMOTE__ADDR");
    $httpref getenv("HTTP__REFERER");
    $httpagenti getenv("HTTP__USER__AGENT");
    ?>
    HTML Code:
    <input type="hidden" name="ip" value="
    PHP Code:
    <?php echo $ ipi ?>
    HTML Code:
    " />
    
    <input type="hidden" name="httprefi" value="
    PHP Code:
    <?php echo $ httprefi ?>
    HTML Code:
    " />
    
    <input type="hidden" name="httpagent" value="
    PHP Code:
    <?php echo $ httpagenti ?>
    HTML Code:
    " />
    
    Name :<br />
    <input type="text" name="visitor" size="23" /><br />
    
    E-mail :<br />
    <input type="text" name="visitormail" size="23 /><br />
    <br />&nbsp;<br />
    Concern :<br />
    <select name="attn" size="1">
    <option value=" Tutorial">Tutorial</option>
    <option value=" Technical Support">Technical Support</option>
    <option value=" Html Issue">HTML Issue</option>
    <option value=" WebMaster">WebMaster</option></select>
    <br />&nbsp;<br />
    Your Comments' :<br />
    <textarea name="notes" rows="5" cols="40"></textarea><br />
    <input type="submit" value=" Send Mail " style="position: relative; left: 140px; bottom: 4px" />
    <br />
    </form>
    <p>&nbsp;</p>
    </div>
    </body>
    </html>


    sendemail.php


    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
      <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Sending Email</title>
    </head>
       <body>
    PHP Code:
    <?php

    $ip 
    $_POST['ip'];
    $httpref $_POST['httpref'];
    $httpagent $_POST['httpagent'];
    $visitor $_POST['visitor'];
    $visitormail $POST['visitormail'];
    $notes $_POST['notes'];
    $attn $_['attn'];

    if (
    eregi('http'$notes)) 
    {
    die (
    "Please Try Again!");
    }
    if (!
    $visitormail == "" && (!strstr($visitormail"@") || !strstr($visitormail"."))) 
    { echo 
    "<h2>Please Enter a Valid e-mail address</h2>\n";
    $badinput "<h2>FeedBack was not submitted!</h2>\n";
    echo 
    $badinput;
    die (
    "Going Back! ");
    }
    if (empty(
    $vistor) || empty($visitormail) || empty($notes)) 
    { echo 
    "<h2>Required field\'s is left empty! </h2>\n"
    die (
    "Please Try Again!"); }
    $todayis date("I, F j, Y, g:i a");
    $attn $attn;
    $subject $attn;
    $notes stripcslashes($notes);
    $message $todayis [EST] \n Concern: $attn \n Message: $notes \n From: $visitor ($visitormail) \n Additional info : IP = $ip \n Browser info: $httpagent \n Referral : $httpref \n";
    $from "From: $visitormail\r\n";
    mail("info@rainarts.net46.net"$subject$message$from);
    ?>
    <p align="center">
    <?php echo $todayis ?>
    HTML Code:
    <br />
    Thank You :
    PHP Code:
    <?php echo $visitor ?> ( <?php echo $ visitormail ?> )
    HTML Code:
    <br />
    Concern:
    PHP Code:
    <?php echo $attn ?>
    HTML Code:
    <br />
    Message:<br />
    PHP Code:
    <?php $notesout str_replace("\r""<br/>"$notes);
    echo 
    $notesout?>
    HTML Code:
    <br />
    PHP Code:
    <?php echo $ip ?>
    HTML Code:
    <br /><br />
    <a href="feedback.php"> H O M E </a>
    </p>
    </body>
    </html>

    That does it for all the codes'! I wonder which part of this code is generating those error! Waiting for kind reply... Tnx

  2. #2
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    can you write error below?

  3. #3
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Default

    Tnx
    The Error goes like this.


    Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/public_html/feedback.php on line 139.

  4. #4
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    I'm not sure. But in some variables there are space between $ and variable name. I can't say correctly now. Will look at it again once more. I'm not at comp ><

  5. #5
    Join Date
    Jun 2006
    Posts
    182
    Thanks
    0
    Thanked 14 Times in 14 Posts

    Default

    The error message pretty much tells you what's the problem.
    For some reason you have a space between the $ character and the actual name of the variable in some places (in both files!):
    <?php echo $ ipi ?>
    <?php echo $ httprefi ?>
    <?php echo $ httpagenti ?>
    <?php echo $ visitormail ?>
    ------------
    Whoops, allahverdi was faster :P

  6. #6
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    DimX,
    Thanks for quotes.

    P.S. I found error too...
    Last edited by allahverdi; 08-04-2008 at 06:25 AM.

  7. #7
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Default

    I didnt figure that 1 one out! Big tnx to you guyz...

Bookmarks

Posting Permissions

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