Page 1 of 1

POST variables

Posted: Thu Nov 17, 2005 4:09 am
by milleusi
hi there...

how to transmit POST variables without sending them by adrees bar of the browser?

thx

Posted: Thu Nov 17, 2005 4:28 am
by twigletmac
POST variables aren't sent via the URL? Are you trying to not send variables in the query string, like http://www.mysite.com/index.php?var=value&var2=value.

Mac

Posted: Thu Nov 17, 2005 5:30 am
by milleusi
twigletmac wrote:POST variables aren't sent via the URL? Are you trying to not send variables in the query string, like http://www.mysite.com/index.php?var=value&var2=value.

Mac
yes, i wish to not sent variables in a query string....how to do this? is possible?

Posted: Thu Nov 17, 2005 5:34 am
by twigletmac
Depends on what you are trying to do but sessions may be an answer.

Mac

Posted: Thu Nov 17, 2005 5:53 am
by n00b Saibot
set your form to use POST instead of GET

Code: Select all

<form action="foo.php" method="POST">

Posted: Thu Nov 17, 2005 6:29 am
by milleusi
maqin idee is to not have the variables in adress bar of the browser. whitout session or frames it's possible?

Posted: Thu Nov 17, 2005 6:39 am
by twigletmac
Yes you can use POST - POST variables are not shown in the address bar only GET variables.

Mac

Posted: Sat Nov 19, 2005 1:49 pm
by illuminationed
$_GET returns values from the URL

$_POST send information via forms created in html docs

Posted: Sat Nov 19, 2005 1:56 pm
by illuminationed
oo soz just re-read your message:

<?php
session_start();
//READ DATA FROM A SESSION
$_SESSION['CHANGEME'] = $CHANGEME;

?>

<?php
session_start();
//ADD DATA TO A SESSION
$CHANGEME = $_SESSION['CHANGEME'];
?>

Hi! Just re-read your message and realised what you meant. In every document you must have "session_start();" where you want to read or add variables to a session but is only needed once!

This is exellent for making a members section on a website

If you have any more problems just send me a message

OR

Go to http://www.php.net and look up the session function