Page 1 of 1

php form problem

Posted: Sat Jul 08, 2006 8:19 am
by watty_001
Firstly i'm pretty new to php so please excuse any glaring ommissions. I've had a look through the old posts and can't seem to find what I'm looking for.

I have a form submited in html to a php page for validation.

If there is an error I want to fill in values into a form via hidden fields on this php page and automatically submit it to an error page with the values from the hidden field.

I know this can be done using javascript:

<SCRIPT LANGUAGE="JavaScript">
document.myFormName.submit();
</SCRIPT>

However, I am also aware that not every browser will run javascript, and I was wondering if there is a simple way I can automatically submit this form using more robust php?


Sorry if this has been covered before, i cant seem to find it anywhere.


I'm grateful for any help or direction.


Cheers

Posted: Sat Jul 08, 2006 8:58 am
by dull1554
easy answer. NO.

php is a server side scripting language. and code you have executes on the server and not on the users computer.

Posted: Sat Jul 08, 2006 9:21 am
by watty_001
thanks wasn't sure if I would be able to.

Posted: Sat Jul 08, 2006 9:26 am
by feyd
Is this error page on your server? Is it PHP? If yes to both, you can pass the data via session information or worst case, the URL and some redirection.

Posted: Sat Jul 08, 2006 9:42 am
by dull1554
but you still cant submit the form via php

Posted: Sat Jul 08, 2006 9:48 am
by feyd
dull1554 wrote:but you still cant submit the form via php
yes, you can.

there are functions and classes that can submit forms through php: Read up on cURL and Snoopy.

Posted: Sat Jul 08, 2006 11:08 am
by dull1554
heh. never herd of snoopy and i didnt realize that functionality was available with cURL.
alas.
we all learn something today.

Posted: Sat Jul 08, 2006 11:15 am
by watty_001
The error page is on my server so I will read up on cURL and Snoopy and see how I get on.


Thanks for your help