Page 1 of 1

$_POST via href?

Posted: Mon Jun 11, 2007 10:16 am
by psurrena
Is it possible to not use a form button with $_POST but instead just a text link?

Posted: Mon Jun 11, 2007 10:26 am
by vigge89
Not possible in any easy wasy that I know of, unless using $_GET is an option;

Code: Select all

<a href="page.php?input=value+of+input">page.php</a>
page.php:

Code: Select all

<?php
echo $_GET['input']; // Outputs value of the URL-variable called 'input' (value+of+input in this case)
?>

Posted: Mon Jun 11, 2007 10:56 am
by superdezign
JavaScript can do it. Look into document.form.submit().

Posted: Mon Jun 11, 2007 11:31 am
by RobertGonzalez
EDIT | Answer removed because I was stupid and did not read the original post correctly.

Use Javascript.

Posted: Mon Jun 11, 2007 12:20 pm
by psurrena
errr...not what I wanted to hear :?

Time to buy a book I guess.