PDA

View Full Version : how to send a var type POST via a link ?



OKtrust
November 24th, 2004, 01:36 PM
hi all,
I wonder how to send a variable type POST by click a link ?
we should use session variable ?
thanks

MOre
November 24th, 2004, 01:40 PM
you mean: www.blabla.com/index.php?ref=contact&id=500 ????

if thats what you mean its simple: www.blabla.com/index.php?ref=contact&id=<?$userid?>

norie
November 24th, 2004, 02:07 PM
you mean: www.blabla.com/index.php?ref=contact&id=500 ????

if thats what you mean its simple: www.blabla.com/index.php?ref=contact&id=<?$userid?>

That is the GET method. To send information using the POST method you'd have to submit a forum


<form action="mypage.php" method="POST" id="form1">
<input type="hidden" name="myvar" value="myvalue" />
</form>
<a href="form1.submit()">send var</a>

OKtrust
November 25th, 2004, 01:35 PM
oh sorry, it doesnt work well
I think it's must be a java script this line:

<a href="form1.submit()">send var</a>

Voetsjoeba
November 25th, 2004, 03:32 PM
Yeah. As far as I know, you can only send POST data through a form, so you'll indeed have to use javascript to execute the form to send the data if you want to use a regular link.



<a href="javascript:document.form1.submit();">Post form</a>

That should do i' I think.