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: 

> 

> >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.


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: 

>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: 

>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: 
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-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/


---



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



[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



[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



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

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

[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 "Your choice has been stored";   

}

else

{


foreach($bkmks as $v)

{
 
if(($v[tab]==$tab)&&($v[id]==$id)){print "";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 "Your choice has been stored";
   

}

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




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




[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:

--
clients/editclient.phtml:


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?

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 " SRC=\"images/blueholo.gif\" border=0 >";
>
> echo "$row[name]";
> echo "Quantity $row[quantity]";
> echo "Cost: $row[price] SC";
>
> $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 " SRC=\"images/redholo.gif\" border=0 >";
>
> echo "$row[name]";
> echo "Quantity $row[quantity]";
> echo "Cost: $row[price] SC";
>
> $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?

2002-04-06 Thread Jennifer Downey

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.

This is the shop.php

session_register("price");

$query = "SELECT * FROM {$config["prefix"]}_items where id = 1";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
echo ("");
echo "";

echo "$row[name]";
echo "Quantity $row[quantity]";
echo "Cost: $row[price] SC";

$price=$row[price];

$query = "SELECT * FROM {$config["prefix"]}_items where id = 2";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
echo ("");
echo "";

echo "$row[name]";
echo "Quantity $row[quantity]";
echo "Cost: $row[price] SC";

$price=$row[price];

This is buyitem.php

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

// 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;
  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);
  }
}

Any way thank you for all your help
Jennifer


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



-- 
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:

http://$HTTP_HOST/mall/menu.php";);
   exit();
  }
  else
  {
   echo "Sorry,you entered either a wrong User Name or Password.Try 
again";
   echo "Back";
  }
 

 else:
 

  
?>



Login Page







User Name
Password


Forgot your password?







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





Cocktail bar

http://$HTTP_HOST/mall/login.php";);
exit();
  }
?>
?>


  

  
  Add
  Delete
  Update
  Edit you Info


  

  




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]