Jump to content

sending post variables with a link or button


MrAdam

Recommended Posts

I don't think I've ever ready anything about this before, but I was wondering, is it possible to send post variables to a webpage, without using a form?So like you could click a link (I assume javascript would take over) load the page and send post variables for you to retreive on that page...hope im making sense.. anyone have any ideas?- cheers !

Link to comment
Share on other sites

The only way browsers can perform a POST is from a form. Try using session variables if you want to pass information from page to page without any chance of the user changing it.

Link to comment
Share on other sites

The only way browsers can perform a POST is from a form. Try using session variables if you want to pass information from page to page without any chance of the user changing it.
That's not completely true. Apparentely you never heard of AJAX!?AJAX Can be used to send (as GET or POST) and recive data without reloading the pageTake a look what you can find using google: http://www.google.se/search?q=AJAX+POST&am...lient=firefox-a
Link to comment
Share on other sites

May I ask why don't you want to use a form??You are still able to submit the form without using a submitbutton (using JavaScript) or visible fields...

Link to comment
Share on other sites

Guest madhu

Hi,I will give u answer for ur question. sending post variables with a link or button u can get the answer by using anchor tag . I will give u one example. category and subcategory two things are there. at present we are in category.php you want to go to the subcategory and also post variables from category to subcategory.By Using this Link<a href="subcategory.php?key=education">education</a>by using button<input type='submit' onclick="subcategory.php?key=education" value='submit'>if u are getting the values from database then u will use this.<a href='subcategory.php?key=<? $row[category] ?>' > </a> and u can get values in subcategory.php$category=$_GET['key'];Hope u can solve ur problem.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...