PDA

View Full Version : Problem making form work?



Rob
03-20-2006, 07:20 PM
I've followed the instructions under form 1 of the forms tutorial. The form is set to:

contact.php
post

I then copied the script into notepad, changed email and subject lines and then published up as shown in the tutorial. The contact.php file shows up on the right hand side but when I go back and try to send a form I still get just an error page.

When I first built the form it was sending though outlook in a clumsy way but it did send all the details.

I'm sure I'm just being really stupid, but after 5 hours going round and round I'm pretty stuck.

Also tried using the zip file download to notepad and then uploaded but no different.

Any help would be really appreciated.

Thanks,

Rob

www.saulfarm.com (http://www.saulfarm.com)

p.s. problem form is on www.saulfarm.com/contact.html (http://www.saulfarm.com/contact.html)

navaldesign
03-20-2006, 07:55 PM
Two possible reasons it won't work:

1. your email field is called Email (Uppercase E) whilst the ready made script uses "email2

2. set encoding type in "multipart/form data"

If you want, upload the script - i'll tell you what is going wrong

Rob
03-20-2006, 08:20 PM
Hi the script i've uploaded is as follows:



<HTML>
<HEAD>
<TITLE>Succesfully processed your order</TITLE>
</HEAD>
<BODY>
<H2>Thanks for your order!</H2>

<?PHP
$email = $HTTP_POST_VARS[email];
$mailto = "rob@saulfarm.com";
$mailsubj = "Saul Farm enquiry form";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>
</BODY>
</HTML>



Have also just tried to add sitemap to the site. Followed instructions to the letter using ror and then uploaded to FTP, linked it from the homepage as in your tutorial but again when one clicks the link it goes straight to error page.

I guess I'm making the same mistake somewhere using FTP ?

I'm sue you'll know what I'm doing wrong.

many thanks for responding so quickly,

regards,

rob

www.saulfarm.com (http://www.saulfarm.com)

navaldesign
03-20-2006, 09:43 PM
Your problem is that your php page has been saved and the uploaded as contact.php.txt . That's because you have used notepad to edit the php script. You must repeat the procedure: copy and paste the code in notepad, then go in "Save as", choose file type "All files", save it as "contact.php" and then upload it on the server. To see that things are as i say, click on: www.saulfarm.com/contact.php.txt (http://www.saulfarm.com/contact.php.txt)

I don't know about your ror file. Maybe you have saved it not as ror.xlm but under another name, you should connect with BlueFTP and see how you have saved it.

Aliens Anonymous
03-20-2006, 09:54 PM
I've followed the instructions under form 1 of the forms tutorial. The form is set to:

contact.php
post

I then copied the script into notepad, changed email and subject lines and then published up as shown in the tutorial. The contact.php file shows up on the right hand side but when I go back and try to send a form I still get just an error page.

When I first built the form it was sending though outlook in a clumsy way but it did send all the details.

I'm sure I'm just being really stupid, but after 5 hours going round and round I'm pretty stuck.

Also tried using the zip file download to notepad and then uploaded but no different.

Any help would be really appreciated.

Thanks,

Rob

www.saulfarm.com (http://www.saulfarm.com)

p.s. problem form is on www.saulfarm.com/contact.html (http://www.saulfarm.com/contact.html)

Hi rob
as i make out you published the notepad that y6ou put the script on not sure that would work any way , i've done you a giude to go with the script , make sure you change the red text .
(don't show this to anyone they want to use it).

right on your contact page double click the form a box will appear,
In general 1 form name : what ever you want to call it
2 action: page name.php ( this must be the same as the page your on except you replace .html for .php )
3 method : post
4encoding type: this must be left blank so delete what is written there.
Now press ok
Now you need to make anther page of your design but this time when you save you must save use the same name as first but replace html with php so it would be page name.php after you have done this open a html box by clicking the html on the tool bar, double click box and enter this code The email address should be your web address.
-----------------------------------------------------------------------
<HEAD>
<TITLE>Succesfully processed your Report</TITLE>
</HEAD>
<BODY>
<H2>your thank you message here!</H2>

<?PHP
$email = $HTTP_POST_VARS[email];
$mailto = "your email address here";
$mailsubj = "write your message heading here";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>
</BODY>
</HTML>
-----------------------------------------------------------------------
Edit the red areas on the script please .
Test page and move box around untill you are happy .
Now press view on tool bar and press page properties in file extension make sure it say’s php. Press ok then save.
If you wish edit the php page at anytime, when opening new file in bluevoda click all files the contact.php file will right under the contact.html file.
All you have to do now is save and publish both pages.
If you have any problems or questions just get back.
Good luck, sorry navaldesign didn't see you there.

Rob
03-20-2006, 10:37 PM
Thank you both for your help.

I have removed the files I uploaded as contact.php.txt

I then thought I followed Aliens A's instuctions to the letter, but still haven't got it right.

I configured the form box. Copied the contact page and saved as contact.php. Opened an HTML box in this page and put in the script having made changes to email name, subject and thank you lines. Then saved. I first tried publishing using the tool bar but this didn't work so I published across using FTP manager and dragged to right hand side. This didn't work and error page there when I click submit on the form.

I'm obviously doing something (or being) very stupid. Thank you both for your kindness and patience.

regards,

rob

www.saulfarm.com (http://www.saulfarm.com)

Aliens Anonymous
03-20-2006, 10:46 PM
please give me the names of the pages the html which should be the one with your form on . And the php page which should be the won you put the script in.

Rob
03-20-2006, 10:51 PM
http://www.saulfarm.com/contact.html
http://www.saulfarm.com/contact.php

thanks,

rob

Aliens Anonymous
03-20-2006, 11:07 PM
hi did you delete old php file on right side of ftp manager>
also did you follow steps 1 to 4 in the post.
check all items then republish.
php page showing at all.

Rob
03-20-2006, 11:12 PM
I delated the old php file on right of file manager and did the 4 steps as in your post.

Should I have made a clone of the contact page, saved it as contact.php, opened the HTML box in it and pasted the code. (thats what I did. Or was this wrong ?

Thanks,

Rob

Aliens Anonymous
03-20-2006, 11:23 PM
yes in a way but when you have got your clone take of all the stuff you don't want on it ie; the form, pictures, texts etc what you need to remember that it is only a thank you page that sends the info to you.
take a quick look here at the bottom of the page press subit to see what i mean. http://www.aliensanonymous.org/ufo_report.html

Rob
03-20-2006, 11:56 PM
Hi, thanks for last post. Looked at your contact page. Your site is excellent.

Went back to my contact page and started over. Stripped out all the form, pics, text, etc, from the contact.php page. Got it just right with the message in centre of page in preview. Published up using FTP manager by dragging accross out of Blue Voda file into contact file on right hand side.

When press submit or type in http://www.saulfarm.com/contact.php to URL just the error page message again.

I just am missing something, but can't work out what.

Thanks again for your help.

Rob

Aliens Anonymous
03-21-2006, 12:08 AM
you did not drag file from left side to right side did you ? this will not work.
all files must be published ether by the publish button in bluevoda or by using ftp manager by clicking the file you want on the left then pressing the move to button at the top of the page. don't forget to delete that file on the right first.

Rob
03-21-2006, 12:45 AM
Just been through it all over again.

contact.php is on right hand side. Everything else checked but still just get error page when push the submit button.

Still same problem with sitemap on homepage. ror.xml file sitting on rhs, hyperlink over text looks good, but again just get error page when click.

Think am going slightly nuts

Aliens Anonymous
03-21-2006, 01:03 AM
did you publish the contact.php from bluevoda, if so check that in your html page
action: page name.php ( this must be the same as the page your on except you replace .html for .php )
method : post
encoding type: this must be left blank so delete what is written there.
this page must then saved and publishised.
it mess's with your brain all this i know but sometimes it's better go away do something else for a couple of hours then come back refreshed.
you will see the Problem staring you in the face.
i have to get some shut eye now good luck all the info you need is there you just need to see what your doing wrong. just remember you must publish those pages . good night you will do it i have faith.

Rob
03-21-2006, 01:17 AM
Thanks Alien,

Shall have one more go then leave it till tomorrow if it dont work.

Thanks for all your help.

Rob

Rob
03-21-2006, 03:00 AM
Stuck with it and now its working.

What I did different was I went into page properties on the new contact.php page abd deleted all the descriptions and meta tags. I then set the file extention box in page properties to php. Then I published back up and it worked.

Don't know if it was the above in the end or my computer was just feeling kind !!.

Many thanks alien and navaldesign. Couldn't have done it with out you.

Rob

www.saulfarm.com (http://www.saulfarm.com)

navaldesign
03-21-2006, 05:17 AM
Sorry i haven't been around. FYI, the page had to be saved as php. Since you mixed html (for the visual part) and php (for data processing), the BV page had to be published after setting the extension to .php, as you finally did. You could also avoid the "moving around" of the box: the thankyou message could be part of the bv page, and the code should only be limited to the <?PHP ..... ?> part. It works both ways, but if you did so, you could also rchange, esize, or change colour to the text message, as well as place excactly where you want, underline it, do whatever you want, because it not any more part of the script.

Aliens Anonymous
03-21-2006, 07:24 AM
Great well done