Current location: Hot Scripts Forums » Programming Languages » PHP » can PHP submit a form without user clicking button?


can PHP submit a form without user clicking button?

Closed Thread
  #1 (permalink)  
Old 02-21-05, 11:07 PM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
can PHP submit a form without user clicking button?

can PHP submit a form without user clicking button?

i want a form to be submitted automatically to avoid one extra click. is this possible?


thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
  #2 (permalink)  
Old 02-21-05, 11:41 PM
phprogramming phprogramming is offline
Wannabe Coder
 
Join Date: Nov 2004
Posts: 214
Thanks: 0
Thanked 0 Times in 0 Posts
lol how would u do that even if it was possible? i mean, it would automatically submit form without you typing in it, it could be done with javascript MAYBE, im not good with javascript so im not sure, but it seems very pointless
__________________
Source Code Talk - Programming Discussion, Tutorials, and More!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
  #3 (permalink)  
Old 02-22-05, 12:13 AM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
well it would be pre filled by PHP of course. the reason i want to do this is i want one form to be submitted first (user interaction) and the another form, sent to another target, submitted again. i want to avoid having the user click two times.

note, the second form should not be visible. there's not going to be a form displayed and an invisible pointer clicking a button.





maybe, i'm explaining my needs poorly, i basically want one (1) user interaction (a click) to submit two (2) forms.

is this possible in PHP?


thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
  #4 (permalink)  
Old 02-22-05, 12:21 AM
phprogramming phprogramming is offline
Wannabe Coder
 
Join Date: Nov 2004
Posts: 214
Thanks: 0
Thanked 0 Times in 0 Posts
then after the first form is submitted use header("Location: whatever.php")
__________________
Source Code Talk - Programming Discussion, Tutorials, and More!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
  #5 (permalink)  
Old 02-22-05, 12:24 AM
nassau nassau is offline
Wannabe Coder
 
Join Date: May 2004
Posts: 211
Thanks: 0
Thanked 0 Times in 0 Posts
yes, but how can i post stuff to that url? the url is this:
"https://www.paypal.com/cgi-bin/webscr"

i was thinking of putting all the stuff in the url but i'd rather not since it paypal and money and stuff...

any suggestions?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
  #6 (permalink)  
Old 02-22-05, 12:50 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
you know what info the hidden form should have right?.. so you submit the first form first then do what ever on the second page with php and fill the form.. something like
PHP Code:

 ?>
     <html><body>
     <form action="what_ever.ext" method="post" name="MyForm">
       <input type="hidden" name="hiddenfield1" value="<? echo $some_important_value?>">
     </form>
     
     <script language="javascript" type="text/javascript">
    document.MyForm.submit();
     </script>
     <noscript><input type="submit" value="verify submit"></noscript>
     </body></html>
this way the form will be autosubmitted (should be).. just make sure you do all wanted operations with php becourse thats the only thing (among other server scripts) that has the time to operate

Last edited by <?Wille?>; 02-22-05 at 12:55 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
  #7 (permalink)  
Old 02-22-05, 08:35 AM
moronovich moronovich is offline
Junior Code Guru
 
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by phprogramming
lol how would u do that even if it was possible? i mean, it would automatically submit form without you typing in it, it could be done with javascript MAYBE, im not good with javascript so im not sure, but it seems very pointless
please do not answer if you don't know the right solution. otherwise, you are heading people to the wrong direction. curl, a php extension, can handle stuff related to rfc 1867. if you don't know what it is, look it up in your php manual.
__________________
just an ignorant noob with moronic solution...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
  #8 (permalink)  
Old 02-22-05, 09:18 AM
phprogramming phprogramming is offline
Wannabe Coder
 
Join Date: Nov 2004
Posts: 214
Thanks: 0
Thanked 0 Times in 0 Posts
you should research a bit more on paypals IPN,
__________________
Source Code Talk - Programming Discussion, Tutorials, and More!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
  #9 (permalink)  
Old 02-21-08, 10:31 AM
nezraal nezraal is offline
New Member
 
Join Date: Feb 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
why don't you start by learning yourself first; he is right - don't talk if you don't know

Quote:
Originally Posted by phprogramming View Post
you should research a bit more on paypals IPN,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
  #10 (permalink)  
Old 02-21-08, 10:55 AM
TenFormer's Avatar
TenFormer TenFormer is offline
Newbie Coder
 
Join Date: Jan 2007
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
I am not sure what he means, but If I get it the right way you simply want to submit variables hidden to another page. Like you said, in the URL would be one method and later on get it with $_GET[].

But of course there are other ways. If I am right, did you consider Sessions and Cookies?

Now I am saying again, if I understood you right, I would simply set a session variable, then use it on the page you want to use it, and after your actions unset() it.

You can define Session variables like this:
PHP Code:

session_start();

$_SESSION['foo'] = "bar";
....
unset(
$_SESSION['foo']); 
Now I am pretty much of a beginner as well, but perhaps this helps others understand what you need.


EDIT: Nevermind, this is not what you need.

Last edited by TenFormer; 02-21-08 at 10:57 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Closed Thread

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Form - Button that executes - Need Help Proton PHP 1 02-05-05 11:27 PM
How to submit a form using a link, not a submit button? Myke311 HTML/XHTML/XML 3 01-12-05 02:26 AM
submit form with more than one href submit and no submit button adlinfanus JavaScript 1 03-09-04 07:45 AM
Need Epinions-lite system in PHP & MYSQL wali001 Job Offers & Assistance 4 01-12-04 07:02 AM
process form without press submit button azwani JavaScript 1 11-03-03 02:10 AM


All times are GMT -5. The time now is 01:44 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.