PDA

View Full Version : Need Help With My php Script... I Think?



Skipper Si
06-29-2007, 12:03 PM
Hi There,

I'm sure this is something very stupid like I've missed a full stop somewhere but I've been through it about 8 times and my head hurts now...

After the submit button is clicked my 3rd page comes up fine but instead of all the details coming through all I get is an email like this:

(unknown sender)

First_Name:
Last_Name:
Email:
Telephone:

Here's the php code I'm using if anyone can spot what I've done wrong please point it out it's doing my head in!

<?php
@$First_Name = addslashes($_POST['First_Name']);
@$Last_Name = addslashes($_POST['Last_Name']);
@$Email = addslashes($_POST['Email']);
@$Telephone = addslashes($_POST['Telephone']);
$pfw_header = "From: $Email\n"
. "Reply-To: $Email\n";
$pfw_subject = "Lottery Report";
$pfw_email_to = "simon.p.fisher@googlemail.com";
$pfw_message = "First_Name: $First_Name\n"
. "Last_Name: $Last_Name\n"
. "Email: $Email\n"
. "Telephone: $Telephone\n"
;
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: page3.html");
?>

And here's the first link again www.report4free.co.uk (http://www.report4free.co.uk/)

Like I say all 3 pages come up fine I'm just not getting any details.

Cheers,

Si

Watdaflip
06-29-2007, 05:52 PM
Try changing
$pfw_message = "First_Name: $First_Name\n"
. "Last_Name: $Last_Name\n"
. "Email: $Email\n"
. "Telephone: $Telephone\n"
;
To
$pfw_message = "First_Name: ".$First_Name."\n"
. "Last_Name: ".$Last_Name."\n"
. "Email: ".$Email."\n"
. "Telephone: ".$Telephone."\n"
;

Skipper Si
06-30-2007, 07:37 AM
No joy I'm afraid :o(

I've just watched the vodahost tutorial on setting up forms and it's different to the tutorial I followed originally...

My instructions said to save the php script as an all files and copy it into the BlueFTP folder...

But vodahostess says to do it another way... I'll do it again, her way and get back to you...

Thanks for your help,

Si

Watdaflip
06-30-2007, 08:08 AM
Probably the first thing I should have asked, but are you sure that your form is correct. Do the "name" attributes match up (they are case sensitive)

navaldesign
06-30-2007, 12:03 PM
Your problem (i have already answered you in http://www.vodahost.com/vodatalk/saving-naming-previewing-publishing/24061-problems-links-between-pages.html#post166452 ,) is that you need to set the encoding type of your form in "multipart/formdata"

Skipper Si
06-30-2007, 09:41 PM
Ooo! You beat me to it!

I've just watched the form tutorial again and noticed that I forgot to change the encoding type...

It's all working fine now :o)

Thank you for all your help everybody, I really appreciate it.

I'm going to try a whole website next (not just a few pages) so I will no doubt be needing your help again soon.

Thanks again,

Si

Skipper Si
06-30-2007, 09:48 PM
i have already answered you in http://www.vodahost.com/vodatalk/saving-naming-previewing-publishing/24061-problems-links-between-pages.html#post166452

Sorry, I'm still a bit new to this forum game. Should have checked my other threads first :o)

Si