stupid girl! Posted November 7, 2007 Share Posted November 7, 2007 Hi All I am trying to use a php script to transmit data through a form. usually this form works fine, but im obviously missing something out. can anyone help? <?php if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; echo $badinput; } if(empty($firstname) || empty($email) || empty($cardnumber) || empty($lastname )) { echo "<h2></h2>\n"; } $todayis = date("l, F j, Y, g:i a") ; $attn = $firstname ; $subject = "Request for Valuation from website" ; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Titla: $title \n Name: $name \n Address1: $address1 \n Address2: $address2 \n postcode: $postcode \n Telephone: $telephone \n Mobile: $mobile \n Email: $email \n What is your Property Type: $proptype \n Is your property on the market?: $propmarket \n If so which agent?: $agent \n How Much is it on the market for?: $cost \n Do you wish to stay as a tenant: $tenant \n Which of our options do you prefer?: $options \n "; $from = "From: $email\r\n"; var address = 'info'; var domain = 'homesboughttoday'; var ext = 'co.uk'; mail("address+domain+ext", $subject, $message, $from); ?> Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 7, 2007 Share Posted November 7, 2007 var address = 'info'; var domain = 'homesboughttoday'; var ext = 'co.uk'; please remove those lines Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 ok if i remove those lines, how can i disguise the email from spammers? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 7, 2007 Share Posted November 7, 2007 because those lines aren't PHP, disguise from spammers ? Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 yeah i am trying to disuise my email from spammers using php and that was another forum who suggested i use that Quote Link to comment Share on other sites More sharing options...
aschk Posted November 7, 2007 Share Posted November 7, 2007 Do you know what that script you have does? It sends an email... So if you have : $email = "stupid@girl.com"; NO-ONE can see that. It's a PHP variable, it never gets displayed (unless you echo it, which really would be stupid). Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 thanks Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 ok, it has not been solved, there is still an isse where as the form responses are not sowing in the email. belows is the form code <form method="post" action="sendemail.php"><table width="85%" height="200" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4" bgcolor="#FFFFFF"><div align="center" class="style13"> <?php $ipi = getenv("REMOTE_ADDR"); $httprefi = getenv ("HTTP_REFERER"); $httpagenti = getenv ("HTTP_USER_AGENT"); ?> <input type="hidden" name="ip" value="<?php echo $ipi ?>" /> <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" /> <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />Please complete the following form and one of our team will contact your shortly <br /><br /></div></td> </tr> <tr> <td height="8" colspan="4" bgcolor="#999999"></td> </tr> <tr> <td width="13%" bgcolor="#FFFFFF"><div align="right" class="style13 style12"><strong>Title:</strong></div></td> <td width="24%" bgcolor="#FFFFFF"><input name="title" type="text" id="title" size="15" /></td> <td width="35%" bgcolor="#FFFFFF"><span class="style13 style12 style21"><strong>Property Type: </strong></span></td> <td width="28%" bgcolor="#FFFFFF"><span class="style13"> <select name="proptype" id="proptype"> <option value="Apartment / Flat">Apartment/Flat</option> <option value="Cottage">Cottage</option> <option value="Detached Bungalow">Detached bungalow</option> <option value="Detached House">Detached House</option> <option value="Link House">Link House</option> <option value="Maisonette">Maisonette</option> <option value="Semi Detached Bungalow">Semi detached Bungalow</option> <option value="Semi Detached House">Semi Detached house</option> <option value="Terraced House">Terraced house</option> <option value="Town House">Town House</option> <option value="Please Select" selected="selected">Please Select</option> </select> </span> </td> </tr> <tr> <td bgcolor="#FFFFFF"><div align="right" class="style13 style12"><strong>Name:</strong></div></td> <td bgcolor="#FFFFFF"><input name="firstname" type="text" id="firstname" size="15" /></td> <td bgcolor="#FFFFFF"><span class="style13 style12 style21"><strong>Is the Property on the Market? </strong></span></td> <td bgcolor="#FFFFFF"><span class="style13"> <select name="propmarket" id="propmarket"> <option value="Please Select">Please Select</option> <option value="Yes">Yes</option> <option value="No">No</option> </select> </span> </td> </tr> <tr> <td bgcolor="#FFFFFF"><div align="right" class="style13 style12"><strong>Address:</strong></div></td> <td bgcolor="#FFFFFF"><input name="address1" type="text" id="address1" size="15" /></td> <td bgcolor="#FFFFFF"><span class="style13 style12 style21"><strong>If so, with which agent? </strong></span></td> <td bgcolor="#FFFFFF"><input name="agent" type="text" id="agent" size="15" /></td> </tr> <tr> <td bgcolor="#FFFFFF"><div align="right"></div></td> <td bgcolor="#FFFFFF"><input name="address2" type="text" id="address2" size="15" /></td> <td bgcolor="#FFFFFF"><span class="style13 style12 style21"><strong>How much is it on the market for? </strong></span></td> <td bgcolor="#FFFFFF"><input name="cost" type="text" id="cost" size="15" /></td> </tr> <tr> <td bgcolor="#FFFFFF"><div align="right" class="style13 style12"><strong>Post Code: </strong></div></td> <td bgcolor="#FFFFFF"><input name="postcode" type="text" id="postcode" size="15" /></td> <td bgcolor="#FFFFFF"><span class="style13 style12 style21"><strong>Do you wish to stay as a tenant after sale? </strong></span></td> <td bgcolor="#FFFFFF"><span class="style13"> <select name="tenant" id="tenant"> <option value="Please Select">Please Select</option> <option value="Yes">Yes</option> <option value="No">No</option> </select> </span></td> </tr> <tr> <td bgcolor="#FFFFFF"><div align="right" class="style13 style12"><strong>Tel:</strong></div></td> <td bgcolor="#FFFFFF"><input name="telephone" type="text" id="telephone" size="15" /></td> <td bgcolor="#FFFFFF"> </td> <td bgcolor="#FFFFFF"> </td> </tr> <tr> <td bgcolor="#FFFFFF"><div align="right" class="style13 style12"><strong>Mobile:</strong></div></td> <td bgcolor="#FFFFFF"><input name="mobile" type="text" id="mobile" size="15" /></td> <td bgcolor="#FFFFFF"> </td> <td bgcolor="#FFFFFF"> <input name="submit" type="submit" value="Send Mail" /></td> </tr> <tr> <td bgcolor="#FFFFFF"><div align="right" class="style13 style12"><strong>Email:</strong></div></td> <td bgcolor="#FFFFFF"><input name="email" type="text" id="email" size="15" /></td> <td bgcolor="#FFFFFF"> </td> <td bgcolor="#FFFFFF"> </td> </tr> <tr> <td height="8" bgcolor="#666666"><span class="style12"></span></td> <td height="8" bgcolor="#666666"><span class="style12"></span></td> <td height="8" bgcolor="#666666"><span class="style12"></span></td> <td height="8" bgcolor="#666666"></td> </tr> </table> </form> below is the php code <?php if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; echo $badinput; } if(empty($firstname) || empty($email) || empty($cardnumber) || empty($lastname )) { echo "<h2></h2>\n"; } $todayis = date("l, F j, Y, g:i a") ; $attn = $firstname ; $subject = "Valuation form from Homes Bought Today" ; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Title: $title \n Name: $firstname \n Address1: $address1 \n Address2: $address2 \n Postcode: $postcode \n Telephone: $telephone \n Mobile: $mobile \n Email: $email \n Type of Property: $proptype \n Mobile: $mobile \n Is your property on the market?: $propmarket \n If so Which Agent?: $agent \n How Much: $cost \n Do you wish to stay as a tenant?: $tenant \n From: $firstname ($email)\n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From: $email\r\n"; mail("joe@bloggs.com", $subject, $message, $from); ?> this script is a copy of an exsiting working one. any ideas please? Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 This is becase you are not using $_post to get the details from the form into your mail. Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 where does the $_post need to go (sorry im really new with php and really appreciating the help) Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 ok Well i am also new and forgive me if i get anything wrong. $_post goes where you want to call inforamtion form the form. For example you have Name: $firstname \n which should read Name: echo $_POST["firstname"]; The bit in the [ ] is the id name of the feild you want to copy across from the form. Change the whole php and it should work. Post any more problems. Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 no thats not worked either! argh have no idea what to do Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 post you php script Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 I am getting this error message: Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/homes/public_html/sendemail.php on line 146 <?php if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; echo $badinput; } if(empty($firstname) || empty($email) || empty($cardnumber) || empty($lastname )) { echo "<h2></h2>\n"; } $todayis = date("l, F j, Y, g:i a") ; $attn = $firstname ; $subject = "Valuation form from Homes Bought Today" ; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Title: $title \n Name: echo $_POST["firstname"]; Address1: echo $_POST["address1"]; Address2: echo $_POST["address2"] Postcode: echo $_POST["postcode"] Telephone: echo $_POST["telephone"] Mobile: echo $_POST["mobile"] Email: echo $_POST["email"] Type of Property: echo $_POST["proptype"] Is your property on the market?: echo $_POST["propmarket"] If so Which Agent?: echo $_POST["agent"] How Much: echo $_POST["cost"] Do you wish to stay as a tenant?: echo $_POST["tenant"] From: $firstname ($email)\n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From: $email\r\n"; mail("joe@bloggs.com", $subject, $message, $from); ?> Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 as i am new i am going to do some trouble shooting. This will help us both. Therefore bear with me. <?php if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; echo $badinput; } if(empty($firstname) || empty($email) || empty($cardnumber) || empty($lastname )) { echo "<h2></h2>\n"; } $todayis = date("l, F j, Y, g:i a") ; $attn = $firstname ; $subject = "Valuation form from Homes Bought Today" ; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Title: $title \n Name: echo $_POST["firstname"]; Address1: echo $_POST["address1"]; Address2: echo $_POST["address2"] Postcode: echo $_POST["postcode"] Telephone: echo $_POST["telephone"] Mobile: echo $_POST["mobile"] Email: echo $_POST["email"] Type of Property: echo $_POST["proptype"] Is your property on the market?: echo $_POST["propmarket"] If so Which Agent?: echo $_POST["agent"] How Much: echo $_POST["cost"] Do you wish to stay as a tenant?: echo $_POST["tenant"] From: $firstname ($email)\n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; echo $message; ?> I have just edited it by closing the php Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 no none of that works. i tried also taking out the commas in the lines so it read Name: echo $_POST[$firstname]; this allows the form to continue to the php page but still no information form the form was posted. cheers adam for helping with this. Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 ok we shall try and go back to basics. Like from the form just load the values. In the form are you sure action part is sending to the correct php file sendemail.php. form method="post" action="sendemail.php"> change to form action="post" action="sendemail.php"> Also in the sendemail.php we will go to basics. <?php echo $_POST["firstname"]; echo $_POST["address1"]; echo $_POST["address2"]; echo $_POST["postcode"]; echo $_POST["telephone"]; echo $_POST["mobile"]; echo $_POST["email"]; echo $_POST["proptype"]; echo $_POST["propmarket"]; echo $_POST["agent"]; echo $_POST["cost"]; echo $_POST["tenant"]; ?> Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 tried all that and now nothing at all comes through Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 does the page reload? what is the new http? what is on the screen after you click submit? That should work. Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 in the sendemail.php you did remove everything and just put in my code right? Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 yeah removed the lot and wouldnt work. this exact same script as i posted in original post works on another server, just not this one! Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 if it works on another serever and not your own it means the server you are working on doesn't have php installed Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 yeah im just checking with them. this is driving me barmy lol! Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 so got back to the orginal script that works. If the server doesn't have php then any php script will not work. If it does then what is the version. Remember to select topic solved once your done. Quote Link to comment Share on other sites More sharing options...
revraz Posted November 7, 2007 Share Posted November 7, 2007 Run a simple script like <?php phpinfo(); ?> And see what returns. yeah im just checking with them. this is driving me barmy lol! Quote Link to comment 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.