php form problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
watty_001
Forum Newbie
Posts: 3
Joined: Sat Jul 08, 2006 8:12 am

php form problem

Post 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
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post 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.
watty_001
Forum Newbie
Posts: 3
Joined: Sat Jul 08, 2006 8:12 am

Post by watty_001 »

thanks wasn't sure if I would be able to.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

but you still cant submit the form via php
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

heh. never herd of snoopy and i didnt realize that functionality was available with cURL.
alas.
we all learn something today.
watty_001
Forum Newbie
Posts: 3
Joined: Sat Jul 08, 2006 8:12 am

Post 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
Post Reply