[PHP-DB] Two session for the same user, possible?

2004-10-21 Thread Andre Matos
Hi List,

Is it possible to have two sessions for the same user in php? If yes, how
can I implement this?

I am currently using one without problem. However, when I try to create a
second session, the first one is lost.

Thanks for any help.

Andre

--
Andre Matos
[EMAIL PROTECTED] 

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



Re: [PHP-DB] Two session for the same user, possible?

2004-10-21 Thread Matt M.
 Is it possible to have two sessions for the same user in php? If yes, how
 can I implement this?
 
 I am currently using one without problem. However, when I try to create a
 second session, the first one is lost.

could you post some code.  I am not sure I follow what you are doing.

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



[PHP-DB] Organizing a query

2004-10-21 Thread Carlos Alberto Bazan-Canabal
Hello.

I'm working on a simple search for my file, and I have a question on
structuring my query. This is what I want to do:

select * from table where
a=b
AND (b=$var1 or c=$var1 or d=$var1) 
AND b  99

In the above, you could have:
- either b or c or d or none would = $var1
- more than one of b or c or d would = $var1

Could anyone suggest a syntax  for my select statement?

Thank you!

Carlos.

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



RE: [PHP-DB] Two session for the same user, possible?

2004-10-21 Thread Norland, Martin
There is only the one $_SESSION superglobal in PHP - and session_start
doesn't take any parameters - so the builtin sessions in PHP undoubtedly
aren't anticipating a need for this.  If you are just trying to store
more data - you shouldn't have a problem, just use $_SESSION as an array
like normal, and for each application use a named key as its own array.

e.g. instead of using $_SESSION['username'] in both of two applications,
use
$_SESSION['first_session']['username'] and
$_SESSION['second_session']['username']
or something similar in each.

I assume the reason you're encountering some sort of problem is because
you have two canned applications that both conflict with session
variables, or you want to run the same application twice?  The sessions
are tied to the hostname - so if you make a virtual server with another
address (e.g. www.something.com and app.something.com or equivalent) you
will, in effect, get your two sessions.

Beyond this, I'd need to know more of what you're intending to be of any
help.

- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.


-Original Message-
From: Andre Matos [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 21, 2004 2:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Two session for the same user, possible?


Hi List,

Is it possible to have two sessions for the same user in php? If yes,
how can I implement this?

I am currently using one without problem. However, when I try to create
a second session, the first one is lost.

Thanks for any help.

Andre

--
Andre Matos
[EMAIL PROTECTED] 

-- 
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] sending e-mails

2004-10-21 Thread 'Miguel Guirao'
Hi!!
 
I have a script in PHP that should send an e-mail from a specific e-mail
account, let's say  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
to a customer's e-mail account, using the smtp_mail.inc class of PHP.
But, Do I need to authenticate first in order to send the e-mail? If so,
how?
 
Best Regards,
 
Miguel Guirao
Servicios Datacard
www.SIASA.com.mx
 


[PHP-DB] Re: sending e-mails

2004-10-21 Thread Manuel Lemos
Hello,
On 10/21/2004 07:19 PM, Miguel Guirao wrote:
I have a script in PHP that should send an e-mail from a specific e-mail
account, let's say  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
to a customer's e-mail account, using the smtp_mail.inc class of PHP.
But, Do I need to authenticate first in order to send the e-mail? If so,
how?
I don't know what is that smtp_mail.inc class but if you use this class 
that comes with a wrapper script named smtp_mail.php you can send 
messages via an SMTP server that requires authentication. Just configure 
the user name and password within that script.

http://www.phpclasses.org/mimemessage
You also need these classes.
http://www.phpclasses.org/smtpclass
http://www.phpclasses.org/sasl
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Logging Into A MySQL (Web) Database

2004-10-21 Thread Ron Piggott
Any ideas on how to log into a mySQL database through a web form and
creating user sessions?  Ron

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



Re: [PHP-DB] Two session for the same user, possible?

2004-10-21 Thread Micah Stevens

p.s. you can also designate a session ID. If you do this you may be able to 
have two sessions running concurrently. Never tried it myself, but it should 
work.

-Micah 

