![]() |
|
#1
|
|||
|
|||
PHP on button click??Is it possoble to have a php script executed when pressing a form button
(eg. <input type="button" value="Send" onClick=this is where i want the php where JScript would normally go>) Or does the server only execute php on page load? |
|
#2
|
|||
|
|||
|
You can use a variation of this:
<input class='buttons' id='page' onclick="another_page.php" type='button' value='Another Page' name='another page' /> |
|
#3
|
|||
|
|||
|
Quote:
So how exactly do you get this to work? When I try putting Code:
The button shows up, but does not take you to "./modules.php?name=automaint&page=editdata" |
|
#4
|
|||
|
|||
|
Quote:
Can you not get the php script to run by putting the reference to the page in the action part of the form tag? Like: <form name=myform, method=post, action=phpscript.php> Then you just use the submit button without the onClick part - when it is clicked the php script on phpscrip.php page will run. I think this would work? |
|
#5
|
|||
|
|||
|
The button would have to link to a new page in order for the PHP to take effect. PHP is a server-side scripting language, meaning that all PHP code is processed during page load (and subsequently converted to client-side code--usually HTML, but also some DHTML). Only if you load up a new page can the server process new PHP code.
Please correct me if I misunderstood your original request. Conker __________________
You're not supposed to be looking at this. |
|
#6
|
|||
|
|||
|
Nope, you were bang on. I figured out how to do it anyways with a submit button and querystrings instead.
|
|
#7
|
||||
|
||||
|
Use a javascript redirect to run the PHP code you want, for your 'onclick' event.
HTML Code:
|
|
#8
|
|||
|
|||
|
Oooo, pretty nifty. Thanks.
|
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| uisng php to display php | dopee | MySQL / PHP Forum | 6 | 14-May-2004 18:40 |
| php software | dopee | MySQL / PHP Forum | 0 | 04-May-2004 11:26 |
| Automate a data change php form | mjfmn | MySQL / PHP Forum | 4 | 20-Oct-2003 09:37 |
| All the big PHP script collections that matter | jrobbio | MySQL / PHP Forum | 5 | 06-Jun-2003 16:14 |
| Sydog's DVD to Divx Conversion Guide | asanthadenz | Computer Software Forum - Windows | 1 | 14-Mar-2003 14:08 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The