stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 http://www.homesboughttoday.co.uk/phptest.php to see out put please Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 If you are able to get phpinfo then the server is running php. If the form is working on one server then it should work on another. Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 yeah you would think wouldnt you. its just the responses that do not show up whih is weird, the rest of the message shows Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 i am not sure then. When you click submit does anything display? can you give me a hyperlink so i can have a look Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 http://www.homesboughttoday.co.uk/request.html Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 7, 2007 Share Posted November 7, 2007 I saw the code , it is working. The mail is sent to "joe@bloggs.com". Is this mail real ? Do you have access to it ?  Try keeping it in a variable like you did in your code <?php $to = 'joe@bloggs.com'; // and in mail keep like this mail($to, $subject, $message, $from);  Here is one example from PHP manual  <?php $to   = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" .   'Reply-To: webmaster@example.com' . "\r\n" .   'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 that what newbies do. Over look the obvious. HAHAHAHAHA Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 n~ link=topic=166708.msg734390#msg734390 date=1194451666] I saw the code , it is working. The mail is sent to "joe@bloggs.com". Is this mail real ? Do you have access to it ?  Try keeping it in a variable like you did in your code <?php $to = 'joe@bloggs.com'; // and in mail keep like this mail($to, $subject, $message, $from);  Here is one example from PHP manual  <?php $to   = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" .   'Reply-To: webmaster@example.com' . "\r\n" .   'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?>  tried that and hasnt worked again. no joe@bloggs.com is not the real address it comes though to my email at the moment Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 did you get the email throgh that i send through the link you gave me? Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 yeah  this is the email output that comes through to my inbox  Wednesday, November 7, 2007, 4:18 pm [EST]  From: ()  Title:  Name:  Address1:  Address2:  Postcode:  Telephone:  Mobile:  Email:  Type of Property:  Is your property on the market?:  If so Which Agent?:  How Much:  Do you wish to stay as a tenant?:  From: ()  Additional Info : IP =  Browser Info:  Referral :   Quote Link to comment Share on other sites More sharing options...
adam291086 Posted November 7, 2007 Share Posted November 7, 2007 This is werid. You say it worked on another server? Post the code you are currently using. There is so much now i am confused? Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 7, 2007 Share Posted November 7, 2007 I saw the link, no validation, the form submits blank. And the code needs to be redone. At least you see some examples. Â Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 n~ link=topic=166708.msg734403#msg734403 date=1194452532] I saw the link, no validation, the form submits blank. And the code needs to be redone. At least you see some examples. Â Â sorry neo what do you mean? Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 <?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($visitormail) || empty($mobile) || empty($cost )) { echo "<h2></h2>\n"; } $to = 'joe@bloggs.com'; $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 From: $firstname ($visitormail) \n Title: $title \n Name: $firstname \n Address1: $address1 \n Address2: $address2 \n Postcode: $postcode \n Telephone: $telephone \n Mobile: $mobile \n Email: $visitormail \n Type of Property: $proptype \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 ($visitormail)\n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From: $visitormail\r\n"; mail($to, $subject, $message, $from); ?> Quote Link to comment Share on other sites More sharing options...
aschk Posted November 7, 2007 Share Posted November 7, 2007 Why not just try something simple in your sendemail.php script like : Â <?php $to = "youremail@yourdomain.com"; $subject = " my subject "; $message = " blah blah blah $_POST['firstname'] "; if(mail($to, $subject, $message)){ Â echo "mail sent"; } ?> Â At least this way you're going to see the firstname Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 7, 2007 Share Posted November 7, 2007 Your code is not good I meant , when I submit the form here http://www.homesboughttoday.co.uk/sendemail.php without filling out any fields then this message comes Thank you for submitting your valuation form One of our agents will be in contact shortly  I meant it is not really good thing in a live site.  And you have PHP codes in your HTML files too, in request.html  <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 ?>" /> Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 aschk your code returned this error Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/homes/public_html/sendemail.php on line 130 Â Â neo the php in the form was suggested by the original writer in another forum a long time ago. Â im appreciating all the help but i have no idea why this will not just work? Quote Link to comment Share on other sites More sharing options...
aschk Posted November 7, 2007 Share Posted November 7, 2007 That's interesting, considering my code is only about 10 lines long... Put all that code ONLY into your sendemail.php file. Backup your old one and run mine in it's place. Â Also you might like to put this at the bottom before the last ?> print_r($_POST); Â This will tell you what you have in your post from the previous form. Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 i just tired the exact same forms on another server and got this email back for the fields i filled in   Wednesday, November 7, 2007, 4:45 pm [EST]  From: test (test@test.com)  Title: test  Name: test ; Address1: test  Address2: test  Postcode:  Telephone:  Mobile:  Email: test@test.com  Type of Property: Please Select  Is your property on the market?: Please Select  If so Which Agent?:  How Much:  Do you wish to stay as a tenant?: Please Select  From: test (test@test.com)  Additional Info : IP = <?php echo $ipi ?>  Browser Info: <?php echo $httpagenti ?>  Referral : <?php echo $httprefi ?>   Quote Link to comment Share on other sites More sharing options...
aschk Posted November 7, 2007 Share Posted November 7, 2007 Yeah I thought so , having just checked your script and your phpinfo information. You're using the much antiquated global variables, so when you submit a form you're expecting $firstname to be a variable. This is OLD syntax and I hurriedly recommend you move onto the newer format which has been present since 4.1.0 . Â Use $_POST['firstname'] instead of $firstname. Currently your php information shows that you have register_globals set to "Off" and too rightly too. It's a security nightmare. Start using the correct $_POST & $_GET parameters now please. Â No wonder it didn't work, we all thought you were converting your local variables like $firstname = $_POST['firstname'] , lol Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 7, 2007 Share Posted November 7, 2007 First of all I suggest you to rename your request.html file to request.php file (where the form is) , then you can check for validation etc... After the user fills the form and if the mail has been sent successfully you can redirect him to sendmail.php page (which you can make html page also and just display the message) and In your request.php file you can keep the code  <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { // you can assign these REQUEST in variables for your ease too... if (empty($_REQUEST['title'])) echo $_REQUEST['title']; $msg = "Please enter title <Br>"; if (empty($_REQUEST['email'])) $msg .= "Please enter email <Br>"; if(!ereg("[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]", $_REQUEST['email'])) $msg .= "Email not valid <Br>"; if (empty($_REQUEST['name'])) echo $_REQUEST['name']; $msg .= "Please enter your name <Br>"; if (empty($_REQUEST['telephone'])) $msg .= "Please enter an telephone <Br>"; if (empty($_REQUEST['address'])) $msg .= "Please enter address <Br>"; if (empty($_REQUEST['lastname'])) $msg .= "Please enter last name <Br>"; // this will check if there is error or not if there is no error then send the mail if (empty($msg)) { // in this way you can add other and send the mail $message = "Title :".$_REQUEST['title']."\r\n"."Name :".$_REQUEST['name']; $from = "From: ".$email."\r\n"; $to = 'joe@bloggs.com'; mail($to, $subject, $message, $from); echo "Mail Sent Succesfully"; // after the mail is send redirect the user to Other page or you can just display the message here } else { echo "There are some errors."; } } ?>   Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 code looks like this, no idea if that right  <?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($visitormail) || empty($mobile) || empty($cost )) { echo "<h2></h2>\n"; } $to = 'smnoconnor@gmail.com'; $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 From:$_POST['firstname'] Title:$_POST['title'] Name:$_POST['firstname'] Address1:$_POST['address1'] Address2:$_POST['address2'] Postcode:$_POST['postcode'] Telephone:$_POST['telephone'] Mobile:$_POST['mobile'] Email:$_POST['visitormail'] Type of Property:$_POST['proptype'] Is your property on the market?:$_POST['propmarket'] If so Which Agent?:$_POST['agent'] How Much: $_POST['cost'] Do you wish to stay as a tenant?: $_POST['tenant'] From: $_POST['firstname'] ($_POST['visitormail']) Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From:$_POST['visitormail]\r\n"; mail($to, $subject, $message, $from); ?>  Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 7, 2007 Share Posted November 7, 2007 Sorry to say your code is not good, you cannot just modify it. You should change the request.html file to request.php file and keep the code in the same page and after the mail is sent you can redirect the user to show the message you have shown . Thank you .......... Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 how do i link the form to the code (ie <form action=?>) and where do i place the php code in the request.php? thanks for this  n~ link=topic=166708.msg734473#msg734473 date=1194456533] First of all I suggest you to rename your request.html file to request.php file (where the form is) , then you can check for validation etc... After the user fills the form and if the mail has been sent successfully you can redirect him to sendmail.php page (which you can make html page also and just display the message) and In your request.php file you can keep the code  <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { // you can assign these REQUEST in variables for your ease too... if (empty($_REQUEST['title'])) echo $_REQUEST['title']; $msg = "Please enter title <Br>"; if (empty($_REQUEST['email'])) $msg .= "Please enter email <Br>"; if(!ereg("[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]", $_REQUEST['email'])) $msg .= "Email not valid <Br>"; if (empty($_REQUEST['name'])) echo $_REQUEST['name']; $msg .= "Please enter your name <Br>"; if (empty($_REQUEST['telephone'])) $msg .= "Please enter an telephone <Br>"; if (empty($_REQUEST['address'])) $msg .= "Please enter address <Br>"; if (empty($_REQUEST['lastname'])) $msg .= "Please enter last name <Br>"; // this will check if there is error or not if there is no error then send the mail if (empty($msg)) { // in this way you can add other and send the mail $message = "Title :".$_REQUEST['title']."\r\n"."Name :".$_REQUEST['name']; $from = "From: ".$email."\r\n"; $to = 'joe@bloggs.com'; mail($to, $subject, $message, $from); echo "Mail Sent Succesfully"; // after the mail is send redirect the user to Other page or you can just display the message here } else { echo "There are some errors."; } } ?>   Quote Link to comment Share on other sites More sharing options...
stupid girl! Posted November 7, 2007 Author Share Posted November 7, 2007 managed with your guys help to sort it out (thanks neo especially for giving me the code) Â kept the request.html and used the sendemail.php to teh code that neo posted above and works fine! Â thanks guys really appreciate it! 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.