
10-20-05, 06:27 AM
|
|
Code Guru
|
|
Join Date: Oct 2005
Location: holland!
Posts: 704
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
PHP form problem
Hi there,
I'm kind of new here. Also I'm kind of new to PHP. I'm still learning.
I got a problem with a form I'm using.
If I filled it in and press the submit button it goed to a php page and stays there instead of going to the Thanx page.
I attached my html and php file.
Please help me out.
Greetz,
j
|

10-20-05, 05:35 PM
|
|
Newbie Coder
|
|
Join Date: Dec 2004
Location: Tacoma, WA
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
With out digging to deep into the script, the fact that it is going to the thnx.html page is a good thing. It probably did everything it was supposed to. On the bottom of the file is:
If the script can not send the mail, echo "error...", else header("Location: ...");. The header() function is an internal PHP function. This funcation is mainly, from what i have seen, used for browser redirection.
|

10-20-05, 08:36 PM
|
 |
Wannabe Coder
|
|
Join Date: Sep 2005
Location: Oxford, UK
Posts: 239
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
|
Originally Posted by xtremenw
With out digging to deep into the script, the fact that it is going to the thnx.html page is a good thing. It probably did everything it was supposed to. On the bottom of the file is:
If the script can not send the mail, echo "error...", else header("Location: ...");. The header() function is an internal PHP function. This funcation is mainly, from what i have seen, used for browser redirection.
|
The page isn't getting redirected to the thank you page, and I think its because of the code you've highlighted. Try removing the ! from the IF statement, then if the e-mailing is successful it will redirect to the $redirectURL (I'm assuming this is the thank you page).
Also, you're correct about the header() function, it is mainly used for brower redirection, although its basically able to send any raw HTTP header parameters, as pointed out here; PHP.net - header(). 
|

10-20-05, 09:40 PM
|
 |
Community Liaison
|
|
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
|
|
Quote:
|
Originally Posted by Richard
The page isn't getting redirected to the thank you page, and I think its because of the code you've highlighted. Try removing the ! from the IF statement, then if the e-mailing is successful it will redirect to the $redirectURL
|
Huh?
As it is written, if it fails it displays an error, else it spits out the thank you page.
If you remove the !, it will display an error when the mail() is successful, and the thank you page if it fails.
|

10-20-05, 09:48 PM
|
|
Wannabe Coder
|
|
Join Date: Jun 2005
Posts: 179
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
Firstly, where are you learning php from? You are using old methods... such as: can now be replaced with also, try what richard said, swap the condition around AND also put a die(); after the header redirect cause the script still will run through after the header instruction: If it still isn't working, put a little debug test after the conditions closing brace like
to see if the script is making it that far
__________________
Jordie Bodlay
php, mysql, postgres
css, xhtml
graphics, design
email me: jb2386@hotmail.com for any programming needs.
|

10-21-05, 04:40 AM
|
 |
Wannabe Coder
|
|
Join Date: Sep 2005
Location: Oxford, UK
Posts: 239
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
|
Originally Posted by Keith
Huh?
As it is written, if it fails it displays an error, else it spits out the thank you page.
If you remove the !, it will display an error when the mail() is successful, and the thank you page if it fails.
|
lol, completely ignore my post, I don't know what I was thinking to be honest. Maybe I shouldn't post so late, lol 
|

10-21-05, 04:51 AM
|
|
Code Guru
|
|
Join Date: Oct 2005
Location: holland!
Posts: 704
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
PHP form problems
I tried all of the given solutions, either none of them worked with me
- I removed the !
- changed the code fore what was given
but it didn't worked out :s
is there another solution??....
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|