Jump to content

<a href onclick --> php?


marmite

Recommended Posts

Is there any way to change a $_POST variable when someone clicks on a link?

 

(Situation is: I have three buttons, saying, e.g. "view all blank cards". When the user clicks a button, I want to take them to greetingscards.php, with the $_POST variable ['message' set to Blank - the POST variable is used in the SQL used to retrieve the cards.)

 

<a href="/greetingscards.php" onclick=<? $_POST['message']='blank' ?>><img src="images/bulk_blank_a.gif" alt="Cards Un Limited" width="163" height="26" border="0" /></a>

 

I'm not getting anywhere and beginning to wonder whether this is possible.. any ideas gratefully received! :)

Link to comment
https://forums.phpfreaks.com/topic/48285-php/
Share on other sites

um.. I think you could do it with just one, because if only one input or whatever you use is entered, then the others will return blank, and not effct it. Althought you might find that they will collide with each other.. give it a try

 

 

EDIT: Or if it's not too important, you could use $_GET method. it would mean that users could input there own values, buit sometimes that doesn't matter. I use get a lot on my site for things as users can then bookmark pages with the settings as they wish etc

Link to comment
https://forums.phpfreaks.com/topic/48285-php/#findComment-236050
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.