Jump to content


Photo

blank page when retriving email


  • Please log in to reply
11 replies to this topic

#1 explore

explore
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 27 June 2006 - 12:54 PM

Hi i hope this is the right place to post this problem. I have a contact form on my site,when the form is filled out and sent all is well, i get the message saying email has been sent out. but when i go to retrieve the email the page is blank? what could be my problem

#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 27 June 2006 - 12:58 PM

What do you mean? You never recieve the emails?
If so, can you post the script so we'll see if there are no problems with it?

Orio.
Think you're smarty?

(Gone until 20 to November)

#3 explore

explore
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 27 June 2006 - 03:27 PM

hi
i do get the email but the page is blank i filled in the form sent it got the confirmation i check my emails there the message i open it but its blank nothing there no writing

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 27 June 2006 - 03:37 PM

Supply some code and we might be able to help. How are you creating the message part of the email?

#5 explore

explore
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 27 June 2006 - 03:45 PM

Hi whenyou ask for the code do you want the php script you can also go to the site
www.mypugpuppies.com

<html>
<base target="_self">
<META HTTP-EQUIV="REFRESH" CONTENT="3;URL=http://www.google.com">
</head>
<body bgcolor="FFFFFF" text="#444444">
<?
/*Script Made By Empire X.
   Support  at http://www.empirex.net/forum/
You can edit who the e-mail is sent to and the subject, look below.*/

$MailTo = "julie@mypugpuppies.com"; //email to send the results to
$MailSubject = "information"; //text in the Subject field of the mail
$MailHeader = "From: My Pug Puppies"; //text in the From field of the mail
$MailSent = "<center><img border=0 src=emailsent.gif width=450 height=350></center>"; //confirm image

/* You can edit the for fields below */



if ($s1 == ""){ //name of field 1

}
else {
     $MailBody = "Name :$_POST['1'] //This value is inserted inthe mailbody:$_POST['1']
}
if ($s2 == ""){

}
else {
     $MailBody .= "Company :$_POST['2']
}
if ($s3 == ""){
}
else {
     $MailBody .= "E-mail :$_POST['3']
}
if ($s4 == ""){

}
else {
     $MailBody .= "Subject : $_POST['4']
}
if ($s5 == ""){

}
else {
     $MailBody .= "Website Rating :$_POST['5'] 
}
if ($s6 == ""){

}
else {
     $MailBody .= "Referral :$_POST['6']
}
if ($s7 == ""){

}
else {
     $MailBody .= "Message : $_POST['7']
}

//Routine to send message

{
mail($MailTo, $MailSubject, $MailBody, $MailHeader);  //message send
echo("$MailSent"); //Confirmation message.
}
?>

<p>
<p>
<p>
<br>
<font face="verdana" size="1"><a href="http://www.empirex.net">Powered by Empire X Form Mail v.1.0</a> <a href="http://www.empirex.net/db/">From The X Database</a><p>
</body>
</html>


#6 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 27 June 2006 - 04:46 PM

You need to recieve the values. In your form, there are fields right? Depends on the method (GET or POST), you need to use the super-global vars according to the field names.

For example, if your form has the following field:
<input type="text" name="test123">
And the method of the form is POST, the value of it be set on $_POST['test123'].
You need to recieve the values from these super globals, and set the $s1, $s2 etc using them.

Orio.
Think you're smarty?

(Gone until 20 to November)

#7 explore

explore
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 27 June 2006 - 05:44 PM

Hi ok I did some changes in the above code can you look at it and tell me if this is going to work

#8 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 27 June 2006 - 05:56 PM

That is incorrect, idealy it should be this:
// check that $_POST['s1'] isset and that $_POST['s1'] is not empty
if (isset($_POST['s1']) && !empty($_POST['s1'])){ //name of field 1
     $MailBody = "Name :$_POST['s1'];
}
That code replaces this:
if ($s1 == ""){ //name of field 1

}
else {
     $MailBody = "Name :$_POST['1'] //This value is inserted inthe mailbody:$_POST['1']
}


#9 explore

explore
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 27 June 2006 - 08:43 PM

Hi thanks for taking time to help
this is my error now when adding the code this way
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/julie1/public_html/formmail/formmail.php on line 22


($s1 == ""){ //name of field 1

}
else {
     $MailBody = "Name :$_POST['name'];  
}
if ($s2 == ""){

}
else {
     $MailBody .= "Company : $_POST['company'];
}
if ($s3 == ""){
}
else {
     $MailBody .= "E-mail : $_POST['email'];


#10 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 28 June 2006 - 02:57 PM

You still havn't read my post correctly. Delete the following:
if ($s1 == ""){ //name of field 1

}
else {
     $MailBody = "Name :$_POST['name'];  
}
And replace the baove with this:
// check that $_POST['s1'] isset and that $_POST['s1'] is not empty
if (isset($_POST['s1']) && !empty($_POST['s1'])){ //name of field 1
     $MailBody = 'Name : $' . _POST['s1'] . "\n";
}
Thats the correct way!

#11 explore

explore
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 28 June 2006 - 04:52 PM

Hi ok is this ok and can i keep the field with the names in like this here
// check that $_POST['s1'] isset and that $_POST['s1'] is not empty
if (isset($_POST['s1']) && !empty($_POST['s1'])){ //name of field 1
     $MailBody = 'Name : $' . _POST['s1'] . "\n"; 
}
if ($s2 == ""){

}
else {
     $MailBody .= "Company : $_POST['company'];
}
if ($s3 == ""){
}
else {
     $MailBody .= "E-mail : $_POST['email'];
}
if ($s4 == ""){

}
else {
     $MailBody .= "Subject : $_POST['subject'];
}



#12 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 28 June 2006 - 05:56 PM

Yes thats ok for the First one, now you need to do it for the next three if/else statements. Make sure you have $_POST['s1'] to $_POST['s2'] for the secound if statement, $_POST['s3'] to the third if statement and so forth.

So your code looks like this:
if (isset($_POST['s1']) && !empty($_POST['s1'])) { //name of field 1
     $MailBody = 'Name : ' . $_POST['s1'] . "\n";
}

if (isset($_POST['s2']) && !empty($_POST['s2'])) { //name of field 2
    $MailBody = 'Company : ' . $_POST['s2'] . "\n";
}

if (isset($_POST['s3']) && !empty($_POST['s3'])) { //name of field 3
    $MailBody = 'E-mail : ' . $_POST['s3'] . "\n";
}

if (isset($_POST['s4']) && !empty($_POST['s4'])) { //name of field 4
    $MailBody = 'Subject : ' . $_POST['s4'] . "\n";
}





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users