PHP mailform
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Hi Mac,
If you don't mind please visit the followin url
http://ski.voices-of-europe.de/checkout.php
once you finish the form just click at the "missing" image directly under the "comments"
Thanks for your help again!
If you don't mind please visit the followin url
http://ski.voices-of-europe.de/checkout.php
once you finish the form just click at the "missing" image directly under the "comments"
Thanks for your help again!
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Have you created a header and footer and put the paths to these in $header and $footer, ie, here:
Mac
Code: Select all
$header = "header.html";
$footer = "footer.html";- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Actually having looked at the code again there doesn't seem to be any passing of these variables, for example, this function:
should have an additional line added underneath the function definition:
The same problem occurs in the doError function too.
Mac
Code: Select all
function doFormError($errString) {
include($header);
echo "<FONT SIZE=+2>The form you submitted was not complete.<BR><BR></FONT>";
echo "$errString<BR><BR>\n";
echo "<INPUT TYPE=BUTTON ONCLICK='history.back()' VALUE=' Return to the checkout page '><HR>";
include($footer);
exit;
}Code: Select all
function doFormError($errString) {
global $header, $footer; // without this the function can't use these variablesMac
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Finally, try adding the following:
above this line:
Mac
Code: Select all
extract($_POST);Code: Select all
if (($b_first == "") || ($b_last == "") || ($b_addr == "") ||
($b_city == "") || ($b_state == "") || ($b_zip == "") ||
($b_phone == "") || ($b_email == "")) {Hi Mac,
Thanks for your time.
I did includ the first piece of code
global $header, $footer;
and now I am only getting the that my form was incomplete, although I filled in everything!?
As per the other code that you suggested I should include, can you tell me where in the code these should go?
Thanks!!!
Thanks for your time.
I did includ the first piece of code
global $header, $footer;
and now I am only getting the that my form was incomplete, although I filled in everything!?
As per the other code that you suggested I should include, can you tell me where in the code these should go?
Thanks!!!
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Put it above the line I indicated beneath the big block of comments that looks like this:
Mac
Code: Select all
//##############################################################
//##############################################################
//### MAIN ###
//##############################################################
//##############################################################- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
function doFormError($errString) {
global $header, $footer;
include($header);
echo "<FONT SIZE=+2>The form you submitted was not complete.<BR><BR></FONT>";
echo "$errString<BR><BR>\n";
echo "<INPUT TYPE=BUTTON ONCLICK='history.back()' VALUE=' Return to the checkout page '><HR>";
include($footer);
exit;
}
global $header, $footer;
include($header);
echo "<FONT SIZE=+2>The form you submitted was not complete.<BR><BR></FONT>";
echo "$errString<BR><BR>\n";
echo "<INPUT TYPE=BUTTON ONCLICK='history.back()' VALUE=' Return to the checkout page '><HR>";
include($footer);
exit;
}
if (($b_first == "") || ($b_last == "") || ($b_addr == "") ||
($b_city == "") || ($b_state == "") || ($b_zip == "") ||
($b_phone == "") || ($b_email == "")) {
extract($_POST);
if (($b_first == "") || ($b_last == "") || ($b_addr == "") || ($b_city == "") || ($b_state == "") || ($b_zip == "") || ($b_phone == "") || ($b_email == "")) {
doFormError("I'm sorry, but it appears that you forgot to fill in a required field. Please go <A HREF='Javascript:history.go(-1);'>back</A> and correct the error.");
exit;
}
//# checks for valid email address
if( !(ereg("^(.+)@(.+)\\.(.+)$",$b_email)) ) {
doFormError("You submitted an invalid email address. Please go <A HREF='Javascript:history.go(-1);'>back</A> and correct the error.");
exit;
}
($b_city == "") || ($b_state == "") || ($b_zip == "") ||
($b_phone == "") || ($b_email == "")) {
extract($_POST);
if (($b_first == "") || ($b_last == "") || ($b_addr == "") || ($b_city == "") || ($b_state == "") || ($b_zip == "") || ($b_phone == "") || ($b_email == "")) {
doFormError("I'm sorry, but it appears that you forgot to fill in a required field. Please go <A HREF='Javascript:history.go(-1);'>back</A> and correct the error.");
exit;
}
//# checks for valid email address
if( !(ereg("^(.+)@(.+)\\.(.+)$",$b_email)) ) {
doFormError("You submitted an invalid email address. Please go <A HREF='Javascript:history.go(-1);'>back</A> and correct the error.");
exit;
}
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You need to remove this:
from above
sorry that was the line from your code I was trying to indicate that the extract() line should be placed above.
Mac
Code: Select all
if (($b_first == "") || ($b_last == "") || ($b_addr == "") ||
($b_city == "") || ($b_state == "") || ($b_zip == "") ||
($b_phone == "") || ($b_email == "")) {Code: Select all
extract($_POST);Mac