POST variables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
milleusi
Forum Commoner
Posts: 30
Joined: Mon Jun 13, 2005 3:18 am

POST variables

Post by milleusi »

hi there...

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

thx
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
milleusi
Forum Commoner
Posts: 30
Joined: Mon Jun 13, 2005 3:18 am

Post 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?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Depends on what you are trying to do but sessions may be an answer.

Mac
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

set your form to use POST instead of GET

Code: Select all

<form action="foo.php" method="POST">
milleusi
Forum Commoner
Posts: 30
Joined: Mon Jun 13, 2005 3:18 am

Post by milleusi »

maqin idee is to not have the variables in adress bar of the browser. whitout session or frames it's possible?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Yes you can use POST - POST variables are not shown in the address bar only GET variables.

Mac
illuminationed
Forum Newbie
Posts: 8
Joined: Fri Nov 18, 2005 10:13 am

Post by illuminationed »

$_GET returns values from the URL

$_POST send information via forms created in html docs
illuminationed
Forum Newbie
Posts: 8
Joined: Fri Nov 18, 2005 10:13 am

Post 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
Post Reply