View Full Version : PHP help with script
wout000
07-16-2003, 05:17 PM
I use an email script on my php site for many reasons as feedback and so one
but there is a flaw in it, the function that normally sends someone after using the script to another page doesn't work ;(
this is really bad because now when someone gives feedback he sees a blank page
for the script go to http://members.lycos.nl/fcemoerbeke/emailform.php
please help
whackaxe
07-16-2003, 05:23 PM
post your code please. if you look at the soruce youll realise that output cuts after the body tag, loo kat your code for that part
wout000
07-16-2003, 05:41 PM
this is my code
<HTML>
<HEAD>
<TITLE>F.C.E. Moerbeke vzw</TITLE>
</HEAD>
<BODY>
<?php
// your name
$yourname = "Fce - Moerbeke";
// your email
$youremail = "fcemoerbeke@lycos.nl";
// Default Send Page
$yourdefaultsend = "http://users.pandora.be/moerbeke/sent.html";
////////////////////////////////////////////////////////////////////////////
// DO NOT EDIT BELOW THIS LINE //
////////////////////////////////////////////////////////////////////////////
if($submitform) {
$dcheck = explode(",",$require);
while(list($check) = each($dcheck)) {
if(!$$dcheck[$check]) {
$error .= "Missing $dcheck[$check]<BR>";
}
}
if($error) {
?>
<P><CENTER><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD WIDTH="100%" BGCOLOR="#004080">
<TABLE WIDTH="394" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD WIDTH="26%" BGCOLOR="#004080">
<P><B><FONT COLOR="#ffffff" SIZE="-1" FACE="Verdana">Error</FONT></B></TD>
</TR>
<TR>
<TD WIDTH="26%" BGCOLOR="#ffffff">
<FONT COLOR="#000000" SIZE="-1" FACE="Verdana"><?php echo $error; ?></FONT></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER>
<P><CENTER> </CENTER></P>
</BODY></HTML>
<?php
exit();
}
if ($fromname) {
$yeshow = "\nFrom, $fromname\n";
}
mail($toemail,"$subject","
$message
$problem
$yeshow
","From: $fromname <$fromemail>");
header("Location: $sendpage");
exit();
} else {
?>
<FORM ACTION="emailform.php" METHOD="POST">
<P><CENTER>
<TR>
<TD WIDTH="100%" BGCOLOR="#004080">
<TABLE WIDTH="394" BORDER="0" CELLSPACING="1" CELLPADDING="2">
<TR>
<TD COLSPAN="2" BGCOLOR="#004080">
<B><FONT COLOR="#ffffff" SIZE="-1" FACE="Verdana">Feedback Formulier</FONT></B></TD>
</TR>
<TR>
<TD WIDTH="48%" BGCOLOR="#ffffff">
<B>Naam:</B></TD>
<TD WIDTH="52%" BGCOLOR="#ffffff">
<INPUT NAME="fromname" TYPE="text" SIZE="35">
</TD>
</TR>
<TR>
<TD WIDTH="48%" BGCOLOR="#ffffff">
<B>Emailadress:</B></TD>
<TD WIDTH="52%" BGCOLOR="#ffffff">
<INPUT NAME="fromemail" TYPE="text" SIZE="35">
</TD>
</TR>
<TR>
<TD COLSPAN="2" BGCOLOR="#ffffff">
<B>Feedback:</B><BR><textarea name="message" cols="45" rows="6" class="textbox">feedback</textarea></FONT></B></TD></TR>
<TR>
<TD COLSPAN="2" BGCOLOR="#ffffff">
<B>Probleem:</B><BR><textarea name="problem" cols="45" rows="6" class="textbox">Uw probleem</textarea></FONT></B></TD>
<BR><INPUT
TYPE="hidden" NAME="subject" VALUE="Feedback Formulier">
<INPUT TYPE="hidden" NAME="toemail" VALUE="<?php echo $youremail; ?>">
<INPUT TYPE="hidden" NAME="toname" VALUE="<?php echo $yourname; ?>">
<INPUT TYPE="hidden" NAME="require" VALUE="fromname,fromemail,message,problem">
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER><p>
<td><div align="center"> <input type="reset" name="Reset" value="Reset">
<INPUT NAME="submitform" TYPE="submit" VALUE="Submit"></div></CENTER></FORM></P>
</td>
<INPUT TYPE="hidden" NAME="sendpage" VALUE="<?php echo $yourdefaultsend; ?>">
<P><CENTER> </CENTER></P>
</BODY></HTML>
<?php
exit();
}
?>
IronCode
07-17-2003, 01:11 AM
Originally posted by wout000
// Default Send Page
$yourdefaultsend = "http://users.pandora.be/moerbeke/sent.html";
.
.
mail($toemail,"$subject","
$message
$problem
$yeshow
","From: $fromname <$fromemail>");
header("Location: $sendpage");
exit();
?>
should be the following,
header("location: $yourdefaultsend");
Do you see the error? You have the send page variable names are different, change those to be the same and the problem should be fixed.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.