PDA

View Full Version : submitting variables Using Post Method


locust
12-06-2002, 05:31 PM
Sorry but this is a pretty simple
How do i post the form so i can access the variables
in the next form using the post method
without using submit button eg
maybe by using the href tags
thanks 4 ur help

raptori
12-06-2002, 10:22 PM
like this:
echo "<a herf=page.php?variable=$value&variable2=$value2>the link</a>

echo "<a herf=page.php?variable=12&variable2=abc>the link</a>

boywonder
12-06-2002, 11:46 PM
that would use get method...

For post method form:
<a href="" onclick="document.formname.submit(); return false;">the link</a>

locust
12-09-2002, 07:37 PM
Originally posted by boywonder
that would use get method...

For post method form:
<a href="" onclick="document.formname.submit(); return false;">the link</a>

Shot that worked perfectly thanks again

sick-headache
03-02-2005, 11:23 AM
Hi i have the same problem as abow, but i cant make the link work. Here is the code i have written:

<h1 class="toptext">Studentteateret<em>Immaturus</em></h1>
<div class="meny">
<p>

<form action="index.php" method="post">
<a href="index.php?side=prod/produksjoner&meny=prod/menyprod">Produksjoner</a> &nbsp
<a href="index.php?side=prod/gruppene&meny=grupper/menygruppe">Gruppene</a> &nbsp
<a href="index.php?side=div/program">Agenda</a> &nbsp
<a href="index.php?side=div/kontaktoss">Kontakt oss</a> &nbsp
<a href="index.php?side=div/startside">Startsiden</a> &nbsp
<br />

<?php
if (! isset($_GET["meny"])) {
echo("");
}
else {
include("{$_GET["meny"]}.htm");
}
?>
</form>
</p>
</div>

the last php script is just for adding a new sub menu to the whole menu. What do i have to do to not make the variables show in the address bar, when i click the link. Tryed the suggsestin but it didnt work.

delinear
03-02-2005, 11:58 AM
You could have index.php grab the variables using $_GET and store them as $_SESSION variables then reload itself using a header redirect. That should give you access to the variables in a session without them appearing in the url.