On Thursday 21 October 2004 02:03 pm, Micah Stevens wrote:
 The Session ID is the same, so it will access the same variables. If you
 want to force a new session in the new script, do this:

 http://us2.php.net/manual/en/function.session-regenerate-id.php

 But this will in effect log the user out of the first session as well. If
 you want to be able to do both, I suggest you use different names for your
 session vars.

 -Micah

 On Thursday 21 October 2004 12:39 pm, Andre Matos wrote:
  Hi Matt,
 
  I have developed two different web systems that use php sessions. When I
  a user log into one system, the system creates a session and storage on
  it one object called UserSession with some information that I need while
  the user works with the system.
 
  My problem is when the user decides to open the second system without log
  out from the first one that he logged, using a new window (crtl+N) from
  the same browser. This second system creates also an object called
  UserSession, but with different properties and this new object from the
  second system overwrites the object from the first system. This is my
  problem. Can I make PHP understand that this is a complete different
  session?
 
  Thanks.
 
  Andre
 
  --
  Andre Matos
  [EMAIL PROTECTED]
 
  -Original Message-
  From: Matt M. [mailto:[EMAIL PROTECTED]
  Sent: Thursday, October 21, 2004 3:23 PM
  To: Andre Matos
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] Two session for the same user, possible?
 
   Is it possible to have two sessions for the same user in php? If yes,
   how can I implement this?
  
   I am currently using one without problem. However, when I try to create
   a second session, the first one is lost.
 
  could you post some code.  I am not sure I follow what you are doing.

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



Re: [PHP-DB] Logging Into A MySQL (Web) Database

2004-10-21 Thread Robby Russell
On Thu, 2004-10-21 at 17:50 -0400, Ron Piggott wrote:
 Any ideas on how to log into a mySQL database through a web form and
 creating user sessions?  Ron
 

That's a loaded question...

Can you be just a bit more specific? We're here to answer specific
questions... so I will answer your question as you have stated it.

There are many ideas and ways to log into a mysql database. PHP can
create user sessions to. You just have to make the code do that. ;-)

Ask more specific questions and we can try to help...but it seems like
you aren't sure what you're looking for quite yet.

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB] sending e-mails

2004-10-21 Thread Robby Russell
On Thu, 2004-10-21 at 16:19 -0600, 'Miguel Guirao' wrote:
 Hi!!
  
 I have a script in PHP that should send an e-mail from a specific e-mail
 account, let's say  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 to a customer's e-mail account, using the smtp_mail.inc class of PHP.
 But, Do I need to authenticate first in order to send the e-mail? If so,
 how?

It really depends on the web hosting server that you are on. You can
typically get away with using the mail() function which by default sends
through sendmail and doesn't bother checking for authentication.

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB] Logging Into A MySQL (Web) Database

2004-10-21 Thread Ron Piggott
Hi Robby

I knew clearly what I was trying to say in my mind but didn't do a good job
expressing it.  The web site address Alex sent me is what I am looking at
creating.

Ron

- Original Message -
From: Robby Russell [EMAIL PROTECTED]
To: Ron Piggott [EMAIL PROTECTED]
Cc: PHP DB [EMAIL PROTECTED]
Sent: Thursday, October 21, 2004 10:01 PM
Subject: Re: [PHP-DB] Logging Into A MySQL (Web) Database

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



Re: [PHP-DB] Logging Into A MySQL (Web) Database

2004-10-21 Thread Robby Russell
On Thu, 2004-10-21 at 22:20 -0400, Ron Piggott wrote:
 Hi Robby
 
 I knew clearly what I was trying to say in my mind but didn't do a good job
 expressing it.  The web site address Alex sent me is what I am looking at
 creating.
 
 Ron
 

Ok, who is Alex?

If you are following to a thread, you should stay in it. You started a
new thread and can't assume that we know where your train of thought is
coming from. 

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB] Cookies with databases

2004-10-21 Thread Jason T. Davidson
Bastien-
I took out the quotes (as I noticed after the fact that I didn't need 
them) however this did not help.

is the user cookie set  This I do not know as I am trying to test this 
on that second page.  I get nothing, so I am assuming that it isn't set, 
however the first one $cid is working just fine, but it's variable 
doesn't come from a database.

--
Jason Davidson
Bastien Koert wrote:
Hi Jason,
1. I don't think you need the quotes around the values.
2. is the user cookie set?
bastien

