please I need help with my mail() the code is not executed

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-15-2007
shror
 
Posts: n/a
Default please I need help with my mail() the code is not executed

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

Reply With Quote
  #2 (permalink)  
Old 08-15-2007
Arjen
 
Posts: n/a
Default Re: please I need help with my mail() the code is not executed

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
Reply With Quote
  #3 (permalink)  
Old 08-15-2007
MishinOleg
 
Posts: n/a
Default Re: please I need help with my mail() the code is not executed

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



Reply With Quote
  #4 (permalink)  
Old 08-15-2007
shror
 
Posts: n/a
Default Re: please I need help with my mail() the code is not executed

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

Reply With Quote
  #5 (permalink)  
Old 08-15-2007
shror
 
Posts: n/a
Default Re: please I need help with my mail() the code is not executed

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");
?>

Reply With Quote
  #6 (permalink)  
Old 08-15-2007
Jerry Stuckle
 
Posts: n/a
Default Re: please I need help with my mail() the code is not executed

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
==================
Reply With Quote
  #7 (permalink)  
Old 08-15-2007
shror
 
Posts: n/a
Default Re: please I need help with my mail() the code is not executed

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

Reply With Quote
  #8 (permalink)  
Old 08-15-2007
Jerry Stuckle
 
Posts: n/a
Default Re: please I need help with my mail() the code is not executed

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
==================
Reply With Quote
  #9 (permalink)  
Old 08-15-2007
shror
 
Posts: n/a
Default Re: please I need help with my mail() the code is not executed

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

Reply With Quote
  #10 (permalink)  
Old 08-15-2007
Jerry Stuckle
 
Posts: n/a
Default Re: please I need help with my mail() the code is not executed

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
==================
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:51 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0