redgtsviper Posted September 19, 2006 Share Posted September 19, 2006 I am built this simple form on a website. Below I have posted both the form code and the php code on the processing page whats is going on with this. It is on a windows server that has PHP installed and configuredFORM<form action="contact_ty.php" method="post" name="form1" onSubmit="VF_form1();return false;"> <table width="97%" border="0" cellspacing="0" cellpadding="3" id="formStyled"> <tr bgcolor="#E8FFFA"> <td width="27%" align="right" valign="top"> </td> <td width="73%" align="left" valign="top"></td> </tr> <tr bgcolor="#E8FFFA"> <td align="right" valign="top"><font size="2" face="Verdana">Name:</font></td> <td align="left" valign="top"><font size="2" face="Verdana"> <input name="Name" type="text" id="Name" size="40"> </font></td> </tr> <tr bgcolor="#E8FFFA"> <td align="right" valign="top"><font size="2" face="Verdana">Practice: </font></td> <td align="left" valign="top"><font size="2" face="Verdana"> <input name="Practice" type="text" id="Practice" size="40"> </font></td> </tr> <tr bgcolor="#E8FFFA"> <td height="32" align="right" valign="top"><font size="2" face="Verdana">Address:</font></td> <td align="left" valign="top"><font size="2" face="Verdana"> <input name="Address" type="text" id="Address" size="40"> </font></td> </tr> <tr bgcolor="#E8FFFA"> <td align="right" valign="top"><font size="2" face="Verdana">City:</font></td> <td align="left" valign="top"><font size="2" face="Verdana"> <input name="City" type="text" id="City"> </font></td> </tr> <tr bgcolor="#E8FFFA"> <td align="right" valign="top"><font size="2" face="Verdana">State: </font></td> <td align="left" valign="top"><font size="2" face="Verdana"> <input name="State" type="text" id="State" size="3" maxlength="2"> </font></td> </tr> <tr bgcolor="#E8FFFA"> <td align="right" valign="top"><font size="2" face="Verdana">Zip: </font></td> <td align="left" valign="top"><font size="2" face="Verdana"> <input name="ZipCode" type="text" id="ZipCode"> </font></td> </tr> <tr bgcolor="#E8FFFA"> <td align="right" valign="top"><font size="2" face="Verdana">Phone Number: </font></td> <td align="left" valign="top"><font size="2" face="Verdana"> <input name="PhoneNumber" type="text" id="PhoneNumber"> </font></td> </tr> <tr bgcolor="#E8FFFA"> <td align="right" valign="top"><font size="2" face="Verdana">Email Address: </font></td> <td align="left" valign="top"><font size="2" face="Verdana"> <input name="emailAddress" type="text" id="emailAddress" size="30"> </font></td> </tr> <tr bgcolor="#E8FFFA"> <td align="right" valign="top"><font size="1" face="Verdana">Comments:</font></td> <td align="left" valign="top"><font size="2" face="Verdana"> <textarea name="Comment" cols="37" rows="5" id="Comment"></textarea> </font></td> </tr> <tr bgcolor="#E8FFFA"> <td align="right" valign="top"> </td> <td align="left" valign="top"><p><font size="2" face="Verdana"><br> Which type of In-Service do you prefer? </font></p> <p><font size="2" face="Verdana"> <input name="InservicePreference" type="radio" value="Web Conference"> Web conference <br> <input name="InservicePreference" type="radio" value="On-site In-Service"> On-site In-Service</font></p> </td> </tr> <tr bgcolor="#E8FFFA"> <td align="right" valign="top"> </td> <td align="left" valign="top"><p><font size="2" face="Verdana">How would you like to be contacted to schedule this In-Service?</font></p> <p><font size="2" face="Verdana"> <input name="ContactPreference" type="radio" value="Phone"> Phone<br> <input name="ContactPreference" type="radio" value="Email"> Email<br> </font></p> </td> </tr> <tr bgcolor="#E8FFFA"> <td align="right" valign="top"> </td> <td align="left" valign="top"><font size="2" face="Verdana"> <input type="submit" name="Submit" value="Submit"> </font></td> </tr> <tr bgcolor="#E8FFFA"> <td align="right" valign="top"> </td> <td align="left" valign="top"> </td> </tr> </table> <p> </p> </form>SCRIPT ON SECOND PAGE<?php $msg = "OrthoRx Contact Page Submission\n\n"; $msg .= "Name: $Name\n\n"; $msg .= "Practice: $Practice\n\n"; $msg .= "Address: $Address\n\n"; $msg .= "City: $City, State: $State ZipCode: $ZipCode\n\n"; $msg .= "Phone Number: $PhoneNumber\n\n"; $msg .= "Email Address: $emailAddress\n\n"; $msg .= "Comments: $Comment\n\n"; $msg .= "In-Service: $InservicePreference\n\n"; $msg .= "Contact Preference: $ContactPreference\n\n"; // Edit if it is nessecery $to = "[email protected]"; $subject = "CONTACT PAGE FROM OrthoRx WEBSITE"; $mailheaders = "From: OrthoRx Contact Page Submission Form <$emailAddress>\n"; $mailheaders .= "Reply-To:$Email_Address <$emailAddress>\n\n"; // Mail to address mail ( $to, $subject, $msg, $mailheaders ); ?> Quote Link to comment https://forums.phpfreaks.com/topic/21324-php-form-need-help/ Share on other sites More sharing options...
Ninjakreborn Posted September 19, 2006 Share Posted September 19, 2006 What's it doing, is it returning an error, is it not working, how is it not working, what's it doing. Quote Link to comment https://forums.phpfreaks.com/topic/21324-php-form-need-help/#findComment-94936 Share on other sites More sharing options...
Ninjakreborn Posted September 19, 2006 Share Posted September 19, 2006 Also your form is severely bloated, you could probably cut that down to about 10-12 lines for the form, and use css to style it, instead of about 30-40 lines of wasted space. Also whether you are a php programmer, it only takes about 2 days to learn how to program form validation and email sending. Using a third party script is normally not as secure. Quote Link to comment https://forums.phpfreaks.com/topic/21324-php-form-need-help/#findComment-94937 Share on other sites More sharing options...
redgtsviper Posted September 19, 2006 Author Share Posted September 19, 2006 Here is the errorNotice: Undefined variable: Name in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 94Notice: Undefined variable: Practice in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 96Notice: Undefined variable: Address in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 98Notice: Undefined variable: City in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 100Notice: Undefined variable: State in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 100Notice: Undefined variable: ZipCode in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 100Notice: Undefined variable: PhoneNumber in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 102Notice: Undefined variable: emailAddress in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 104Notice: Undefined variable: Comment in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 106Notice: Undefined variable: InservicePreference in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 108Notice: Undefined variable: ContactPreference in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 110Notice: Undefined variable: toaddress in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 115Notice: Undefined variable: emailAddress in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 117Notice: Undefined variable: Email_Address in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 118Notice: Undefined variable: emailAddress in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 118Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Inetpub\wwwroot\pixelart\Ortho RX\contact_ty.php on line 120 Quote Link to comment https://forums.phpfreaks.com/topic/21324-php-form-need-help/#findComment-94942 Share on other sites More sharing options...
redgtsviper Posted September 19, 2006 Author Share Posted September 19, 2006 Here is the PHP info for the serverhttp://www.orthorx.net/php.php Quote Link to comment https://forums.phpfreaks.com/topic/21324-php-form-need-help/#findComment-94956 Share on other sites More sharing options...
pgsjoe Posted September 19, 2006 Share Posted September 19, 2006 as for the mail error, that's on your server end and looks like it's not going to send even if you do get it. the problem seems to be that you're not pulling the variables from your form. The value of the "Name" textfield isn't $Name, it's [code]$Name = $_POST['name'];[/code]Try doing this for your code instead...[code] if (isset($_POST['name'])) {$Name = $_POST['Name'];$Practice = $_POST['Practice'];//etc.//then your code for the msg part of it... $msg = "OrthoRx Contact Page Submission\n\n"; $msg .= "Name: $Name\n\n";//etc.//finally, the mail info $to = "[email protected]"; $subject = "CONTACT PAGE FROM OrthoRx WEBSITE"; $mailheaders = "From: OrthoRx Contact Page Submission Form <$emailAddress>\n"; $mailheaders .= "Reply-To:$Email_Address <$emailAddress>\n\n"; // Mail to address mail ( $to, $subject, $msg, $mailheaders );//and don't forget to close out the if statement}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/21324-php-form-need-help/#findComment-94958 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.