From: Jason T. Davidson [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Cookies with databases
Date: Wed, 20 Oct 2004 19:54:54 -0500
I am trying to set a cookie with a value from a database.  Here is my 
script:

? //Setting Cookies
setcookie ('CIDcookie', $cid);
setcookie ('USERcookie', $user);
?
?
//Database connection
require (../../db_connect.php);
//Table Name
$main_tbl = MAIN
?
?
//Check the Password against the CID
$query=SELECT * FROM $main_tbl WHERE CID='$cid';
$result=mysql_query($query) or die(mysql_error());
$check=mysql_fetch_array($result);
if($Message == NoAccess){
echo(BCENTERFONT COLOR=REDYou do not have access to that 
page!/FONT/CENTER/B\n);
include (staff_code/admin_links.php);
}
if($check[PASSWORD] != $_REQUEST[password]){
header(Location:staff_login.php?Message=Invalid);
}
if(($check[PASSWORD] == $_REQUEST[password]) AND ($check[USER] == 
A)) {
include (staff_code/admin_links.php);
$user = $check[USER];
}
else{
include (staff_code/controller_links.php);
}
?

Then on the second page it is reading the cookies, but it will display 
the CIDcookie, but not the USERcookie.  Here is the script on the 
second page:

? //Retrieve Cookies
$cid = $_COOKIE['CIDcookie'];
$user = $_COOKIE['USERcookie'];
?
html
head
titleZMP ARTCC:  Staff To Do List/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head
?
echo (My CID is $cid);
echo ($user);
?
body text=#66 link=#66 vlink=#66 alink=#66
table width=600
tr
tddiv align=centerfont size=4strongZMPs Staff TO Do 
List/strong/font/div/td
/tr
/table
br

table width=600
tr
td colspan=3 bgcolor=#99div 
align=centerstrongfont size=3Completed 
Tasks/font/strong/div/td
/tr
tr bgcolor=#CC
td width=100div align=centerDate Finished/div/td
td width=250div align=centerTask/div/td
td width=250div align=centerStatus/div/td
/tr
tr
  tddiv align=center10-13-04/div/td
  tddiv align=centerDLH SOP (new)/div/td
  tddiv align=centerAwaiting finish of other 
projects/div/td
  /tr
tr
  tddiv align=center10-18-04/div/td
  tddiv align=centerZMP Policies/div/td
  tddiv align=centerquot;/div/td
  /tr
/table
br

table width=600
tr
td colspan=3 bgcolor=#99div 
align=centerstrongfont size=3
Tasks Awaiting VATUSA Approval/font/strong/div/td
/tr
tr bgcolor=#CC
  td width=100div align=centerDate Sent/div/td
  td width=250div align=centerTask/div/td
  td width=250div align=centerStatus/div/td
/tr
tr
  tddiv align=center10-09-04/div/td
  tddiv align=centerLNK SOP (new)/div/td
  tddiv align=centerAwaiting approval/div/td
  /tr
tr
  tddiv align=center10-19-04/div/td
  tddiv align=centerM98 SOP/div/td
  tddiv align=centerAwaiting Approval/div/td
  /tr
tr
  tddiv align=center10-19-04/div/td
  tddiv align=centerGeneral SOP/div/td
  tddiv align=centerAwaiting Approval/div/td
  /tr
/table

/body
/html
So I am assuming that somewhere in my first page that my cookie isn't 
actually gettting set properly.  I have tried many varitites and can't 
find any help sections on cookies from a database.  Any help would be 
appreciated!

--
Jason Davidson
--
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] Cookies with databases

2004-10-21 Thread Jason T. Davidson
Tyler-
I have been to that section of php.net many times.  My first cookie 
($cid) doesn't have them domain listed and works just fine.  Don't see I 
would need it for the cookie ($user)?

