For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > May 2007 > Re: [PHP-DB] $_POST["mypassword"]; ***Undefined index: mypassword









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] $_POST["mypassword"]; ***Undefined index: mypassword
bedul

2007-05-15, 7:58 am

it seem the poster already have the answer..
what he/she going to do was how to save username and pass on session.

thx for your help
----- Original Message -----
From: "Chris" <dmagick@gmail.com>
To: "bedul" <landavia81@gmail.com>
Cc: "Chetanji" <chetan_graham@amritatech.com>; <php-db@lists.php.net>
Sent: Tuesday, May 15, 2007 11:49 AM
Subject: Re: [PHP-DB] $_POST["mypassword"]; ***Undefined index: mypassword


> [ taking php-windows out again :P ]
>
> bedul wrote:
For example, you cannot create a connection to a database and store the
connection id as a session variable and expect the connection to still be
valid the next time the session is restored. PHP functions that return a
resource are identified by having a return type of resource in their
function definition. A list of functions that return resources are available
in the resource types appendix.[color=darkred]
shock.. me either.[color=darkred]
>
> You can't store database connections in a session.
>
> Ie you can't:
>
> $connection = mysql_connect(....);
>
> $_SESSION['DbConnection'] = $connection;
>
>
> because the HTTP protocol (and thus PHP) is stateless - you don't know
> where the next connection is coming from or even if there is another
> connection coming.
>
> If there is another HTTP request, you have no way of linking request '1'
> (where the database connection was set up) to request '47' in the chain.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com