a form Post to many page

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
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

a form Post to many page

Post by valen53 »

hi everybody,
i have a webpage contain few button there. one of the button click for post to self page to add data to the table. another button is submit to database then jump next page. But a page only contain a form, how i post to self page and also another page ??
Beside using if (), another method to be done?
Thank you
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

HTML in itself can't handle such, I don't know if javascript can...

one way would be to post to a script here you use curl to post to other pages/sites..
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Post by daven »

This should do it. Cheers

Code: Select all

<script language="javascript">
function SubmitThis(ButtonName)&#123;
  switch(ButtonName)&#123;
    case 'A':
      document.myform.action="pageA.php"
      document.myform.submit;
      break;
    case 'B':
      document.myform.action="pageB.php"
      document.myform.submit;
      break;
  &#125;
&#125;
</script>

<form name="myform" action="">
<input type="button" name="A" value="Submit To Page A" onclick="SubmitThis(this.name)">
<input type="button" name="B" value="Submit To Page B" onclick="SubmitThis(this.name)">
</form>
Post Reply