Jump to content

Contact form, very simple error? but very tricky.


bilis_money

Recommended Posts

I really don't see the real problem with this error message below.

 

Parse error: syntax error, unexpected '{' in /home/capitol2/public_html/smail.php online 1.

 

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

    $contents = "First Name:  " . $_POST['fname'] .
    			"\n\nLast Name:  " . $_POST['lname'] .
    			"\n\nStreet1:  " . $_POST['st1'] .
    			"\n\nStreet2:  " . $_POST['st2'] .
    			"\n\nCity:  " . $_POST['city'] .
    			"\n\nState:  " . $_POST['state'] .
    			"\n\nZip code:  " . $_POST['zcode'] .
			"\n\nCountry code:  " . $_POST['countcode'] .
    			"\n\nCountry:  " . $_POST['country'] .
    			"\n\nPhone number:  " . $_POST['pnumber'] .
    			"\n\nE-mail address:  " . $_POST['email'] .
    			"\n\nEnquiry:  " . $_POST['enquiry'];
}

    $headers = "Reply-to: contact@mydomain.com\n";
    mail($recepient, $subject, $contents, "From: contact@mydomain.com");
?>

 

ok, this is the form that will invoke smail.php above.

 

<div id="contactformdiv" style="position:absolute; left:147px; top:354px; width:452px; height:483px; z-index:3;">
          <form action="http://www.mydomain.com/smail.php" method="post" name="msgform" id="msgform">
            <div>
              <div align="left"></div>
              <table width="450" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
                <!-- First tabe row -->
                <tbody>
                  <tr>
                    <td colspan="3"></td>
                    <!-- second table row -->
                  </tr>
                  <tr>
                    <td width="211" bgcolor="#FFFFFF"><div align="left" class="style6"><font face="Tahoma"><span class="style7">First Name</span>
                              <input maxlength="30" name="fname" size="20" />
                    </font></div></td>
                    <!-- Coloum two in the second table row -->
                    <td width="239" colspan="2" bgcolor="#FFFFFF"><div align="left" class="style6"><font face="Tahoma"><span class="style7">Last Name</span>
                              <input maxlength="30" name="lname" size="20" />
                    </font></div></td>
                  </tr>
                  <!-- Third table row spread over 3 coloumns -->
                  <tr bgcolor="#FFFFFF">
                    <td colspan="3"><div align="left" class="style6"><font face="Tahoma"><span class="style7">Street</span><br />
                              <input maxlength="70" name="st1" size="70" />
                              <br />
                              <input maxlength="70" name="st2" size="70" />
                    </font></div></td>
                  </tr>
                  <tr>
                    <td width="211" bgcolor="#FFFFFF"><div align="left" class="style6"><font face="Tahoma"><span class="style7">City</span>
                              <input maxlength="30" name="city" size="20" />
                    </font></div></td>
                    <td width="239" colspan="2" bgcolor="#FFFFFF"><div align="left" class="style6"><font face="Tahoma"><span class="style7">State</span>
                          <font face="Tahoma">
                          <input maxlength="30" name="state" size="20" />
                          </font> </font></div></td>
                  </tr>
                  <tr bgcolor="#FFFFFF">
                    <td colspan="3"><div align="left" class="style6"><font face="Tahoma"><span class="style7">Zip Code</span>
                              <input maxlength="15" size="10" name="zcode" />
                    </font></div></td>
                  </tr>
                  <tr bgcolor="#FFFFFF">
                    <td colspan="3"><p><span class="style6"><font face="Tahoma"><span class="style7">Country Code </span></font></span>
                            <input maxlength="15" size="10" name="countcode" />
                    </p></td>
                  </tr>
                  <tr bgcolor="#FFFFFF">
                    <td colspan="3"><div align="left" class="style6">
                        <p><font face="Tahoma"><span class="style7">Country</span>
                              <select name="country">
                                <option value=" " selected="selected">--- Choose One ---</option>
                                <option value="Zimbabwe">Zimbabwe</option>
                              </select>
                        </font></p>
                    </div></td>
                  </tr>
                  <tr>
                    <td width="211" bgcolor="#FFFFFF"><div align="left" class="style6"><font face="Tahoma"><span class="style7">Phone Number<font size="1">(INCLUDE AREA CODE)</font></span><br />
                                                      <input maxlength="30" name="pnumber" size="20" />
                    </font></div></td>
                    <td width="239" colspan="2" bgcolor="#FFFFFF"><div align="left" class="style6"><font face="Tahoma"><span class="style7">E-mail Address</span>
                              <input maxlength="255" name="email" size="20" />
                    </font></div></td>
                  </tr>
                  <tr bgcolor="#FFFFFF">
                    <td height="170" colspan="3"><div align="left" class="style6"><font face="Tahoma"><span class="style7">Enquiry</span><br />
                              <textarea name="enquiry" rows="10" cols="50"></textarea>
                    </font></div></td>
                  </tr>
                  <tr align="middle" bgcolor="#FFFFFF">
                    <td height="36" colspan="3"><span class="style6"><font face="Tahoma">
                      <input type="submit" value="Submit Enquiry" name="Submit" onclick="return checkForm();"/>
                      <input type="reset" value="Clear Form" name="Reset" />
                    </font></span></td>
                  </tr>
                </tbody>
              </table>
            </div>
          </form>
  </div>

 

I just really don't understand this error message, it's very simple but very tricky. mmmm...

i wonder why?

 

Thank you very much. in advance.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.