I need help please-- page redirect
Moderator: General Moderators
I need help please-- page redirect
hello I'm new in programming, i hope someone could help me here. i have 4 links and all of them have to be open on popup page (mail form with name, email and telephone and captcha).. i already have this.. the problem is each link has to be redirected on different pages after the form has been submitted.. how can I do this... thanks a lot.. i hope someone could help asap..
Last edited by prue_ on Thu May 07, 2009 10:47 pm, edited 1 time in total.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: I need help please-- page redirect
The header function can be used to do page redirections in php, but I'm not sure i 100% understand what you needed done, so this might not be what you want.
Code would be great
Code would be great
Re: I need help please-- page redirect
code deleted
Last edited by prue_ on Thu Jun 18, 2009 7:02 am, edited 3 times in total.
Re: I need help please-- page redirect
are you guys still there? i don't know how to search my answers on google...
Re: I need help please-- page redirect
Oh, so the form is on multiple different pages (and you would like it to redirect back to the page it came from)?
I guess you could use a html hidden field that stored the current page before you submit the form, store the previous page in a session, or store the information in the url when you post to that page (form.php?returnpage=url), then use the header function i posted earlier to return to that page.
I guess you could use a html hidden field that stored the current page before you submit the form, store the previous page in a session, or store the information in the url when you post to that page (form.php?returnpage=url), then use the header function i posted earlier to return to that page.
Re: I need help please-- page redirect
all links goes on the same pupop page.. (link1, link2, link3 and link4).. for example.. if the user clicks on link1 (a pupop page will open) then the user will submit the form then the page will redirect to link1.php.. if the user clicks on link2 (a pupop page will open) then the user will submit the form then the page will redirect to link2.php.. and so on.. im already aware of the header function.. just dont know how implement it in this case...
Re: I need help please-- page redirect
@prue_, use code tags when posting code. Please ask if you are unsure how.
Re: I need help please-- page redirect
oh im so sorry, i didn't know it was supposed to be like that.. next time i will. thank you though
Re: I need help please-- page redirect
Much nicer with the code tags added 
I'm guessing that could be solved using javascript. When the user clicks on a link, use javascript to append a "referrer" tag at the end of the form action, like
action="scripts/sendmail.php?referrer=link1".
I don't use javascript, so i can't write a function for it (and so what i say from here might not be right), but you would have an onClick or some function on the hyperlink, and the function it calls adds "?referrer=$something" to end of the form action, with $something equal to the value of the link (link1/link2/etc).
Then in the actual form processing script, you'll just retrieve that using $_GET and header redirect it to that page (make sure you limit what it can direct to, for possible security reasons).
I'm guessing that could be solved using javascript. When the user clicks on a link, use javascript to append a "referrer" tag at the end of the form action, like
action="scripts/sendmail.php?referrer=link1".
I don't use javascript, so i can't write a function for it (and so what i say from here might not be right), but you would have an onClick or some function on the hyperlink, and the function it calls adds "?referrer=$something" to end of the form action, with $something equal to the value of the link (link1/link2/etc).
Then in the actual form processing script, you'll just retrieve that using $_GET and header redirect it to that page (make sure you limit what it can direct to, for possible security reasons).
Re: I need help please-- Curl
code deleted
Last edited by prue_ on Thu Jun 18, 2009 7:02 am, edited 1 time in total.
Re: I need help please-- page redirect
In $formfields you're missing a few ,'s at the end of some lines for the array declaration.
Re: I need help please-- page redirect
still doesn't work.. any ideas? thanks