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!
//a regular ling with GET data;
<a href=blah.php?get=yes&post=no>link</a>
//i want to be able to submit the same data through a link but have it sent as post data, if thats possiable.
well i was using the get yes and post no data as an example, im writing a memory game and when a user clicks on the card i want the card to flip, thats not my problem, so i have images as links, and i could submit the needed data through get in the link, but then a player could change the value of the get and make it easy for them to win, maybe there is a easy way to make the image my submit button and ill just use a loop to generate all the forms....
dull1554 wrote:well i was using the get yes and post no data as an example, im writing a memory game and when a user clicks on the card i want the card to flip, thats not my problem, so i have images as links, and i could submit the needed data through get in the link, but then a player could change the value of the get and make it easy for them to win, maybe there is a easy way to make the image my submit button and ill just use a loop to generate all the forms....
I was also using yes and no as example. After the above description of what you really are after, I'd also go with TheBentinel.com's solution.
line: 0
error: Object doesen't support this property or method.
///////////////////////////////////////////////////////////////////////
code im useing
<form name=form1 action=$PHP_SELF method=post>
<input type=submit name=submit>
</form>
<a href="javascript:document.form1.submit();">Submit the form via post</a>
dull1554 wrote:i have decided to use TheBentinel.com's solution. but when i click on the link i get a error;
ARGH!! I've spent the past half an hour working on this because I KNEW this worked. I finally found out the problem, but only because some other poor soul had the same problem.
Change the submit button's name to submitBtn. Or Bob. Or ANYTHING but "submit". When you fire document.form1.submit(), it's trying to run something on the button.
I gave you that button name in my sample code, it's all my fault. Argh! Double-Argh!
the IMAGE type of input element is (mostly) functionally equivalent to a SUBMIT button. There are a few practical differences, but clicking will still do the primary goal: submitting the form.
You could also style your traditional submit buttons with hidden text and a background image.