March 27, 2011
convert this link to POST mode
Question by homlyn
How can I convert this $_GET method to $_POST method?
$linkword .= "n<A HREF="$self?letters=$alpha[$c]$letters&n=$n">$alpha[$c]</A> ";
Answer by Starx
Instead of creating a anchor tag. Create a hidden form
$linkword .= "n<A HREF="$self?letters=$alpha[$c]$letters&n=$n">$alpha[$c]</A>";
Here is a Sample
<form name="hiddenform" method="POST" action="page.php">
<input type="hidden" name="letters" value="<? echo alpha[$c].$letters; ?>" />
<input type="hidden" name="n" value="<? echo $n; ?>" />
<a onclick="document.forms['hiddenform'].submit();">Test Link <? echo $alpha[$c]; ?></a>
</form>