|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Back with a vengeance - The sequel to "Told you I would be back"
Well I have spent days trying to resolve this one. I have given up on trying to get the mysql to work, it really isn't important just now.
I bought a couple of php books and read loads of forum (is it forum for plural or perhaps fori but surely not forums!? Fora??). Anyway, I have got to the point where the form will email me with some data but much of it is missing. So I reintroduced the validation checks and this is what is missing: "Sorry, but the form cannot be sent until the fields indicated are filled out completely - Please, go back and fill out your first name Please, go back and fill out your house number and street name Please, go back and fill out your city Please, go back and fill out your state Please, go back and fill out your country of reidence Please, go back and fill out your daytime telephone number Please, go back and fill out your evening telephone number Please, go back and fill out the section asking you for one thing to focus on Please use your "Back" button to return to the form to correct the omissions. Thank you" Now you can guess that I have put entries into those fields so ....help! Here's the php code: PHP Code:
$firstname= PHP Code:
$PreferredName= PHP Code:
$surname= PHP Code:
$Email= PHP Code:
$street= PHP Code:
$ApartmentNo= PHP Code:
$city= PHP Code:
$state= PHP Code:
$ZipCode= PHP Code:
$country= PHP Code:
$daytimetel= PHP Code:
$cancallday= PHP Code:
$eveningtel= PHP Code:
$cancallevenin= PHP Code:
$OneThing= PHP Code:
PHP Code:
Would it help any if I posted the HTML page? I have had to put a temporary page in whilst this is fixed which is kinda frustrating. Thanks all. Moggi1964 |
|
#2
|
|||
|
|||
|
A couple of things come to mind. One rename some of your variables, e.g.
PHP Code:
When setting your variables, you may want to usee the '?' operator like so: PHP Code:
On a more of an aesthetics note you may wish to include a <br /> tag after each error, this will split the messages up nicer and improve readability. e.g. PHP Code:
You may even want to change it so it reads something like: "Sorry, but the form cannot be sent until the fields indicated are filled out completely: first name is required house number is required street name is required city is required state is required country of reidence is required daytime telephone number is required evening telephone number is required one thing to focus on is required Please use your "Back" button to return to the form to correct the omissions. Thank you" Just a thought, try out some of these suggestion and let us know how you get on. p.s. please remember to wrap all php code in the php tags, click on the php button, to the right to the big # sign when posting!
__________________
http://www.phptutorials.cjb.net. go on, give it a click! |
|
#3
|
|||
|
|||
|
I didn't realise the button next to the #existed and I tried to wrap the text but it didn't work!!
Thanks for your response. I will try it out and see what happens. The advice you give on tidying up is appreciated too. Moggi1964 |
|
#4
|
|||
|
|||
|
Still getting a problem at line 79...Parse error?????
Not quite there it would seem!!
Tried seeing what might be causing the line 79 problem ut nothing obvious. I'm sure you'll see it! Moggi /* grabs the POST variables and puts them into variables that we can use */ PHP Code:
|
|
#5
|
|||
|
|||
|
Quote:
You will note that the php button puts in the php tags ( [ PHP ] and [ /PHP ] ). You can also type this by hand, try editing your above post and put the [ PHP ] (no spaces) at the beginning of your code and [ /PHP ] at the end of the code block, not each line! It will look a lot better on scr |