|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
i have a php file name main.php
i want to do a post and not a get since this action is to delete a row in the database. however, when i try to do a href onclick, the values are not passed to the main.php. why ? echo "You have " .$votesattach. " votes for this quote. Delete the Quote and Votes ?"; echo "<form name=send1 method=post action=main.php?action='deleteit'>"; echo "<input type=hidden name=action value=deleteit>"; echo "<input type=hidden name=which value=$delete>"; echo "<input type=hidden name=userno value=$userno></form>"; echo "<a href=main.php onclick=document.send1.submit()>YES</a>"; } how do i do pass values to the server using a post method ? |
|
#2
|
|||
|
|||
|
============begin quote===============
echo "You have " .$votesattach. " votes for this quote. Delete the Quote and Votes ?"; echo "<form name=send1 method=post action=main.php?action='deleteit'>"; echo "<input type=hidden name=action value=deleteit>"; echo "<input type=hidden name=which value=$delete>"; echo "<input type=hidden name=userno value=$userno></form>"; echo "<a href=main.php onclick=document.send1.submit()>YES</a>"; ================end quote=============== You're trying to use get and post both. Look at the 'action' url in your form tag. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > values in form not passed using onclick ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|