--
Jason Davidson
Tyler Replogle wrote:
Yes you need to set the string domain
http://us2.php.net/manual/en/function.setcookie.php
that url should help you
From: Jason T. Davidson [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Cookies with databases
Date: Wed, 20 Oct 2004 19:54:54 -0500
MIME-Version: 1.0
Received: from pb1.pair.com ([216.92.131.4]) by mc8-f21.hotmail.com 
with Microsoft SMTPSVC(5.0.2195.6824); Wed, 20 Oct 2004 18:10:29 -0700
Received: (qmail 42118 invoked by uid 1010); 21 Oct 2004 01:10:20 -
Received: (qmail 95202 invoked by uid 1010); 21 Oct 2004 00:55:20 -
X-Message-Info: JGTYoYF78jECeNGc3phkjLz5nkZbete3
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
list-help: mailto:[EMAIL PROTECTED]
list-unsubscribe: mailto:[EMAIL PROTECTED]
list-post: mailto:[EMAIL PROTECTED]
Delivered-To: mailing list [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Message-ID: [EMAIL PROTECTED]
Organization: UND Aerospace Foundation
User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913)
X-Accept-Language: en-us, en
X-Posted-By: 24.197.179.243
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 21 Oct 2004 01:10:29.0559 (UTC) 
FILETIME=[C167FC70:01C4B70A]

I am trying to set a cookie with a value from a database.  Here is my 
script:

? //Setting Cookies
setcookie ('CIDcookie', $cid);
setcookie ('USERcookie', $user);
?
?
//Database connection
require (../../db_connect.php);
//Table Name
$main_tbl = MAIN
?
?
//Check the Password against the CID
$query=SELECT * FROM $main_tbl WHERE CID='$cid';
$result=mysql_query($query) or die(mysql_error());
$check=mysql_fetch_array($result);
if($Message == NoAccess){
echo(BCENTERFONT COLOR=REDYou do not have access to that 
page!/FONT/CENTER/B\n);
include (staff_code/admin_links.php);
}
if($check[PASSWORD] != $_REQUEST[password]){
header(Location:staff_login.php?Message=Invalid);
}
if(($check[PASSWORD] == $_REQUEST[password]) AND ($check[USER] == 
A)) {
include (staff_code/admin_links.php);
$user = $check[USER];
}
else{
include (staff_code/controller_links.php);
}
?

Then on the second page it is reading the cookies, but it will display 
the CIDcookie, but not the USERcookie.  Here is the script on the 
second page:

? //Retrieve Cookies
$cid = $_COOKIE['CIDcookie'];
$user = $_COOKIE['USERcookie'];
?
html
head
titleZMP ARTCC:  Staff To Do List/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head
?
echo (My CID is $cid);
echo ($user);
?
body text=#66 link=#66 vlink=#66 alink=#66
table width=600
tr
tddiv align=centerfont size=4strongZMPs Staff TO Do 
List/strong/font/div/td
/tr
/table
br

table width=600
tr
td colspan=3 bgcolor=#99div 
align=centerstrongfont size=3Completed 
Tasks/font/strong/div/td
/tr
tr bgcolor=#CC
td width=100div align=centerDate Finished/div/td
td width=250div align=centerTask/div/td
td width=250div align=centerStatus/div/td
/tr
tr
  tddiv align=center10-13-04/div/td
  tddiv align=centerDLH SOP (new)/div/td
  tddiv align=centerAwaiting finish of other 
projects/div/td
  /tr
tr
  tddiv align=center10-18-04/div/td
  tddiv align=centerZMP Policies/div/td
  tddiv align=centerquot;/div/td
  /tr
/table
br

table width=600
tr
td colspan=3 bgcolor=#99div 
align=centerstrongfont size=3
Tasks Awaiting VATUSA Approval/font/strong/div/td
/tr
tr bgcolor=#CC
  td width=100div align=centerDate Sent/div/td
  td width=250div align=centerTask/div/td
  td width=250div align=centerStatus/div/td
/tr
tr
  tddiv align=center10-09-04/div/td
  tddiv align=centerLNK SOP (new)/div/td
  tddiv align=centerAwaiting approval/div/td
  /tr
tr
  tddiv align=center10-19-04/div/td
  tddiv align=centerM98 SOP/div/td
  tddiv align=centerAwaiting Approval/div/td
  /tr
tr
  tddiv align=center10-19-04/div/td
  tddiv align=centerGeneral SOP/div/td
  tddiv align=centerAwaiting Approval/div/td
  /tr
/table

/body
/html
So I am assuming that somewhere in my first page that my cookie isn't 
actually gettting set properly.  I have tried many varitites and can't 
find any help sections on cookies from a database.  Any help would be 
appreciated!

--
Jason Davidson
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Check out Election 2004 for up-to-date election news, plus voter tools 
and more! http://special.msn.com/msn/election2004.armx
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: