![]() |
else problem
Anyone detect the problem here?
PHP Code:
|
I am not sure now, what could be. can you tell us what type of error do you get?
also restructuring a little the code: PHP Code:
|
yeah, you should TEST the conditions, and not make assignments. therefore...
PHP Code:
PHP Code:
|
I changed to || instead of OR. I also added the IF inside the {} and it fixed it.
I changed the code to PHP Code:
|
It would be better to do the last part this way:
PHP Code:
PHP Code:
|
the top part of my code is just assigning variables to my form.
I tried out the first code you gave me PHP Code:
The 2nd code you put is what tony suggested. which i tried and it sent me to thanks.php whether null or not. |
I know. The mail() function will actually return true (or attempt to send the mail, if I understood it correctly) even if the parameters submitted are 0 or not valid at all.
I would personally use empty() instead of is_null(), since is_null() will return false even if the variable is '' or 0. PHP Code:
PHP Code:
|
nope its not working !empty will still send it out :(
|
Quote:
|
PHP Code:
|
Try this code. Either was my explanation poor, or you misunderstood what I meant about using !empty(). Anyway, try this code and let me know what you get:
PHP Code:
|
I guess I was confused with the whole if {} thing. Yes it works now :) thanks
|
I am glad I could help! :)
|
@9three
From this thread i never grasped if you understood the difference between: Assigning: PHP Code:
PHP Code:
In the last you check to see if the $myVar has the same value as the string. Itīs an easy misstake, i do it often myself. Anyways :) good luck. |
yea i have = and == covered :D
|
| All times are GMT. The time now is 09:28 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0