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.

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Jan 2007
    Posts
    21
    Member #
    14657
    Can someone help me figure out what's wrong with my coding? I can't get the form to send the information to my e-mail address. I know nothing about PHP, (and very little about web design), and I used several templates that people had on their sites, but none of them worked. My site is stoneveneer.biz and the form is on the contact page.
    Thanks!

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    First off, your contact page is named contact us.htm - get rid of the space, either name the file contact.htm or contactus.htm

    Secondly, you are submitting the form to itself, which is what I prefer, but for that to work your pages need to have the .php extension (so call it contact.php or contactus.php)

    Lastly, change your PHP code to this.

    PHP Code:
    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 " * I Deleted This * ";
    $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!";
    }
    ?> 
    Try that, if theres any errors with the actual emailing part, come back and tell us the error.

    And remember to edit $recipient, I changed it so your address was not spidered and so on.

  4. #3
    Junior Member
    Join Date
    Jan 2007
    Posts
    21
    Member #
    14657
    When I change it to contactus.php, it changes all to code and doesn't give me a design view in Frontpage. (Sorry I'm a Noob.) Am I right to assume that frontpage will not give a design view for a php extention, and that I will have to hand code any changes from here on?

  5. #4
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    I have never used Frontpage, so I cannot answer you, however, you could continue to update the .htm file, and once your done, save as (to create a new file) contactus.php

    However by that stage you will not need any more coding, unless you are changing your forms fields/adding more.

  6. #5
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    Oh no, frontpage! If I must say, now that you're stepping into Server-side, do learn to code by hand... never use editor previews, they don't match all browsers.

    So yes you will need to code by hand.
    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.

  7. #6
    Senior Member Karloff's Avatar
    Join Date
    Oct 2005
    Posts
    744
    Member #
    11702
    stay away from frontpage, when you save the code it will sometime alter the code. not sure how to phrase that technically but it inserts invalid code when you save pages.

    sorry i can't be more specific... use notepad instead if u ain't got DW

  8. #7
    Junior Member
    Join Date
    Jan 2007
    Posts
    21
    Member #
    14657
    Quote Originally Posted by bfsog
    I have never used Frontpage, so I cannot answer you, however, you could continue to update the .htm file, and once your done, save as (to create a new file) contactus.php

    However by that stage you will not need any more coding, unless you are changing your forms fields/adding more.
    My wife and I had twin girls a few weeks ago, so I have been out of the loop. I keep getting this error when I try to send the form: Parse error: syntax error, unexpected T_STRING in /home/petra/public_html/contactus.php on line 112

    The site is www.stoneveneer.biz

    I would appreciate any help possible

  9. #8
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Congratulations on the twins, kudos to miss dantheman !

    If you could post, or better yet, attach the contactus.php file to a post here that will help us as we cannot access your PHP code.

  10. #9
    Junior Member
    Join Date
    Jan 2007
    Posts
    21
    Member #
    14657
    Quote Originally Posted by bfsog
    Congratulations on the twins, kudos to miss dantheman !

    If you could post, or better yet, attach the contactus.php file to a post here that will help us as we cannot access your PHP code.
    Here is the code. Sorry for all the frontpage crap.

    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>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <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>


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 03:02 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com