Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18
  1. #1
    Junior Member
    Join Date
    Jan 2007
    Posts
    21
    Member #
    14657
    I am setting up an e-mail form for my website and I can't figure out what is wrong with it. Here is the site: www.stoneveneer.biz
    Here is the error that shows up: Parse error: syntax error, unexpected T_STRING in /home/petra/public_html/contactus.php on line 112

    Here is the page code:
    HTML Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>stone veneer - contact us</title>
    <meta name="keywords" content="stone veneer, cultured stone, manufactured stone, petra stone, faux stone, fake brick">
    
    <script language="JavaScript">
    <!--
    function FP_swapImg() {//v1.0
     var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
     n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
     elm.$src=elm.src; elm.src=args[n+1]; } }
    }
    
    function FP_preloadImgs() {//v1.0
     var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
     for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
    }
    
    function FP_getObjectByID(id,o) {//v1.0
     var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
     else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
     if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
     for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
     f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
     for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
     return null;
    }
    // -->
    </script>
    
    <link rel="stylesheet" type="text/css" href="petrastone.css">
    
    </head>
    
    <body>
    
    <div align="center">
        <table border="1" width="700" cellspacing="0" cellpadding="0" id="table1" bordercolor="#000000" bgcolor="#CCCCCC">
            <tr>
                <td>
                <img border="0" src="petrastone2.jpg" width="700" height="157"></td>
            </tr>
            <tr>
                <td>
                <a href="index.htm">
                <img border="0" id="img1" src="button2.jpg" height="20" width="100" alt="Home" onmouseover="FP_swapImg(1,0,/*id*/'img1',/*url*/'button3.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'button2.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img1',/*url*/'button4.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img1',/*url*/'button3.jpg')" fp-style="fp-btn: Border Bottom 9; fp-font-color-hover: #FF0000; fp-orig: 0" fp-title="Home"></a><a href="products.htm"><img border="0" id="img2" src="button5.jpg" height="20" width="100" alt="Products" onmouseover="FP_swapImg(1,0,/*id*/'img2',/*url*/'button6.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img2',/*url*/'button5.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img2',/*url*/'button7.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img2',/*url*/'button6.jpg')" fp-style="fp-btn: Border Bottom 9; fp-font-color-hover: #FF0000; fp-orig: 0" fp-title="Products"></a><a href="homeowners.htm"><img border="0" id="img3" src="button8.jpg" height="20" width="100" alt="Homeowners" fp-style="fp-btn: Border Bottom 9; fp-font-color-hover: #FF0000; fp-orig: 0" fp-title="Homeowners" onmouseover="FP_swapImg(1,0,/*id*/'img3',/*url*/'button9.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img3',/*url*/'button8.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img3',/*url*/'buttonA.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img3',/*url*/'button9.jpg')"></a><a href="builders.htm"><img border="0" id="img4" src="buttonE.jpg" height="20" width="100" alt="Builders" onmouseover="FP_swapImg(1,0,/*id*/'img4',/*url*/'buttonF.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img4',/*url*/'buttonE.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img4',/*url*/'button10.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img4',/*url*/'buttonF.jpg')" fp-style="fp-btn: Border Bottom 9; fp-font-color-hover: #FF0000; fp-orig: 0" fp-title="Builders"></a><a href="architects.htm"><img border="0" id="img5" src="button11.jpg" height="20" width="100" alt="Architects" onmouseover="FP_swapImg(1,0,/*id*/'img5',/*url*/'button12.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img5',/*url*/'button11.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img5',/*url*/'button13.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img5',/*url*/'button12.jpg')" fp-style="fp-btn: Border Bottom 9; fp-font-color-hover: #FF0000; fp-orig: 0" fp-title="Architects"></a><a href="projects.htm"><img border="0" id="img6" src="button14.jpg" height="20" width="100" alt="Projects" onmouseover="FP_swapImg(1,0,/*id*/'img6',/*url*/'button15.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img6',/*url*/'button14.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img6',/*url*/'button16.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img6',/*url*/'button15.jpg')" fp-style="fp-btn: Border Bottom 9; fp-font-color-hover: #FF0000; fp-orig: 0" fp-title="Projects"></a><a href="contactus.php"><img border="0" id="img8" src="button23.jpg" height="20" width="100" alt="Contact Us" onmouseover="FP_swapImg(1,0,/*id*/'img8',/*url*/'button24.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img8',/*url*/'button23.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img8',/*url*/'button25.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img8',/*url*/'button24.jpg')" fp-style="fp-btn: Border Bottom 9; fp-font-color-hover: #FF0000; fp-orig: 0" fp-title="Contact Us"></a></td>
            </tr>
            <tr>
                <td height="12">&nbsp;<table border="0" width="700" cellspacing="0" cellpadding="0" id="table2">
                    <tr>
                        <td width="21" rowspan="13">&nbsp;</td>
                        <td width="372" align="center">&nbsp;</td>
                        <td align="right" rowspan="13">
                        <img border="1" src="coolpic4.jpg" width="285" height="225"></td>
                        <td width="21" rowspan="13">&nbsp;</td>
                    </tr>
                    <tr>
                        <td width="372" align="center"><font face="Engravers MT">
                        Contact</font></td>
                    </tr>
                    <tr>
                        <td width="372" align="center"><hr width="290"></td>
                    </tr>
                    <tr>
                        <td width="372" align="center">&nbsp;</td>
                    </tr>
                    <tr>
                        <td width="372" align="center"><b><font face="Arial">Petra 
                        Stone of North Central Arkansas</font></b></td>
                    </tr>
                    <tr>
                        <td width="372" align="center">202 S. Cherry Suite B</td>
                    </tr>
                    <tr>
                        <td width="372" align="center">Harrison, Arkansas 72061</td>
                    </tr>
                    <tr>
                        <td width="372" align="center">(870) 741-8429</td>
                    </tr>
                    <tr>
                        <td width="372" align="center">&nbsp;</td>
                    </tr>
                    <tr>
                        <td width="372" align="center">&nbsp;</td>
                    </tr>
                    <tr>
                        <td width="372" align="center">&nbsp;</td>
                    </tr>
                    <tr>
                        <td width="372" align="center">&nbsp;</td>
                    </tr>
                    <tr>
                        <td width="372" align="center">&nbsp;</td>
                    </tr>
                    </table>
                <p>&nbsp;</p>
                <div align="center">
                    <table border="0" cellpadding="0" width="600" bordercolor="#000000" style="border-collapse: collapse" id="table3">
                        <tr>
                            <td>
      <?php  if($_POST['submit']) {
    /*Here we are going to declare the variables*/
    $name = $_POST['Name'];
    $Address = $_POST['Address'];
    $Address = $_POST['Address'];
    $City = $_POST['City'];
    $State = $_POST['State'];
    $Zip = $_POST['Zip'];
    $Home Phone = $_POST['Home Phone'];
    $Business Phone = $_POST['Business Phone'];
    $E-mail = $_POST['E-mail'];
    $Message = $_POST['Message'];
    $Best time to contact = $_POST['Best time to contact'];
    //Save visitor name and entered message into one variable:
    $formcontent="VISITOR NAME: $name\n\nFEEDBACK: $message";
    $recipient = " *danielmdifranco@yahoo.com";
    $subject = "Contact Form";
    $mailheader = "From: $email\r\n";
    $mailheader .= "Reply-To: $email\r\n";
    $mailheader .= "MIME-Version: 1.0\r\n";
    mail($recipient, $subject, $formcontent, $mailheader) or die("Failure!");
    echo "Thank You!";
    }
    ?>          
                            
                            
                            
      <form action="../<?php echo $_SERVER['PHP_SELF']; ?>" METHOD="POST">     
        <table width="100%" border="0" cellspacing="2" cellpadding="0">
        <tr>
          <td width="150" align='right'>Name:</td>
          <td><input name="name" type="text" id="name" tabindex="1" size="50" maxlength="50" /></td>
        </tr>
        <tr>
          <td width="150" align='right'>Address:</td>
    
          <td><input name="add1" type="text" id="add1" tabindex="2" size="50" maxlength="50" /></td>
        </tr>
        <tr>
          <td width="150" align='right'>Address:</td>
          <td><input name="add2" type="text" id="add2" tabindex="3" size="50" maxlength="50" /></td>
        </tr>
        <tr>
          <td width="150" align='right'>City:</td>
    
          <td><input name="city" type="text" id="city" tabindex="4" size="50" maxlength="50" /></td>
        </tr>
        <tr>
          <td width="150" align='right'>State:</td>
          <td>
          
    <select name="state" class="quote" style='width: 45px' tabindex="5">
      <option value="AL">AL</option>
      <option value="AK">AK</option>
    
      <option value="AZ">AZ</option>
      <option value="AR" selected="selected">AR</option>
      <option value="CA">CA</option>
      <option value="CT">CT</option>  
      <option value="DE">DE</option>
      <option value="DC">DC</option>
    
      <option value="FL">FL</option>  
      <option value="GA">GA</option>
      <option value="HI">HI</option>
      <option value="ID">ID</option>
      <option value="IL">IL</option>
      <option value="IN">IN</option>
    
      <option value="IA">IA</option>
      <option value="KS">KS</option>
      <option value="KY">KY</option>  
      <option value="LA">LA</option>
      <option value="ME">ME</option>
      <option value="MD">MD</option>
    
      <option value="MA">MA</option>
      <option value="MI">MI</option>
      <option value="MN">MN</option>
      <option value="MS">MS</option>
      <option value="MO">MO</option>
      <option value="MT">MT</option>
    
      <option value="NE">NE</option>
      <option value="NV">NV</option>
      <option value="NH">NH</option>
      <option value="NJ">NJ</option>  
      <option value="NM">NM</option>
      <option value="NY">NY</option>
    
      <option value="NC">NC</option>
      <option value="ND">ND</option>
      <option value="OH">OH</option>
      <option value="OK">OK</option>  
      <option value="OR">OR</option>
      <option value="PA">PA</option>
    
      <option value="RI">RI</option>
      <option value="SC">SC</option>
      <option value="SD">SD</option>
      <option value="TN">TN</option>
      <option value="TX">TX</option>
      <option value="UT">UT</option>
    
      <option value="VT">VT</option>
      <option value="VA">VA</option>
      <option value="WA">WA</option>
      <option value="WI">WI</option>
      <option value="WY">WY</option>
    </select>      
          
          </td>
    
        </tr>
        <tr>
          <td width="150" align='right'>Zip:</td>
          <td><input name="zip" type="text" id="zip" size="5" maxlength="5" tableindex='6'/></td>
        </tr>
        <tr>
          <td width="150">&nbsp;</td>
          <td>&nbsp;</td>
    
        </tr>
        <tr>
          <td width="150" align='right'>Home Phone:</td>
          <td>
            <input name="Home Phone" type="text" id="Home Phone" tabindex="7" size="15" maxlength="15" />
           </td>
        </tr>
    
        <tr>
          <td width="150" align='right'>Business Phone:</td>
          <td>
            <input name="Business Phone" type="text" id="Business Phone" size="15" maxlength="15" />
            
            </td>
        </tr>
        <tr>
    
          <td width="150">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td width="150" align='right'>E-Mail:</td>
          <td><input name="email" type="text" id="email" size="50" maxlength="50" /></td>
        </tr>
        <tr>
    
          <td width="150">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td width="150" align='right' valign='top'>Message:</td>
          <td><textarea name="message1" cols="45" rows="10" id="message1"></textarea></td>
        </tr>
        <tr>
    
          <td width="150">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td width="150" align='right' valign='top'>Additional Information: </td>
          <td><textarea name="addinfo" cols="45" rows="10" id="addinfo"></textarea></td>
        </tr>
        <tr>
    
          <td width="150">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td width="150" align='right'>Best time to contact: </td>
          <td><select name="time">
          <option selected="selected">Choose</option>
              <optgroup label='--------'>
    
            <option value="8-12">8am-12pm</option>
            <option value="12-4">12pm-4pm</option>
            <option value="4-8">4pm-8pm</option>
            </optgroup>
          </select>
          </td>
        </tr>
    
        <tr>
          <td width="150">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
      </table><br />
      <input type="submit" name="Submit" value="Submit" /><input name="Send" type="Reset" /><br />&nbsp;
    
          
       </form>
       
    </td>
                        </tr>
                    </table>
                </div>
                 
                <table border="0" cellpadding="0" width="700" style="border-collapse: collapse" id="table4">
                    <tr>
                        <td align="center">Petra Stone of North Central Arkansas</td>
                    </tr>
                    <tr>
                        <td align="center">Copyright <font face="Times New Roman"> 
                        2006-2007</font></td>
                    </tr>
                    <tr>
                        <td align="center">&nbsp;</td>
                    </tr>
                </table>
                </td>
            </tr>
            </table>
    </div>
    
    </body>
    
    </html>
    Any help would be greatly appreciated.




  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Variable names cannot have spaces in them

    PHP Code:
    $Home Phone $_POST['Home Phone']; // illegal variable 
    $Business Phone $_POST['Business Phone']; // also illegal
    $E-mail $_POST['E-mail'];
    $Message $_POST['Message']; // also illegal
    $Best time to contact $_POST['Best time to contact']; // also illegal 
    That may not be it but try that.

  4. #3
    Junior Member
    Join Date
    Jan 2007
    Posts
    21
    Member #
    14657
    Thanks I am not getting an error message now, but it does not send the form to my e-mail like I want. Try it out: http://www.stoneveneer.biz///contactus.php

  5. #4
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Change your form tag to
    HTML Code:
     <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    If that still does not work, try changing your submit tag to
    HTML Code:
     <input type="submit" name="submit" value="Submit" />

  6. #5
    Junior Member
    Join Date
    Jan 2007
    Posts
    21
    Member #
    14657
    I changed both lines of code and now it is saying that it can't find the server

  7. #6
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Well when you submit the form what address is in the address bar?

  8. #7
    Junior Member
    Join Date
    Jan 2007
    Posts
    21
    Member #
    14657
    It's the same address before and after:
    www.stoneveneer.biz/contactus.php

    But now it's saying 'Thank You' above the form after you send it.

  9. #8
    Junior Member
    Join Date
    Jan 2007
    Posts
    21
    Member #
    14657
    It seems to send the form but I never get it in my e-mail.

  10. #9
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    Do you have the a mail server configured and functioning (try ask your host)?

    (btw: Holly Hallucinating Table Layouts!)
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.

  11. #10
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    It is saying thank you because your script is echoing that regardless of success or failure.
    Change
    PHP Code:
    mail($recipient$subject$formcontent$mailheader) or die("Failure!");
    echo 
    "Thank You!"
    to
    PHP Code:
    if(mail($recipient$subject$formcontent$mailheader))
      {
         echo 
    "Thank You!";
      }
    else
      {
         echo 
    "error, email not sent.";
      } 


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:10 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com