Please tell me why this form doesn't work

www.pixelatedportraits.co.uk/makeanorder.html
FW3.5

I have set up this form as a novice and followed the instructions of my ISP and the FW3.5 manual, and although I do receive an email, it only contains the message ‘from: nn’. In addition, when I click the submit button, instead of being redirected to the ‘thanks’ page I get the following:

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /homepages/43/d161055742/htdocs/PixelatedPortraits/mail.php on line 7

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /homepages/43/d161055742/htdocs/PixelatedPortraits/mail.php on line 8

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /homepages/43/d161055742/htdocs/PixelatedPortraits/mail.php on line 9

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /homepages/43/d161055742/htdocs/PixelatedPortraits/mail.php on line 10

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /homepages/43/d161055742/htdocs/PixelatedPortraits/mail.php on line 11

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /homepages/43/d161055742/htdocs/PixelatedPortraits/mail.php on line 12

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /homepages/43/d161055742/htdocs/PixelatedPortraits/mail.php on line 13

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /homepages/43/d161055742/htdocs/PixelatedPortraits/mail.php on line 14

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /homepages/43/d161055742/htdocs/PixelatedPortraits/mail.php on line 15

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /homepages/43/d161055742/htdocs/PixelatedPortraits/mail.php on line 16

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /homepages/43/d161055742/htdocs/PixelatedPortraits/mail.php on line 17
{rtf1macansicpg10000cocoartf102 {fonttblf0fswissfcharset77 Helvetica;} {colortbl;red255green255blue255;} paperw11900paperh16840margl1440margr1440vieww9000viewh9000viewkind0 pardtx566tx1133tx1700tx2267tx2834tx3401tx3968tx4535tx5102tx5669tx6236tx6803qlqnatural f0fs24 cf0 }

There is obviously something wrong somewhere, and I suspect it is with the HTML. I have checked all the fields are named.

Thanks in advance


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Your page code is difficult to follow/read.

Can you change the Document setup>Output - HTML Code to More Readable (2nd down dropdown menu) and reupload so that it is easier to decipher.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

It would also help if we could see the content of the mail.php file

With the form already constructed you may well be better off using Tim’s PHP Feedback Form action FreewayActions.com | PHP feedback form rather than jumping through hoops trying to configure the mail.php file.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks David

I’ve changed the HTML code to more readable.

Here is the text in the mail.php file:

<? $to = 'email@hidden'; $subject = 'order'; $message = 'From: ' . $_REQUEST['name'] . "nn" . $_REQUEST['data']; $email = $_REQUEST['email']; $headers = 'From: ' . $email . "rn" . 'Reply-To: ' . $email . "rn" . 'X-Mailer: PHP/' . phpversion(); mail ($to, $subject, $message, $headers); header("Location: thanks.html"); ?>

And I have also applied Tim’s PHP action but I’m still getting the same results when submiting the form and the resultant email - any ideas greatly appreciated.

Thanks

Neil


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

In actual fact, I think I may have it sorted. It would appear that my ignorance has allowed me to upload an RTF file for the mail.php instead of a plain text file. It had a pile of descriptive stuff in it that may have been the cause of the problem. I’m still awaiting emails to confirm that it’s now working.

Thanks again


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Okay, scratch my last comment, it does work but only with the 2 fields that are in the mail.php file. I’ve been on the phone to my ISP for the best part of an hour trying to get the mail.php to send me the rest on the info on the form but I’m told that they can’t help me with that - I’ll have to get a developer to do it for me!

I could go on and on complaining about my ISP, but I won’t because I don’t know if that’s all I can expect from them or any ISP.

So, simple question, can anyone tell me where I can find out (in simple terms) how I add the additional fields on my form into my mail.php?

Thanks again


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

This line, right here:

$message = 'From: ' . $_REQUEST['name'] . "nn" . $_REQUEST['data']; 

is where you would add the other fields. Look in Freeway at each field, and make sure that each one has a clear name. (Names cannot have any spaces and should not have any punctuation in them.) Then follow the example here.

The dot (.) operator concatenates two bits of text together. The “nn” part makes a double linefeed, and each field should be called into your message body with $_REQUEST[‘theFieldName’].

If you just want to see a raw dump of all data sent through the form (including submit buttons and other detritus), you can use a loop to make your message variable:

$message = '';
foreach($_REQUEST as $key=>$value){
    $message .= $key . ': ' . $value . "nn";
}

That’s going to give you way more than you actually need, but it will show you everything that’s available.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walter

I’ve been trying lots of variations and, unless I’m mistaken, I thought I’d tried that one - do I need to repeat the $message… for each field or does that appear only at the beginning of a long list of fields?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Just to clarify, I know this doesn’t work:

<?$to = 'email@hidden'; $subject = 'Order'; $message = 'From: ' . $_REQUEST['name'] . "nn" . $_REQUEST['data']; 'Address 1: ' . $_REQUEST['address1'] . "nn" . $_REQUEST['data']; 'Address 2: ' . $_REQUEST['address2'] . "nn" . $_REQUEST['data']; $email = $_REQUEST['email']; $headers = 'From: ' . $email . "rn" . 'Reply-To: ' . $email . "rn" . 'X-Mailer: PHP/' . phpversion(); mail ($to, $subject, $message, $headers); header("Location: thanks.html"); ?>

freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

$message needs to be all one long string of text. When you add the semicolon, you end the statement in PHP. So if you wanted to pick up the assignment where you left off on a new line, you would need to continue like this:

$message .= 'some more data here';

The dot-equals construction is shorthand for:

$message = $message . 'some more data here';

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Neil said:

And I have also applied Tim’s PHP action

One or other but not both!

Why not create a new blank page

Copy and paste the form onto it - no other actions etc.

Apply the PHP FF action to the page and then configure it in the action inspector.

Upload and try it.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options