Jump to content

very basic problem.


bilis_money

Recommended Posts

yo!  :D

 

the error message,

Parse error: syntax error, unexpected '{' in /home/sexyexot/public_html/email.php on line 1

 

and my codes below,

<?php
if (isset($_POST['Submit'])){
    $recepient = "[email protected]";
    $subject = "You have Guest! from mydomain.com";

    $contents = "Name:  " . $_POST['name'] .
    			"\n\nCountry:  " . $_POST['country'] .
    			"\n\nCity:  " . $_POST['city'] .
    			"\n\nPhone:  " . $_POST['phone'] .
    			"\n\nEmail:  " . $_POST['email'] .
			"\n\nHotel:  " . $_POST['hotel'] .
    			"\n\nInquiry:  " . $_POST['enquiry'];				
}
    $headers = "Reply-to: [email protected]\n";
    mail($recepient, $subject, $contents, "From: [email protected]");
?>

 

can you pinpoint this basic cause.  :D

thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/43466-very-basic-problem/
Share on other sites

that is all the php codes.

 

ok, here is the form codes,

 

	  <form method="POST" action="http://www.mydomain.com/email.php">
        <table width="350" height="424" border="0">
          <tr>
            <td width="119" height="26" bgcolor="#000000"><span class="style11">name:</span></td>
            <td width="221" bgcolor="#000000"><input type="text" name="name" /></td>
            </tr>
          <tr>
            <td height="25" bgcolor="#000000"><span class="style12">country:</span></td>
            <td bgcolor="#000000"><input name="country" type="text" id="country" /></td>
            </tr>
          <tr>
            <td height="26" bgcolor="#000000"><span class="style12">city:</span></td>
            <td bgcolor="#000000"><input name="city" type="text" id="city" /></td>
            </tr>
          <tr>
            <td height="25" bgcolor="#000000"><span class="style12">phone:</span></td>
            <td bgcolor="#000000"><input name="phone" type="text" id="phone" /></td>
            </tr>
          <tr>
            <td height="29" bgcolor="#000000"><span class="style12">email:</span></td>
            <td bgcolor="#000000"><input name="email" type="text" id="email" /></td>
            </tr>
          <tr>
            <td height="25" bgcolor="#000000"><span class="style12">hotel:</span></td>
            <td bgcolor="#000000"><input name="inquiry" type="text" id="inquiry" /></td>
            </tr>
          <tr>
            <td height="191" bgcolor="#000000"><span class="style12"><strong>inquiry</strong></span></td>
            <td bgcolor="#000000"><textarea name="textarea"></textarea></td>
            </tr>
          <tr>
            <td bgcolor="#000000"> </td>
            <td bgcolor="#000000"><div align="center">
              <input type="submit" name="Submit" value="Submit" />
            </div></td>
            </tr>
        </table>
</form>

 

I know it's basic, the problem is i'm a little dizzy right now, that's why i'm confuse.  :D

 

i hope you can help bro.  ;D

Link to comment
https://forums.phpfreaks.com/topic/43466-very-basic-problem/#findComment-211102
Share on other sites

Looks ok overall. Is the email.php being included within any other pages? In the code you posted, I don't see any issue. Typically, with that sort of error, you would have missed one of the closing parenthesis ")" in your if statement, but in your posted code, they're both there. ???

Link to comment
https://forums.phpfreaks.com/topic/43466-very-basic-problem/#findComment-211115
Share on other sites

hes got an older version of php

 

try this:

<?php
if (isset($_POST[submit])){
    $recepient = "[email protected]";
    $subject = "You have Guest! from mydomain.com";

    $contents = "Name:  " . $_POST['name'] .
    			"\n\nCountry:  " . $_POST['country'] .
    			"\n\nCity:  " . $_POST['city'] .
    			"\n\nPhone:  " . $_POST['phone'] .
    			"\n\nEmail:  " . $_POST['email'] .
			"\n\nHotel:  " . $_POST['hotel'] .
    			"\n\nInquiry:  " . $_POST['enquiry'];				
}
    $headers = "Reply-to: [email protected]\n";
    mail($recepient, $subject, $contents, "From: [email protected]");
?>

Link to comment
https://forums.phpfreaks.com/topic/43466-very-basic-problem/#findComment-211139
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.