neo0506 Posted February 6, 2007 Share Posted February 6, 2007 Hi, I have inserted a form button onto my html page and would like to link that to a php page when clicked on. how would I go about doing that? Much appriciated, Thank You! Quote Link to comment Share on other sites More sharing options...
Psycho Posted February 6, 2007 Share Posted February 6, 2007 You put the action attribute in the form tag for the data in the form to be submitted to. You also want to use the method tag to specify wether the data is sent in the POST object or on the query string using GET <form action="processingpage.php" method="POST"> ---Form elements go here </form> Quote Link to comment Share on other sites More sharing options...
neo0506 Posted February 6, 2007 Author Share Posted February 6, 2007 This is what I have written for the action form. <form action="qmodpage.php" method="post"> <input type=submit value="Finished"> </form> but when I click the button, it doesn't go to he qmodpage.php. The page just blinks when I click on the button. please help! thank you! Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted February 7, 2007 Share Posted February 7, 2007 if you aren't sending any data collected in the form why are using a button when aimple a link is what is caled for? <form action="qmodpage.php" method="post"> // other inputs for data.... <input type="submit" name="submit" id="submit" value="Finished"> </form> if you just want a link that looks like a button (and don't care about js being enabled or not) then <input type="button" value="Finished" onclick="window.location='qmodpage.php';"> Quote Link to comment Share on other sites More sharing options...
trecool999 Posted February 10, 2007 Share Posted February 10, 2007 Here's where you went wrong: <form action="qmodpage.php" method="post"> <input type=submit value="Finished"> </form> <form action="qmodpage.php" method="post"> <input type="button" name="submit" value="Finished"> </form> Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted February 10, 2007 Share Posted February 10, 2007 trecool? What you posted won't do anything. You need a SUBMIT button to actually send the headers. In order to use a BUTTON you would nee some javascript just like what I said before... Quote Link to comment Share on other sites More sharing options...
trecool999 Posted February 10, 2007 Share Posted February 10, 2007 You have no Javascript in there... + it works for me :|. Here, try this: <form action="qmodpage.php" method="post"> <input type="submit" name="submit" value="Finished"> </form> Happy? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted February 11, 2007 Share Posted February 11, 2007 Err yes - it does look funny when post a comment saying 'here's where you went wrong' and then to prove your point that your propositions work you have to revert to the code you said was wrong.... But hey we all have bad days. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.