Re: [PHP-DB] Session Problem

2007-01-16 Thread bob plano

what version of php are you using? i ran across a problem with
sessions not working for windows in php 5.2 because the directories
for the sessions were not created.

On 1/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

I don't think that the problem is on the browser setting...

Cause I've tried to browse the other web application (that using session
too) on other server, and its running well...



Forget to tell you, that if I used http://localhost http://localhost/
, the session running well...

But if I change with http://hostname http://hostname/  , the session
wasn't running...

I thought the problem was on privileges...

But I have setting the grant privilege to user root  the hostname...

Still the session not running..



Regards,



Anita



-Original Message-
From: Bastien Koert [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 13, 2007 12:21 AM
To: Adman, Nur anita; [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Subject: RE: [PHP-DB] Session Problem



are you sure that the problem is not in the browser settings (not to
accept

session cookies)?



Bastien





From: [EMAIL PROTECTED]

To: [EMAIL PROTECTED]

CC: php-db@lists.php.net

Subject: RE: [PHP-DB] Session Problem

Date: Fri, 12 Jan 2007 15:34:06 +0900







1.  Did you mean that on phpinfo(), the Session Support is enabled?

Yes, it wrote so.



2.  I have check the session.save_files, and its writable. I found

some files session in there.







Please advice...







Thanks  Regards,







Anita











-Original Message-

From: Peter Beckman [mailto:[EMAIL PROTECTED]

Sent: Friday, January 12, 2007 2:27 PM

To: Adman, Nur anita

Cc: php-db@lists.php.net

Subject: Re: [PHP-DB] Session Problem







1. Is session support compiled into PHP, or if not, is the module there

and



being loaded?  phpinfo() will tell you.







   If not, recompile PHP or build the dynamic module to support
sessions.







2. If so, check the location of session.save_files and make sure it is



writable by the web server user/group.  If not, you must change this.







Beckman







On Fri, 12 Jan 2007, [EMAIL PROTECTED] wrote:







  Dear All,



 



 



 



  I need some help please...



 



 



 



  I'm developing an web application using PHP/MySQL, and its has been



  running on my company.



 



 



 



  I'm planning to migrate the system on a new server.



 



  I have installed everything that are needed on the new server to

running



  the web application.



 



  But I'm confusing that the session isn't running.



 



 



 



  For your information, I've setting all configurations (MySQL  PHP),



  included register globals to Off.



 



  I have trying to re-install the web server  MySQL, but it still not



  running...



 



 



 



  Please advice...



 



 



 



  Thanks  Regards,



 



 



 



  Anita



 



 







---
-

---



Peter Beckman  Internet

Guy



[EMAIL PROTECTED]

http://www.purplecow.com/



---
-

---





_

Your opinion matters. Please tell us what you think and be entered into
a

draw for a grand prize of $500 or one of 20 $50 cash prizes.

http://www.youthographyinsiders.com/R.aspx?a=116







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



RE: [PHP-DB] Session Problem

2007-01-16 Thread Nur_Adman
I`m using PHP 5.0.4 on the new server, the same version with my old
one

 

Regards, 

Anita

 

-Original Message-
From: bob plano [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 17, 2007 8:45 AM
To: Adman, Nur anita
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-db@lists.php.net
Subject: Re: [PHP-DB] Session Problem

 

what version of php are you using? i ran across a problem with

sessions not working for windows in php 5.2 because the directories

for the sessions were not created.

 

On 1/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 I don't think that the problem is on the browser setting...

 

 Cause I've tried to browse the other web application (that using
session

 too) on other server, and its running well...

 

 

 

 Forget to tell you, that if I used http://localhost
http://localhost/

 , the session running well...

 

 But if I change with http://hostname http://hostname/  , the session

 wasn't running...

 

 I thought the problem was on privileges...

 

 But I have setting the grant privilege to user root  the hostname...

 

 Still the session not running..

 

 

 

 Regards,

 

 

 

 Anita

 

 

 

 -Original Message-

 From: Bastien Koert [mailto:[EMAIL PROTECTED]

 Sent: Saturday, January 13, 2007 12:21 AM

 To: Adman, Nur anita; [EMAIL PROTECTED]

 Cc: php-db@lists.php.net

 Subject: RE: [PHP-DB] Session Problem

 

 

 

 are you sure that the problem is not in the browser settings (not to

 accept

 

 session cookies)?

 

 

 

 Bastien

 

 

 

 

 

 From: [EMAIL PROTECTED]

 

 To: [EMAIL PROTECTED]

 

 CC: php-db@lists.php.net

 

 Subject: RE: [PHP-DB] Session Problem

 

 Date: Fri, 12 Jan 2007 15:34:06 +0900

 

 

 

 

 

 

 

 1.  Did you mean that on phpinfo(), the Session Support is
enabled?

 

 Yes, it wrote so.

 

 

 

 2.  I have check the session.save_files, and its writable. I
found

 

 some files session in there.

 

 

 

 

 

 

 

 Please advice...

 

 

 

 

 

 

 

 Thanks  Regards,

 

 

 

 

 

 

 

 Anita

 

 

 

 

 

 

 

 

 

 

 

 -Original Message-

 

 From: Peter Beckman [mailto:[EMAIL PROTECTED]

 

 Sent: Friday, January 12, 2007 2:27 PM

 

 To: Adman, Nur anita

 

 Cc: php-db@lists.php.net

 

 Subject: Re: [PHP-DB] Session Problem

 

 

 

 

 

 

 

 1. Is session support compiled into PHP, or if not, is the module
there

 

 and

 

 

 

 being loaded?  phpinfo() will tell you.

 

 

 

 

 

 

 

If not, recompile PHP or build the dynamic module to support

 sessions.

 

 

 

 

 

 

 

 2. If so, check the location of session.save_files and make sure it
is

 

 

 

 writable by the web server user/group.  If not, you must change this.

 

 

 

 

 

 

 

 Beckman

 

 

 

 

 

 

 

 On Fri, 12 Jan 2007, [EMAIL PROTECTED] wrote:

 

 

 

 

 

 

 

   Dear All,

 

 

 

  

 

 

 

  

 

 

 

  

 

 

 

   I need some help please...

 

 

 

  

 

 

 

  

 

 

 

  

 

 

 

   I'm developing an web application using PHP/MySQL, and its has
been

 

 

 

   running on my company.

 

 

 

  

 

 

 

  

 

 

 

  

 

 

 

   I'm planning to migrate the system on a new server.

 

 

 

  

 

 

 

   I have installed everything that are needed on the new server to

 

 running

 

 

 

   the web application.

 

 

 

  

 

 

 

   But I'm confusing that the session isn't running.

 

 

 

  

 

 

 

  

 

 

 

  

 

 

 

   For your information, I've setting all configurations (MySQL 
PHP),

 

 

 

   included register globals to Off.

 

 

 

  

 

 

 

   I have trying to re-install the web server  MySQL, but it still
not

 

 

 

   running...

 

 

 

  

 

 

 

  

 

 

 

  

 

 

 

   Please advice...

 

 

 

  

 

 

 

  

 

 

 

  

 

 

 

   Thanks  Regards,

 

 

 

  

 

 

 

  

 

 

 

  

 

 

 

   Anita

 

 

 

  

 

 

 

  

 

 

 

 

 

 

 


---

 -

 

 ---

 

 

 

 Peter Beckman
Internet

 

 Guy

 

 

 

 [EMAIL PROTECTED]

 

 http://www.purplecow.com/

 

 

 


---

 -

 

 ---

 

 

 

 

 

 _

 

 Your opinion matters. Please tell us what you think and be entered
into

 a

 

 draw for a grand prize of $500 or one of 20 $50 cash prizes.

 

 http://www.youthographyinsiders.com/R.aspx?a=116

 

 

 

 

 



RE: [PHP-DB] Session Problem

2007-01-12 Thread Bastien Koert
are you sure that the problem is not in the browser settings (not to accept 
session cookies)?


Bastien



From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
CC: php-db@lists.php.net
Subject: RE: [PHP-DB] Session Problem
Date: Fri, 12 Jan 2007 15:34:06 +0900



1.  Did you mean that on phpinfo(), the Session Support is enabled?
Yes, it wrote so.

2.  I have check the session.save_files, and its writable. I found
some files session in there.



Please advice...



Thanks  Regards,



Anita





-Original Message-
From: Peter Beckman [mailto:[EMAIL PROTECTED]
Sent: Friday, January 12, 2007 2:27 PM
To: Adman, Nur anita
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Session Problem



1. Is session support compiled into PHP, or if not, is the module there
and

being loaded?  phpinfo() will tell you.



  If not, recompile PHP or build the dynamic module to support sessions.



2. If so, check the location of session.save_files and make sure it is

writable by the web server user/group.  If not, you must change this.



Beckman



On Fri, 12 Jan 2007, [EMAIL PROTECTED] wrote:



 Dear All,







 I need some help please...







 I'm developing an web application using PHP/MySQL, and its has been

 running on my company.







 I'm planning to migrate the system on a new server.



 I have installed everything that are needed on the new server to
running

 the web application.



 But I'm confusing that the session isn't running.







 For your information, I've setting all configurations (MySQL  PHP),

 included register globals to Off.



 I have trying to re-install the web server  MySQL, but it still not

 running...







 Please advice...







 Thanks  Regards,







 Anita








---

Peter Beckman  Internet
Guy

[EMAIL PROTECTED]
http://www.purplecow.com/


---



_
Your opinion matters. Please tell us what you think and be entered into a 
draw for a grand prize of $500 or one of 20 $50 cash prizes. 
http://www.youthographyinsiders.com/R.aspx?a=116


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



RE: [PHP-DB] Session Problem

2007-01-12 Thread Nur_Adman
I don't think that the problem is on the browser setting...

Cause I've tried to browse the other web application (that using session
too) on other server, and its running well...

 

Forget to tell you, that if I used http://localhost http://localhost/
, the session running well...

But if I change with http://hostname http://hostname/  , the session
wasn't running...

I thought the problem was on privileges...

But I have setting the grant privilege to user root  the hostname...

Still the session not running..

 

Regards,

 

Anita

 

-Original Message-
From: Bastien Koert [mailto:[EMAIL PROTECTED] 
Sent: Saturday, January 13, 2007 12:21 AM
To: Adman, Nur anita; [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Subject: RE: [PHP-DB] Session Problem

 

are you sure that the problem is not in the browser settings (not to
accept 

session cookies)?

 

Bastien

 

 

From: [EMAIL PROTECTED]

To: [EMAIL PROTECTED]

CC: php-db@lists.php.net

Subject: RE: [PHP-DB] Session Problem

Date: Fri, 12 Jan 2007 15:34:06 +0900

 

 

 

1.  Did you mean that on phpinfo(), the Session Support is enabled?

Yes, it wrote so.

 

2.  I have check the session.save_files, and its writable. I found

some files session in there.

 

 

 

Please advice...

 

 

 

Thanks  Regards,

 

 

 

Anita

 

 

 

 

 

-Original Message-

From: Peter Beckman [mailto:[EMAIL PROTECTED]

Sent: Friday, January 12, 2007 2:27 PM

To: Adman, Nur anita

Cc: php-db@lists.php.net

Subject: Re: [PHP-DB] Session Problem

 

 

 

1. Is session support compiled into PHP, or if not, is the module there

and

 

being loaded?  phpinfo() will tell you.

 

 

 

   If not, recompile PHP or build the dynamic module to support
sessions.

 

 

 

2. If so, check the location of session.save_files and make sure it is

 

writable by the web server user/group.  If not, you must change this.

 

 

 

Beckman

 

 

 

On Fri, 12 Jan 2007, [EMAIL PROTECTED] wrote:

 

 

 

  Dear All,

 

 

 

 

 

 

 

  I need some help please...

 

 

 

 

 

 

 

  I'm developing an web application using PHP/MySQL, and its has been

 

  running on my company.

 

 

 

 

 

 

 

  I'm planning to migrate the system on a new server.

 

 

 

  I have installed everything that are needed on the new server to

running

 

  the web application.

 

 

 

  But I'm confusing that the session isn't running.

 

 

 

 

 

 

 

  For your information, I've setting all configurations (MySQL  PHP),

 

  included register globals to Off.

 

 

 

  I have trying to re-install the web server  MySQL, but it still not

 

  running...

 

 

 

 

 

 

 

  Please advice...

 

 

 

 

 

 

 

  Thanks  Regards,

 

 

 

 

 

 

 

  Anita

 

 

 

 

 

 

 

---
-

---

 

Peter Beckman  Internet

Guy

 

[EMAIL PROTECTED]

http://www.purplecow.com/

 

---
-

---

 

 

_

Your opinion matters. Please tell us what you think and be entered into
a 

draw for a grand prize of $500 or one of 20 $50 cash prizes. 

http://www.youthographyinsiders.com/R.aspx?a=116

 



[PHP-DB] Session Problem

2007-01-11 Thread Nur_Adman
Dear All,

 

I need some help please...

 

I'm developing an web application using PHP/MySQL, and its has been
running on my company.

 

I'm planning to migrate the system on a new server.

I have installed everything that are needed on the new server to running
the web application.

But I'm confusing that the session isn't running.

 

For your information, I've setting all configurations (MySQL  PHP),
included register globals to Off.

I have trying to re-install the web server  MySQL, but it still not
running...

 

Please advice...

 

Thanks  Regards,

 

Anita



Re: [PHP-DB] Session Problem

2007-01-11 Thread Peter Beckman

1. Is session support compiled into PHP, or if not, is the module there and
being loaded?  phpinfo() will tell you.

 If not, recompile PHP or build the dynamic module to support sessions.

2. If so, check the location of session.save_files and make sure it is
writable by the web server user/group.  If not, you must change this.

Beckman

On Fri, 12 Jan 2007, [EMAIL PROTECTED] wrote:


Dear All,



I need some help please...



I'm developing an web application using PHP/MySQL, and its has been
running on my company.



I'm planning to migrate the system on a new server.

I have installed everything that are needed on the new server to running
the web application.

But I'm confusing that the session isn't running.



For your information, I've setting all configurations (MySQL  PHP),
included register globals to Off.

I have trying to re-install the web server  MySQL, but it still not
running...



Please advice...



Thanks  Regards,



Anita




---
Peter Beckman  Internet Guy
[EMAIL PROTECTED] http://www.purplecow.com/
---

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



RE: [PHP-DB] Session Problem

2007-01-11 Thread Nur_Adman
 

1.  Did you mean that on phpinfo(), the Session Support is enabled?
Yes, it wrote so.

2.  I have check the session.save_files, and its writable. I found
some files session in there.

 

Please advice...

 

Thanks  Regards,

 

Anita

 

 

-Original Message-
From: Peter Beckman [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 12, 2007 2:27 PM
To: Adman, Nur anita
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Session Problem

 

1. Is session support compiled into PHP, or if not, is the module there
and

being loaded?  phpinfo() will tell you.

 

  If not, recompile PHP or build the dynamic module to support sessions.

 

2. If so, check the location of session.save_files and make sure it is

writable by the web server user/group.  If not, you must change this.

 

Beckman

 

On Fri, 12 Jan 2007, [EMAIL PROTECTED] wrote:

 

 Dear All,

 

 

 

 I need some help please...

 

 

 

 I'm developing an web application using PHP/MySQL, and its has been

 running on my company.

 

 

 

 I'm planning to migrate the system on a new server.

 

 I have installed everything that are needed on the new server to
running

 the web application.

 

 But I'm confusing that the session isn't running.

 

 

 

 For your information, I've setting all configurations (MySQL  PHP),

 included register globals to Off.

 

 I have trying to re-install the web server  MySQL, but it still not

 running...

 

 

 

 Please advice...

 

 

 

 Thanks  Regards,

 

 

 

 Anita

 

 

 


---

Peter Beckman  Internet
Guy

[EMAIL PROTECTED]
http://www.purplecow.com/


---



[PHP-DB] session problem

2004-04-26 Thread Sukanto Kho
Hi

When I create an session var ...It stored in server right??

then everytime I change the session value then it should connect to the
server to update...is it still right??

When I want to change the session value and the connection is down then the
session value won't be update??

Thanks

Nicholas sk2

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



[PHP-DB] session problem

2003-07-23 Thread tana dsasa
I have installed an user-login aplication on my website ( 
http://www.norbertnet.ro ) but i have problems with session controls.
I receive all kinds of warnings and i don't know how to interpret them
 
thanks advanced




-
Want to chat instantly with your online friends? Get the FREE Yahoo!Messenger

RE: [PHP-DB] session problem

2003-07-23 Thread Dillon, John
This is advertising a porno site.

-Original Message-
From: tana dsasa [mailto:[EMAIL PROTECTED]
Sent: 23 July 2003 11:11
To: [EMAIL PROTECTED]
Subject: [PHP-DB] session problem


I have installed an user-login aplication on my website ( 
http://www.norbertnet.ro ) but i have problems with session controls.
I receive all kinds of warnings and i don't know how to interpret them
 
thanks advanced




-
Want to chat instantly with your online friends? Get the FREE
Yahoo!Messenger


   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html


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



[PHP-DB] session problem

2002-08-10 Thread Ricky

Hello everybody I'd like to make a page in which the results shown can 
be bookmarked by pressing a button.
Actually first it checks if the session is open already ... Then it 
should check if the result (that comes from a query to a MySQL table) 
has been registered already, finally it registers all the variables in a 
multidimensional array.
this is the code:
session_start();

if(!session_is_registered(bkmks))

  {session_register(bkmks)||die(WE GOT PROBLEMS MAN);
$bkmks = array(array(tab=$tab, id=$id, url=$url, nome=$nome, 
ind=$ind, com=$com, pv=$pv, tel=$tel, chi=$chi));

print htmlbody Your choice has been stored/body/html;   

}

else

{


foreach($bkmks as $v)

{
 
if(($v[tab]==$tab)($v[id]==$id)){print htmlbody You have already 
chosen this item/body/html;exit;

}

}

$bkmks[][tab]=$tab;

$bkmks[][id]=$id;

$bkmks[][url]=$url;

$bkmks[][nome]=$nome;

$bkmks[][ind]=$ind;

$bkmks[][com]=$com;

$bkmks[][pv]=$pv;

$bkmks[][tel]=$tel;

$bkmks[][chi]=$chi;

print htmlbodyYour choice has been stored/body/html;
   

}

It doesn't work! I can't figure out why.
It starts storing fine and then it seems messing up with values so it 
recognises as already stored only the variables of my first choice (the 
value stored at bkmks[0])... I tried to print values stored in the 
array: the output is a mess I don't know why!

Thanks a lot !
Bye.




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




[PHP-DB] Session Problem, Please Help.....

2002-05-02 Thread Hayan AL Mamoun

Dear all, I have a strange problem:
I'm using IIS / WINNT4, PHP4
Please check these two files:
--
logon.phtml:
?
session_start();
session_register(CLIENTID);
$CLIENTID=SOMEVALUE;
header(Location: clients/editclient.phtml);
?
--
clients/editclient.phtml:
?
session_start();
echo CLient ID VALUE IS : $CLIENTID;
?

When I run logon.phtml, it must create a session variable called CLIENTID
and then move to the second page, which displays this variable.
Each time I test this code I start a new instant of the IE and request
logon.phtml (in order to create a new session), but it never works from the
first time, while if I tested it a second time from the same instance of IE
it works???!
Please could anyone help, why it dosn't work from the first time?

thnkx
Hayan


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




Re: [PHP-DB] Session Problem, Please Help.....

2002-05-02 Thread szii

I believe it's because $CLIENTID is not set at ALL before you 
register it.  (ie, isset($CLIENTID) would fail)  Therefore it cannot
register the variable...there's nothing for it to register or track.

Try...

$CLIENTID = ;
session_register(CLIENTID);
$CLIENTID=SOMEVALUE;

- Original Message - 
From: Hayan AL Mamoun [EMAIL PROTECTED]
To: PHPList (E-mail) [EMAIL PROTECTED]
Sent: Thursday, May 02, 2002 3:15 AM
Subject: [PHP-DB] Session Problem, Please Help.


 Dear all, I have a strange problem:
 I'm using IIS / WINNT4, PHP4
 Please check these two files:
 --
 logon.phtml:
 ?
 session_start();
 session_register(CLIENTID);
 $CLIENTID=SOMEVALUE;
 header(Location: clients/editclient.phtml);
 ?
 --
 clients/editclient.phtml:
 ?
 session_start();
 echo CLient ID VALUE IS : $CLIENTID;
 ?
 
 When I run logon.phtml, it must create a session variable called CLIENTID
 and then move to the second page, which displays this variable.
 Each time I test this code I start a new instant of the IE and request
 logon.phtml (in order to create a new session), but it never works from the
 first time, while if I tested it a second time from the same instance of IE
 it works???!
 Please could anyone help, why it dosn't work from the first time?
 
 thnkx
 Hayan
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP-DB] Session problem?

2002-04-06 Thread Jason Wong

On Sunday 07 April 2002 12:01, Jennifer Downey wrote:
 Hi all,

 This code is working greate except for one minor bug.

 If I have 2 or 3 items at different prices buy.php is updating the points
 of the user at the last priced item.

 In other words if
 item 1 costs 1965
 item 2 costs 564
 item 3 costs 25

 and item 1 is clicked it only takes away 25 points instead of 1965.

 Any ideas why? and what can I do to fix this. I have read a few tut's on
 sessions now but none tell how I might get a fix for this.

It looks as if you're going about this the completely wrong way.

 This is the shop.php

 session_register(price);

You only have ONE storage space for the price of a item, yet you need to 
store more than one price, ie impossible. But it's really not needed. Read on.

Your best (and secure) approach is to minimise the amount of info given by 
the client. AFAICS the only info needed from the client is the item ID (and 
possibly the quantity, but you only seem to allow buying 1 item per click?)


 $query = SELECT * FROM {$config[prefix]}_items where id = 1;
 $result = mysql_query($query);
 $row = mysql_fetch_array($result);
 echo ();
 echo A HREF=\buyitem.php?id=1\ TARGET=\_self\IMG
 SRC=\images/blueholo.gif\ border=0 /Abr;

 echo b$row[name]/bbr;
 echo Quantity $row[quantity]br;
 echo Cost: $row[price] SCbr;

 $price=$row[price];

Not needed.


 $query = SELECT * FROM {$config[prefix]}_items where id = 2;
 $result = mysql_query($query);
 $row = mysql_fetch_array($result);
 echo ();
 echo A HREF=\buyitem.php?id=2\ TARGET=\_self\IMG
 SRC=\images/redholo.gif\ border=0 /Abr;

 echo b$row[name]/bbr;
 echo Quantity $row[quantity]br;
 echo Cost: $row[price] SCbr;

 $price=$row[price];

Not needed. This is overwriting your previous $price, thus you only get the 
last $price.


 This is buyitem.php

 session_start();
 $id = $HTTP_GET_VARS[id];

Here, you should write some code to retrieve the price of the item directly 
from the DB.


 // Updates the quantity
 $query =UPDATE {$config[prefix]}_items SET quantity = quantity - 1 where
 id = '$id';
 $ret=mysql_query($query);
 $check_points = SELECT points FROM {$config[prefix]}_users WHERE
 uid={$session[uid]};
 $ret=mysql_query($check_points);

 while(list($points)=mysql_fetch_row($ret))
 {  $cost=$HTTP_SESSION_VARS['price'];  // Gets the price of the item.
 replace with $_SESSION['price'] if PHP version = 4.1.0
 echo $cost;

Use the price as gotten from above.


   if($points  $cost) {
 echo You don't have enough StarrCredits to purchase this item!;
   }else{

 $query = UPDATE {$config[prefix]}_users SET points = points - $cost
 where uid={$session[uid]};
 mysql_query($query);
   }
 }


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
I remember when legal used to mean lawful, now it means some
kind of loophole.
-- Leo Kessler
*/

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




[PHP-DB] session problem on Netscape Vs IE, Help please!

2002-02-25 Thread david rakhmadi

Hi All,

In my application i'm using sessions...
I'm using PHP4.0.6 + Apache on linux redhat.

when I upgrade PHP into PHP 4.1.1 
I've got problem on the NETSCAPE that session is broken (unrecognized).
but on the IE ..All running well...

Any body know How to solve this problem???

Help me.. please! :))



[PHP-DB] session problem

2001-09-11 Thread its me

here is my code,u only have to care for the session part:
this is the login page:

?php
session_start();
$adminname = emad;
$serverpassword = omda;
$servername = localhost;
$dbname = mall;
$sql = SELECT * FROM registration WHERE username = '$username' and 
password='$password';


if($username != ):


$conn = mysql_connect($servername, $adminname, $serverpassword);
mysql_select_db($dbname, $conn);
$result = mysql_query($sql, $conn);
 if(@mysql_num_rows($result) != 0)
 { 
  $row = mysql_fetch_array($result);
  $valusername = $username;
  session_register(valusername);
   mysql_close($conn);
   header(location:http://$HTTP_HOST/mall/menu.php;);
   exit();
  }
  else
  {
   echo h2Sorry,you entered either a wrong User Name or Password./h2Try 
againBR;
   echo a href='login.php'Back/a;
  }
 

 else:
 

  
?

html
head
titleLogin Page/title
/head
body background=o3b.gif onLoad=document.myForm.username.focus();
FONT color=#fdf8db


table
form name=myForm method=post action=login.php
trtd align=rightFONT color=#fdf8dbbUser Name/btdinput type=text 
name=username size=40
trtd align=rightFONT color=#fdf8dbbPassword/btdinput type=password 
name=password size=40
trtd colspan=2 align=centerinput type=Submit value=Login
/form
trtda href=forgetpass.phpFONT size=-1Forgot your password?/a
/table

/body
/html
?php
endif;
?


and now this is the menu page(when login is correct):

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTML
HEAD
META name=GENERATOR content=IBM WebSphere Homepage Builder V5.0.1 for Windows
TITLECocktail bar/TITLE
/HEAD
?php

 ?php
  session_start();
  if(!(session_is_registered(valusername)))
  {
header(Location:http://$HTTP_HOST/mall/login.php;);
exit();
  }
?
?
BODY   link=#99ff00 vlink=#99cc66 alink=#00
TABLE border=1 width=100% height=100%
  TBODY
TR
  TD height=298 width=591/TD
  TD height=298 rowspan=2 background=blue5b.gif width=158 valign=middle 
align=centerA href=add.phpFONT color=#ffAdd/FONT/AFONT 
color=#ffBR
  A href=delete.phpDelete/ABR
  /FONTA href=update.phpFONT color=#ffUpdate/FONT/ABR
  A href=editinfo.phpEdit you Info/A/TD
/TR
TR
  TD height=12 width=591/TD
/TR
  /TBODY
/TABLE
/BODY
/HTML

when i login and i'm in the menu page this error show:

Warning: Cannot add header information - headers already sent by (output started at 
C:\apache\htdocs\mall\menu.php:7) in C:\apache\htdocs\mall\validate.php on line 4

can anyone help?







-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]