This is a discussion on please I need help with my mail() the code is not executed within the PHP Language forums, part of the PHP Programming Forums category; Hi every body, Please I need your help solving my php mail() function problem that the code is appearing in ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi every body,
Please I need your help solving my php mail() function problem that the code is appearing in the view source and I dont know whats the problem where I am using another page tto test the php and its executed very nice The page have php code viewed : http://beachtoursegypt.com/booking-form.htm where after submitting the form the data are sent to the confirmation age where the php script lies there and its not executed the page with the other php code example running is: http://beachtoursegypt.com/123.php please help me in this urgent problem |
|
|||
|
shror wrote:
> Hi every body, > Please I need your help solving my php mail() function problem that > the code is appearing in the view source and I dont know whats the > problem where I am using another page tto test the php and its > executed very nice > > The page have php code viewed : http://beachtoursegypt.com/booking-form.htm > where after submitting the form the data are sent to the confirmation > age where the php script lies there and its not executed > > the page with the other php code example running is: http://beachtoursegypt.com/123.php We cant really help without seeing the code. If php is executing there might be trouble with the mail setup or your script may contain errors. mail() returns true or false on completion so try if(mail('','','')) { // confirm } else { // problem } -- Arjen www.arjenkarel.nl |
|
|||
|
May be the permission for the script file do not allow to execute
it... On Aug 15, 12:52 pm, shror <shahi...@gmail.com> wrote: > Hi every body, > Please I need your help solving my php mail() function problem that > the code is appearing in the view source and I dont know whats the > problem where I am using another page tto test the php and its > executed very nice > > The page have php code viewed :http://beachtoursegypt.com/booking-form.htm > where after submitting the form the data are sent to the confirmation > age where the php script lies there and its not executed > > the page with the other php code example running is:http://beachtoursegypt.com/123.php > > please help me in this urgent problem |
|
|||
|
On Aug 15, 10:33 am, Arjen <d...@mail.me> wrote:
> shror wrote: > > Hi every body, > > Please I need your help solving my php mail() function problem that > > the code is appearing in the view source and I dont know whats the > > problem where I am using another page tto test the php and its > > executed very nice > > > The page have php code viewed :http://beachtoursegypt.com/booking-form.htm > > where after submitting the form the data are sent to the confirmation > > age where the php script lies there and its not executed > > > the page with the other php code example running is:http://beachtoursegypt.com/123.php > > We cant really help without seeing the code. If php is executing there > might be trouble with the mail setup or your script may contain errors. > mail() returns true or false on completion so try > > if(mail('','','')) > { > // confirm} > > else > { > // problem > > } > > -- > Arjenwww.arjenkarel.nl I have tried your code and it gave me an error (//problem) so what could be the problem now really am not sure whats wrong you can check the page having the piece of code you gave me at this link: http://beachtoursegypt.com/123.php its code is here too: <body> <?php $i=1; while($i<=5) { echo "The number is " . $i . "<br />"; $i++; } if(mail('','','')) { // confirm echo "confirm"; } else { // problem echo "error"; } ?> </body> thanks for your support |
|
|||
|
also the mail() I used here it is:
<?php $FirstName = $_POST["FirstName"]; $FamilyName = $_POST["FamilyName"]; $name = "Full Name: " . $FirstName $FamilyName; $Address = $_POST["Address"]; $Email = $_POST["Email"]; $Phone = $_POST["Phone"]; $City = $_POST["City"]; $Zipcode = $_POST=["Zipcode"]; $Otherdata = $_POST["Otherdata"]; $data = "Address: " . $Address . "E-mail: " . $Email \n . "Phone: " . $Phone \n . "City: " . $City \n . "Zip code: " . $Zipcode \n . "Other Data: " . $Otherdata; $Adults = $_POST["Adults"]; $Children = $_POST["Children"]; $Infants = $_POST["Infants"]; $persons = "Adults: " . $Adults \n . "Children: " . $Children \n . "Infants: " . $Infants \n; $Arrdate = $_POST["Arrivaldate"]; $Depdate = $_POST["Departuredate"]; $Arrflight = $_POST["ArrivalFlight"]; $Depflight = $_POST["DepartureFlight"]; $time ="Arrival date: " . $Arrdate \n . "Departure date: " . $Depdate \n . "Arrival Flight: " . $Arrflight \n . "Departure flight: " . $Depflight \n; $Singleroom = $_POST["Singleroom"']; $Doubleroom = $_POST["Doubleroom"]; $Trebleroom = $_POST["Trebleroom"]; $MoreComments = $_POST["MoreComments"]; $needs ="Number of Single room(s): " . $Singleroom \n . "Number of double room(s): " . $Doubleroom \n . "Number of tribleroom(s): " . $Trebleroom; $to = "me @ mydomain"; $from ="$Email"; $subject = "BeachTours Booking Form"; $message = "You recieved a new message from your website, \n its details are as follows:\n\n $name \n $data \n\n $persons \n\n $time\n \n $needs \n" mail("$to","$subject","$message","$from\r\n" . "Reply-To: $from\r\n" . "X-Mailer: www.BeachToursEgypt.com"); ?> |
|
|||
|
shror wrote:
> also the mail() I used here it is: > > <?php > $FirstName = $_POST["FirstName"]; > $FamilyName = $_POST["FamilyName"]; > $name = "Full Name: " . $FirstName $FamilyName; > $Address = $_POST["Address"]; > $Email = $_POST["Email"]; > $Phone = $_POST["Phone"]; > $City = $_POST["City"]; > $Zipcode = $_POST=["Zipcode"]; > $Otherdata = $_POST["Otherdata"]; > $data = "Address: " . $Address . "E-mail: " . $Email \n . "Phone: " . > $Phone \n . "City: " . $City \n . "Zip code: " . $Zipcode \n . "Other > Data: " . $Otherdata; > $Adults = $_POST["Adults"]; > $Children = $_POST["Children"]; > $Infants = $_POST["Infants"]; > $persons = "Adults: " . $Adults \n . "Children: " . $Children \n . > "Infants: " . $Infants \n; > $Arrdate = $_POST["Arrivaldate"]; > $Depdate = $_POST["Departuredate"]; > $Arrflight = $_POST["ArrivalFlight"]; > $Depflight = $_POST["DepartureFlight"]; > $time ="Arrival date: " . $Arrdate \n . "Departure date: " . $Depdate > \n . "Arrival Flight: " . $Arrflight \n . "Departure flight: " . > $Depflight \n; > $Singleroom = $_POST["Singleroom"']; > $Doubleroom = $_POST["Doubleroom"]; > $Trebleroom = $_POST["Trebleroom"]; > $MoreComments = $_POST["MoreComments"]; > $needs ="Number of Single room(s): " . $Singleroom \n . "Number of > double room(s): " . $Doubleroom \n . "Number of tribleroom(s): " . > $Trebleroom; > $to = "me @ mydomain"; > $from ="$Email"; > $subject = "BeachTours Booking Form"; > $message = "You recieved a new message from your website, \n its > details are as follows:\n\n $name \n $data \n\n $persons \n\n $time\n > \n $needs \n" > mail("$to","$subject","$message","$from\r\n" . "Reply-To: $from\r\n" . > "X-Mailer: www.BeachToursEgypt.com"); > ?> > $name = "Full Name: " . $FirstName . $FamilyName; Missing ^ $to = "me @ mydomain"; ^ ^ Remove spaces There may be other errors - these I spotted right off the top. Also, this form is insecure and can be use by spammers by header injection. Always validate any information from the user! -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
On Aug 15, 2:58 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> shror wrote: > > also the mail() I used here it is: > > > <?php > > $FirstName = $_POST["FirstName"]; > > $FamilyName = $_POST["FamilyName"]; > > $name = "Full Name: " . $FirstName $FamilyName; > > $Address = $_POST["Address"]; > > $Email = $_POST["Email"]; > > $Phone = $_POST["Phone"]; > > $City = $_POST["City"]; > > $Zipcode = $_POST=["Zipcode"]; > > $Otherdata = $_POST["Otherdata"]; > > $data = "Address: " . $Address . "E-mail: " . $Email \n . "Phone: " . > > $Phone \n . "City: " . $City \n . "Zip code: " . $Zipcode \n . "Other > > Data: " . $Otherdata; > > $Adults = $_POST["Adults"]; > > $Children = $_POST["Children"]; > > $Infants = $_POST["Infants"]; > > $persons = "Adults: " . $Adults \n . "Children: " . $Children \n . > > "Infants: " . $Infants \n; > > $Arrdate = $_POST["Arrivaldate"]; > > $Depdate = $_POST["Departuredate"]; > > $Arrflight = $_POST["ArrivalFlight"]; > > $Depflight = $_POST["DepartureFlight"]; > > $time ="Arrival date: " . $Arrdate \n . "Departure date: " . $Depdate > > \n . "Arrival Flight: " . $Arrflight \n . "Departure flight: " . > > $Depflight \n; > > $Singleroom = $_POST["Singleroom"']; > > $Doubleroom = $_POST["Doubleroom"]; > > $Trebleroom = $_POST["Trebleroom"]; > > $MoreComments = $_POST["MoreComments"]; > > $needs ="Number of Single room(s): " . $Singleroom \n . "Number of > > double room(s): " . $Doubleroom \n . "Number of tribleroom(s): " . > > $Trebleroom; > > $to = "me @ mydomain"; > > $from ="$Email"; > > $subject = "BeachTours Booking Form"; > > $message = "You recieved a new message from your website, \n its > > details are as follows:\n\n $name \n $data \n\n $persons \n\n $time\n > > \n $needs \n" > > mail("$to","$subject","$message","$from\r\n" . "Reply-To: $from\r\n" . > > "X-Mailer:www.BeachToursEgypt.com"); > > ?> > > $name = "Full Name: " . $FirstName . $FamilyName; > Missing ^ > > $to = "me @ mydomain"; > ^ ^ Remove spaces > > There may be other errors - these I spotted right off the top. > > Also, this form is insecure and can be use by spammers by header > injection. Always validate any information from the user! > > -- > ================== > Remove the "x" from my email address > Jerry Stuckle > JDS Computer Training Corp. > jstuck...@attglobal.net > ================== the problem is not in my php code but its that the script is not executed and the php source is visible in my page and i dont know why because other pages on the same place with this page are executed correctly |
|
|||
|
shror wrote:
> On Aug 15, 2:58 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote: >> shror wrote: >>> also the mail() I used here it is: >>> <?php >>> $FirstName = $_POST["FirstName"]; >>> $FamilyName = $_POST["FamilyName"]; >>> $name = "Full Name: " . $FirstName $FamilyName; >>> $Address = $_POST["Address"]; >>> $Email = $_POST["Email"]; >>> $Phone = $_POST["Phone"]; >>> $City = $_POST["City"]; >>> $Zipcode = $_POST=["Zipcode"]; >>> $Otherdata = $_POST["Otherdata"]; >>> $data = "Address: " . $Address . "E-mail: " . $Email \n . "Phone: " . >>> $Phone \n . "City: " . $City \n . "Zip code: " . $Zipcode \n . "Other >>> Data: " . $Otherdata; >>> $Adults = $_POST["Adults"]; >>> $Children = $_POST["Children"]; >>> $Infants = $_POST["Infants"]; >>> $persons = "Adults: " . $Adults \n . "Children: " . $Children \n . >>> "Infants: " . $Infants \n; >>> $Arrdate = $_POST["Arrivaldate"]; >>> $Depdate = $_POST["Departuredate"]; >>> $Arrflight = $_POST["ArrivalFlight"]; >>> $Depflight = $_POST["DepartureFlight"]; >>> $time ="Arrival date: " . $Arrdate \n . "Departure date: " . $Depdate >>> \n . "Arrival Flight: " . $Arrflight \n . "Departure flight: " . >>> $Depflight \n; >>> $Singleroom = $_POST["Singleroom"']; >>> $Doubleroom = $_POST["Doubleroom"]; >>> $Trebleroom = $_POST["Trebleroom"]; >>> $MoreComments = $_POST["MoreComments"]; >>> $needs ="Number of Single room(s): " . $Singleroom \n . "Number of >>> double room(s): " . $Doubleroom \n . "Number of tribleroom(s): " . >>> $Trebleroom; >>> $to = "me @ mydomain"; >>> $from ="$Email"; >>> $subject = "BeachTours Booking Form"; >>> $message = "You recieved a new message from your website, \n its >>> details are as follows:\n\n $name \n $data \n\n $persons \n\n $time\n >>> \n $needs \n" >>> mail("$to","$subject","$message","$from\r\n" . "Reply-To: $from\r\n" . >>> "X-Mailer:www.BeachToursEgypt.com"); >>> ?> >> $name = "Full Name: " . $FirstName . $FamilyName; >> Missing ^ >> >> $to = "me @ mydomain"; >> ^ ^ Remove spaces >> >> There may be other errors - these I spotted right off the top. >> >> Also, this form is insecure and can be use by spammers by header >> injection. Always validate any information from the user! >> >> -- >> ================== >> Remove the "x" from my email address >> Jerry Stuckle >> JDS Computer Training Corp. >> jstuck...@attglobal.net >> ================== > > the problem is not in my php code but its that the script is not > executed and the php source is visible in my page and i dont know why > because other pages on the same place with this page are executed > correctly > Does the file have a .php extension? -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
On Aug 15, 3:19 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> shror wrote: > > On Aug 15, 2:58 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote: > >> shror wrote: > >>> also the mail() I used here it is: > >>> <?php > >>> $FirstName = $_POST["FirstName"]; > >>> $FamilyName = $_POST["FamilyName"]; > >>> $name = "Full Name: " . $FirstName $FamilyName; > >>> $Address = $_POST["Address"]; > >>> $Email = $_POST["Email"]; > >>> $Phone = $_POST["Phone"]; > >>> $City = $_POST["City"]; > >>> $Zipcode = $_POST=["Zipcode"]; > >>> $Otherdata = $_POST["Otherdata"]; > >>> $data = "Address: " . $Address . "E-mail: " . $Email \n . "Phone: " . > >>> $Phone \n . "City: " . $City \n . "Zip code: " . $Zipcode \n . "Other > >>> Data: " . $Otherdata; > >>> $Adults = $_POST["Adults"]; > >>> $Children = $_POST["Children"]; > >>> $Infants = $_POST["Infants"]; > >>> $persons = "Adults: " . $Adults \n . "Children: " . $Children \n . > >>> "Infants: " . $Infants \n; > >>> $Arrdate = $_POST["Arrivaldate"]; > >>> $Depdate = $_POST["Departuredate"]; > >>> $Arrflight = $_POST["ArrivalFlight"]; > >>> $Depflight = $_POST["DepartureFlight"]; > >>> $time ="Arrival date: " . $Arrdate \n . "Departure date: " . $Depdate > >>> \n . "Arrival Flight: " . $Arrflight \n . "Departure flight: " . > >>> $Depflight \n; > >>> $Singleroom = $_POST["Singleroom"']; > >>> $Doubleroom = $_POST["Doubleroom"]; > >>> $Trebleroom = $_POST["Trebleroom"]; > >>> $MoreComments = $_POST["MoreComments"]; > >>> $needs ="Number of Single room(s): " . $Singleroom \n . "Number of > >>> double room(s): " . $Doubleroom \n . "Number of tribleroom(s): " . > >>> $Trebleroom; > >>> $to = "me @ mydomain"; > >>> $from ="$Email"; > >>> $subject = "BeachTours Booking Form"; > >>> $message = "You recieved a new message from your website, \n its > >>> details are as follows:\n\n $name \n $data \n\n $persons \n\n $time\n > >>> \n $needs \n" > >>> mail("$to","$subject","$message","$from\r\n" . "Reply-To: $from\r\n" . > >>> "X-Mailer:www.BeachToursEgypt.com"); > >>> ?> > >> $name = "Full Name: " . $FirstName . $FamilyName; > >> Missing ^ > > >> $to = "me @ mydomain"; > >> ^ ^ Remove spaces > > >> There may be other errors - these I spotted right off the top. > > >> Also, this form is insecure and can be use by spammers by header > >> injection. Always validate any information from the user! > > >> -- > >> ================== > >> Remove the "x" from my email address > >> Jerry Stuckle > >> JDS Computer Training Corp. > >> jstuck...@attglobal.net > >> ================== > > > the problem is not in my php code but its that the script is not > > executed and the php source is visible in my page and i dont know why > > because other pages on the same place with this page are executed > > correctly > > Does the file have a .php extension? > > -- > ================== > Remove the "x" from my email address > Jerry Stuckle > JDS Computer Training Corp. > jstuck...@attglobal.net > ================== yes and I have uploaded it so many times but no solution and the other page .php is running correctly as i stated before so where is the problem i dont know |
|
|||
|
shror wrote:
> On Aug 15, 3:19 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote: >> shror wrote: === > > yes > and I have uploaded it so many times but no solution > and the other page .php is running correctly as i stated before > so where is the problem i dont know > I looked at your code and didn't see anything obviously wrong (other than numerous syntax errors). I uploaded it to my test system and after fixing the syntax errors it parsed the file fine (of course it didn't send the mail because I have the mail server disabled on this machine). I do see you're using FrontPage. It does put some hooks into the system, and I suspect this might be your problem - it somehow doesn't think this is a PHP file. I'd recommend you follow up in a FrontPage newsgroup. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |