View Full Version : PHP help... again

06-08-2006, 07:32 PM
Hi, I know I seem to ask a lot of questions about php but im sorry, im trying to learn as I go along so anyway...

When you have a form to submit, u have <form method="post" action="wotever"> and the action would maybe be a php script to email the contents of the form or something like that. Well I am wondering if it is possible to recreate the 'action="wotever"> in a php script. in other words, can I make a form to email the contents to me, and then pass the info to an external page. So can you have action="script.php", then script.php emails the form contents to me, and then does another action="external action">. So like having two 'actions'?

Sorry about the poor explanation, its difficult to explain what i meen, but if anyone understands, help would be great!


06-08-2006, 09:11 PM
why not get script.php to contain or trigger the other action?

if it is a page call using header() or echoing a meta refresh would also work if its a redirect.

06-08-2006, 09:49 PM
Why not incorporate both actions into one script? In the one script you can use the mail() function to email details to you, then do something else with the form data.

I do have a script that will allow you to emulate a form being submitted so that on your first script, you can do mail(), then on the second you can do the other thing. However I think it'd just be easier to incorporate both actions into the same script.

If you'd like the form emulation script, drop me an email to phil [at] netinspired.co.uk

07-08-2006, 03:17 PM
Thanks for your replies, it turns out I was overcomplicating things. Yeh the best way would be to put both actions in the same script, but it was less complicated than I thought.

Thanks again