Re: session_register
| From: | David Robley | Date: | Tue, 04 Jul 2000 01:47:58 +0000 |
| Subject: | Re: session_register | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4639@lists.php.net to get a copy of this message | ||
On 4 Jul, kevin@oceania.net wrote:
> I wish to register some variables but get the following error.
> Warning: Supplied argument is not a valid MySQL result resource in
> /home/httpd/html/accounts/pos/include/login.php on line 17
>
> Warning: Cannot add header information - headers already sent by (output
> started at
> /home/httpd/html/accounts/pos/include/login.php:17) in
> /home/httpd/html/accounts/pos/include/login.php
> on line 27
>
> My code looks like this
> Kind regards Kevin
>
> <?
> session_start();
> if ($UserName && $Password) {
>
> /* set our global variables */
> global $UserName, $Password, $GST, $MarkUP;
>
> /* make connection to database */
> MYSQL_PCONNECT("localhost", "$UserName", "$Password") OR
> DIE("Unable to
> connect to database");
>
> /* select the database */
> @mysql_select_db("pos") or die( "Unable to select database");
>
> $queryVars = "SELECT * FROM Vars";
> $resultVars ="MYSQL_QUERY($queryVars)";
>
> while ($row = mysql_fetch_row($resultVars)) {
> $GST=$row[0];
> $MarkUp=$row[1];
> }
>
> session_register("UserName");
> session_register("Password");
> session_register("GST");
> session_register("MarkUp");
> }
> Header("Location: sales/sales.php");
>
> ?>
Get rid of all the blank lines before the Header line and see what
happens.
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA