Re: $_POST["mypassword"]; ***Undefined index: mypassword

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[ taking php-windows out again :P ]

bedul wrote:
the problem is right here (said on error msg):
session_register("myusername"); session_register("mypassword");

u should use session_register("myusername") after declare the name.
i taken from my php chm

It is currently impossible to register resource variables in a session. 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.

if you understand what statement above.. conguration, if not.. don't shock.. me either.

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/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux