[PHP] Can it be doen with Array????

2003-01-02 Thread Scott Fletcher
Hi!

I know that it can be done with certain variables that can overwrite
another variable.  Like 

$test = "123";
$other = "xyz";

$test = $other;

What about the Array?  Can this be done?

$array_test[1] = "abc";
$array_test[2] = "jkl";
$array_test[3] = "$%(";

$other_test = $array_test;

echo $other_test[1];

Would the result be "abc"   Does it work that way?  I need something
that would work with one array to a different array.

Thanks





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




Re: [PHP] Can it be doen with Array????

2003-01-02 Thread Scott Fletcher
Thanks!  I looked it up on the php.net and I wasn't sure if I understood it,
so I post it here instead.  Thanks for hte response.

Scott F.
"Gareth Hastings" <[EMAIL PROTECTED]> wrote in message
000201c2b2ab$3bb8be30$[EMAIL PROTECTED]">news:000201c2b2ab$3bb8be30$[EMAIL PROTECTED]...
> Bah, I meant
>
> $a[] = "0";
> $a[] = "1";
> $b = $a;
>
> echo $b[0];
>
> > -Original Message-
> > From: Gareth Hastings [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, January 02, 2003 5:05 PM
> > To: 'Scott Fletcher'; [EMAIL PROTECTED]
> > Cc: [EMAIL PROTECTED]
> > Subject: RE: [PHP] Can it be doen with Array
> >
> > Yes you can simply assign arrays like
> >
> > $a = "0";
> > $a = "1";
> > $b   = $a;
> >
> > echo $b[0];
> >
> > would print
> >
> > 0
> >
> >
> > > -Original Message-
> > > From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, January 02, 2003 5:08 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] Can it be doen with Array
> > >
> > > Hi!
> > >
> > > I know that it can be done with certain variables that can
> > overwrite
> > > another variable.  Like 
> > >
> > > $test = "123";
> > > $other = "xyz";
> > >
> > > $test = $other;
> > >
> > > What about the Array?  Can this be done?
> > >
> > > $array_test[1] = "abc";
> > > $array_test[2] = "jkl";
> > > $array_test[3] = "$%(";
> > >
> > > $other_test = $array_test;
> > >
> > > echo $other_test[1];
> > >
> > > Would the result be "abc"   Does it work that way?  I need
> > > something
> > > that would work with one array to a different array.
> > >
> > > Thanks
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




[PHP] session_start() in php.ini does not work on Microsoft IIS

2003-01-06 Thread Scott Fletcher
Hi!

It have been a while that I don't remember how did I jogged MS-IIS's
memory or something.  Perhap a baseball bat will help.  I'm not here to ask
for help on writing script for session ID or stuffs like that.  I'm here
asking for help in jogging IIS's memory with a baseball bat.

When I use the PHP command, session_start and tested it out on the
website.  I get an error messages saying as shown on the clipping down
below  This is the script I use alone.



This is the error messages

--clip--
Warning: open(/tmp\sess_C4155DDAF13A529594FB7C2541F4D4C7, O_RDWR) failed: m
(2) in D:\DealPack\...  on line 24

Warning: open(/tmp\sess_C4155DDAF13A529594FB7C2541F4D4C7, O_RDWR) failed: m
(2) in Unknown on line 0

Warning: Failed to write session data (files). Please verify that the
current setting of session.save_path is correct (/tmp) in Unknown on line 0
--clip--

I can see the problem with "/tmp" so I looked through the PHP.INI and
modify the script.  The line of code here goes from  to .

--clip--
>From ...
session.save_path = /tmp; argument passed to save_handler
session.cookie_path   = /   ; the path the cookie is valid for

To
session.save_path = \tmp; argument passed to save_handler
session.cookie_path   = \   ; the path the cookie is valid for
--clip--

I even created the folder 'tmp' on the c:\ drive.  I stopped the website
then I stopped the IIS.  I then start the IIS then start the website.  When
accessing this script on the website, I still get the same error.  The
problem here is that IIS does not actually refreshed or restarted  I
even rebooted the machine.

I can use your help.  Thanks!

Scott F.



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




[PHP] Re: time stamp screwing up

2003-01-06 Thread Scott Fletcher
Instead of the php function, 'time()'.  Try 'date()'.  Somethine like this

--clip--

--clip--

You can customize the way you want the time format to be displayed.  You can
find it at http://www.php.net/manual/en/function.date.php and you'll see the
option for dates and times.

"- -" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hey guys could someone help me
> I have created a user login register system in  flash with PHP and Mysql.
> Everthing Now works fine aprt from the time stamp of when the user
> registered.
>
> Code ---
> // Get current date & time
> $time = time();
> // Connects to the Database.
> $Connect = mysql_connect($dbServer, $dbUser, $dbPass);
> mysql_select_db("$dbName");
> // Preforms the SQL query to see if user name already exsists
> $query = "SELECT name FROM contacts WHERE name='$name'";
> $rs_contacts = mysql_query($query) or die(mysql_error());
> $row = mysql_fetch_assoc($rs_contacts);
> if ($row[name] == $name) {
> print "loginT=UserName in Use&checklog=2";
> }else{
> $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES
> (NULL, '$name', '$pass', '$email', '$time')";
> }
>
>
> It inserts -00-00
> instead of the current date
>
> ideas
>
> P.S
> I am a newbie try keeping reponse's simple please
>
>



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




[PHP] Re: php.ini - changes aren't taking?

2003-01-06 Thread Scott Fletcher
I'm having the same problem with II5 as you do.  So, we're in the same boat.
I only have one php.ini on Windows and I'm using hte same file path.  I even
rebooted the machine.  I don't see how was I able to make it work before but
not now

Scott F.

"Rad Craig" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have been trying to get my email working.  I have made some changes in
the
> php.ini file in the Windoze directory, but when I run phpinfo() the
changes
> I make aren't changing on what it prints out.
>
> I have logging turned on in my php.ini file, but phpinfo() says it's
turned
> off.
>
> Any ideas?
> 
> Rad Craig
>
>



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




Re: [PHP] php.ini - changes aren't taking?

2003-01-06 Thread Scott Fletcher
That is correct, there's no PHP fault.  It's is just IIS that aren't doing
what it is suppose to be doing.  I'm still working on it.


"Christoph Grottolo" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Rad Craig wrote:
> > Yes, I restart my WebServer (IIS 5) each time.
> >
> > Yes, I am editing the .ini file the phpinfo() reports it is using.
> >
> >>> I have been trying to get my email working.  I have made some
> >>> changes in the php.ini file in the Windoze directory, but when I
> >>> run phpinfo() the changes I make aren't changing on what it prints
> >>> out.
> >>>
> >>> I have logging turned on in my php.ini file, but phpinfo() says
> >> it's turned
> >>> off.
>
> So the only  possibility is the refresh settings in your browser. Refresh
> the page where you call phpinfo() by hitting +F5.
>
> If you change the ini file php uses (double check if it's the one you're
> editing, notepad loves saving the file as php.ini.txt), the changes take
are
> reflected when you restart the webserver. There is no possilility of a php
> fault, don't search there.
>
> Christoph
>
>



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




Re: [PHP] php.ini - changes aren't taking?

2003-01-06 Thread Scott Fletcher
The funny thing is that when IIS is freshly installed on a new O/S.  It is
very simple to make PHP work.  Then 6 months later, IIS lose itself and have
harder time working with PHP.INI.

"Christoph Grottolo" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Rad Craig wrote:
> > Yes, I restart my WebServer (IIS 5) each time.
> >
> > Yes, I am editing the .ini file the phpinfo() reports it is using.
> >
> >>> I have been trying to get my email working.  I have made some
> >>> changes in the php.ini file in the Windoze directory, but when I
> >>> run phpinfo() the changes I make aren't changing on what it prints
> >>> out.
> >>>
> >>> I have logging turned on in my php.ini file, but phpinfo() says
> >> it's turned
> >>> off.
>
> So the only  possibility is the refresh settings in your browser. Refresh
> the page where you call phpinfo() by hitting +F5.
>
> If you change the ini file php uses (double check if it's the one you're
> editing, notepad loves saving the file as php.ini.txt), the changes take
are
> reflected when you restart the webserver. There is no possilility of a php
> fault, don't search there.
>
> Christoph
>
>



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




[PHP] Re: php.ini - changes aren't taking?

2003-01-06 Thread Scott Fletcher
Yep!  I changed the working email address on my php.ini to a different email
address, then stopped, started the IIS and test send myself an email.  It
doesn't go to the new email address and it stuck to the old email address.
It is a IIS problem, not php.ini problem because it's not updating itself.

Thanks,
 Scott F.
"Rad Craig" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have been trying to get my email working.  I have made some changes in
the
> php.ini file in the Windoze directory, but when I run phpinfo() the
changes
> I make aren't changing on what it prints out.
>
> I have logging turned on in my php.ini file, but phpinfo() says it's
turned
> off.
>
> Any ideas?
> 
> Rad Craig
>
>



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




[PHP] Fw: Session ID changes

2003-01-06 Thread Scott Fletcher


"[-^-!-%-" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>.
..
> 
> Hello all,
> 
> I need some clarification. To my understanding, each visit to php site
> creates a UNIQUE Session ID (SID). And, that ID stays constants until the
> browser is shutdown, or the session is specifically destroyed.
> Is this correct? If not, then please advise.
> 
> I'm trying to develop a cookie-less, persistent, shopping cart, which
> saves  the  cart details, in a database. I need to associate each order
> (cart item) to the current session id. However, the session ID number,
> seems to change, everytime the page is reloaded. Is this how it works?
> Am i missing something?
> 
> Please advise.
> 
> Thanks.
> 
> -john
> 
> 

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




[PHP] Far out!!!! More IIS problems.....

2003-01-06 Thread Scott Fletcher
I tried various methods on IIS after configuring hte PHP.INI.  Such as
shutting down IIS, restarting IIS and rebooting hte machine.  Here's one
latest addition that I found to be very far out!!   What I did was I
renamed the php.ini to php1.ini and goes throught the procedures.  Guess
what the website still is the same.  So, I renamed the php.ini back and make
some changes in php.ini.  Still the same result.  I'm still working on it.



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




[PHP] Re: session_start() in php.ini does not work on Microsoft IIS

2003-01-06 Thread Scott Fletcher
Actually, the problem is not the session_start() or hte php.ini.  For some
reason, IIS had started to forget that this php.ini is there.  So, any
changes to the php.ini I made does not affect the website after stopping,
starting and rebooting IIS.


"Christoph Grottolo" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Scott Fletcher wrote:
> >  > $salt="C4155DDAF13A529594FB7C2541F4D4C7";
> > session_start($salt);
> >>
> >
> > This is the error messages
> >
> > --clip--
> > Warning: open(/tmp\sess_C4155DDAF13A529594FB7C2541F4D4C7, O_RDWR)
> > failed: m (2) in D:\DealPack\...  on line 24
> >
> > Warning: open(/tmp\sess_C4155DDAF13A529594FB7C2541F4D4C7, O_RDWR)
> > failed: m (2) in Unknown on line 0
> >
> > Warning: Failed to write session data (files). Please verify that the
> > current setting of session.save_path is correct (/tmp) in Unknown on
> > line 0
> > --clip--
>
> You must set session.save_path to a valid windows path (i.e. "c:\temp" or
> "c:\sessions" AND the directory must already exist.
>
> Christoph
>
>



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




Re: [PHP] Far out!!!! More IIS problems.....

2003-01-07 Thread Scott Fletcher
I only have one php.ini on the machine and the filepath point to this one.

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> phpinfo will tell you which php.ini is used
>
> Scott Fletcher wrote:
>
> >I tried various methods on IIS after configuring hte PHP.INI.  Such as
> >shutting down IIS, restarting IIS and rebooting hte machine.  Here's one
> >latest addition that I found to be very far out!!   What I did was I
> >renamed the php.ini to php1.ini and goes throught the procedures.  Guess
> >what the website still is the same.  So, I renamed the php.ini back and
make
> >some changes in php.ini.  Still the same result.  I'm still working on
it.
> >
> >
> >
> >
> >
>



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




[PHP] Found a solution to the php.ini problem on IIS.....

2003-01-07 Thread Scott Fletcher
Hi Fella!

I found the problem and fixed it.  I only have one php.ini which is
found under 'c:\winnt\'.  What happen was that a couple of months ago,
someone in my company without my knowledge had made a backup copy of php.ini
and put it into hte D:\ drive.  So, IIS for some reason didn't go to
c:\winnt\ directory and jumped from c: drive to d: drive and use the backup
php.ini.  I fixed the problem by renaming hte file, from php.ini to
php.ini_safe.  This then cause the IIS to revert back to the php.ini in
c:\winnt.

Hope this knowledge will help everyone one day.  The weird thing is that
when I use phpinfo().  It didnt show any file path.  It just said the
filepath is 'php.ini', no 'c:\winnt\php.ini' at all.  It just said 'php.ini'
before I renamed the file.  After renaming the file, it still say 'php.ini'
as if nothing had changed.

Take care,
 Scott



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




Re: [PHP] Far out!!!! More IIS problems.....

2003-01-07 Thread Scott Fletcher
Hi Fella!

I found the problem and fixed it.  I only have one php.ini which is
found under 'c:\winnt\'.  What happen was that a couple of months ago,
someone in my company without my knowledge had made a backup copy of php.ini
and put it into hte D:\ drive.  So, IIS for some reason didn't go to
c:\winnt\ directory and jumped from c: drive to d: drive and use the backup
php.ini.  I fixed the problem by renaming hte file, from php.ini to
php.ini_safe.  This then cause the IIS to revert back to the php.ini in
c:\winnt.

Hope this knowledge will help everyone one day.  The weird thing is that
when I use phpinfo().  It didnt show any file path.  It just said the
filepath is 'php.ini', no 'c:\winnt\php.ini' at all.  It just said 'php.ini'
before I renamed the file.  After renaming the file, it still say 'php.ini'
as if nothing had changed.

Take care,
 Scott

"Brian McGarvie" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> php (.exe or .dll) will look for a php.ini in both, c:\(windows_dir) and
> c:\php\ (I am not sure what location takes priority - I'd assume
> c:\(windows_dir)
>
> "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I only have one php.ini on the machine and the filepath point to this
one.
> >
> > "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > phpinfo will tell you which php.ini is used
> > >
> > > Scott Fletcher wrote:
> > >
> > > >I tried various methods on IIS after configuring hte PHP.INI.  Such
as
> > > >shutting down IIS, restarting IIS and rebooting hte machine.  Here's
> one
> > > >latest addition that I found to be very far out!!   What I did
was
> I
> > > >renamed the php.ini to php1.ini and goes throught the procedures.
> Guess
> > > >what the website still is the same.  So, I renamed the php.ini back
and
> > make
> > > >some changes in php.ini.  Still the same result.  I'm still working
on
> > it.
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
> >
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.431 / Virus Database: 242 - Release Date: 17/12/02
>
>



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




[PHP] Re: session_start() in php.ini does not work on Microsoft IIS

2003-01-07 Thread Scott Fletcher
Hi Fella!

I found the problem and fixed it.  I only have one php.ini which is
found under 'c:\winnt\'.  What happen was that a couple of months ago,
someone in my company without my knowledge had made a backup copy of php.ini
and put it into hte D:\ drive.  So, IIS for some reason didn't go to
c:\winnt\ directory and jumped from c: drive to d: drive and use the backup
php.ini.  I fixed the problem by renaming hte file, from php.ini to
php.ini_safe.  This then cause the IIS to revert back to the php.ini in
c:\winnt.

Hope this knowledge will help everyone one day.  The weird thing is that
when I use phpinfo().  It didnt show any file path.  It just said the
filepath is 'php.ini', no 'c:\winnt\php.ini' at all.  It just said 'php.ini'
before I renamed the file.  After renaming the file, it still say 'php.ini'
as if nothing had changed.

Take care,
 Scott

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!
>
> It have been a while that I don't remember how did I jogged MS-IIS's
> memory or something.  Perhap a baseball bat will help.  I'm not here to
ask
> for help on writing script for session ID or stuffs like that.  I'm here
> asking for help in jogging IIS's memory with a baseball bat.
>
> When I use the PHP command, session_start and tested it out on the
> website.  I get an error messages saying as shown on the clipping down
> below  This is the script I use alone.
>
>  $salt="C4155DDAF13A529594FB7C2541F4D4C7";
> session_start($salt);
> ?>
>
> This is the error messages
>
> --clip--
> Warning: open(/tmp\sess_C4155DDAF13A529594FB7C2541F4D4C7, O_RDWR) failed:
m
> (2) in D:\DealPack\...  on line 24
>
> Warning: open(/tmp\sess_C4155DDAF13A529594FB7C2541F4D4C7, O_RDWR) failed:
m
> (2) in Unknown on line 0
>
> Warning: Failed to write session data (files). Please verify that the
> current setting of session.save_path is correct (/tmp) in Unknown on line
0
> --clip--
>
> I can see the problem with "/tmp" so I looked through the PHP.INI and
> modify the script.  The line of code here goes from  to .
>
> --clip--
> From ...
> session.save_path = /tmp; argument passed to save_handler
> session.cookie_path   = /   ; the path the cookie is valid for
>
> To
> session.save_path = \tmp; argument passed to save_handler
> session.cookie_path   = \   ; the path the cookie is valid for
> --clip--
>
> I even created the folder 'tmp' on the c:\ drive.  I stopped the
website
> then I stopped the IIS.  I then start the IIS then start the website.
When
> accessing this script on the website, I still get the same error.  The
> problem here is that IIS does not actually refreshed or restarted  I
> even rebooted the machine.
>
> I can use your help.  Thanks!
>
> Scott F.
>
>



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




[PHP] Re: php.ini - changes aren't taking?

2003-01-07 Thread Scott Fletcher
Hi Fella!

I found the problem and fixed it.  I only have one php.ini which is
found under 'c:\winnt\'.  What happen was that a couple of months ago,
someone in my company without my knowledge had made a backup copy of php.ini
and put it into hte D:\ drive.  So, IIS for some reason didn't go to
c:\winnt\ directory and jumped from c: drive to d: drive and use the backup
php.ini.  I fixed the problem by renaming hte file, from php.ini to
php.ini_safe.  This then cause the IIS to revert back to the php.ini in
c:\winnt.

Hope this knowledge will help everyone one day.  The weird thing is that
when I use phpinfo().  It didnt show any file path.  It just said the
filepath is 'php.ini', no 'c:\winnt\php.ini' at all.  It just said 'php.ini'
before I renamed the file.  After renaming the file, it still say 'php.ini'
as if nothing had changed.

Take care,
 Scott

P.S. Rad Craig, try to find it there is duplicate php.ini somewhere and
renamed it to something like 'php.ini_safe'.

"Rad Craig" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have been trying to get my email working.  I have made some changes in
the
> php.ini file in the Windoze directory, but when I run phpinfo() the
changes
> I make aren't changing on what it prints out.
>
> I have logging turned on in my php.ini file, but phpinfo() says it's
turned
> off.
>
> Any ideas?
> 
> Rad Craig
>
>



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




Re: [PHP] Re: fletcher's checksum

2003-01-10 Thread Scott Fletcher
For a moment, I thought you were referring to me when you said "Fletcher"
since it's my name also.  :-)

FletchSOD
"Mike Ford" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > -Original Message-
> > From: Dave Gervais [mailto:[EMAIL PROTECTED]]
> > Sent: 09 January 2003 21:36
> >
> > Here is the C code. There is a decode function, but I don't
> > need it in
> > PHP because I have a C program listening to serial port on
> > the other end
> > that will validate the checksum.
> >
> >
> > /*
> > * operator fletcher_encode
> > */
> > fletcher_encode( buffer, count )
> > unsigned char* buffer;
> > long count;
> > {
> >   int i;
> >   unsigned char c0 = 0;
> >   unsigned char c1 = 0;
> >   * ( buffer + count - 1 ) = 0;
> >   * ( buffer + count - 2 ) = 0;
> >   for( i = 0; i < count; i++)
> >   {
> >  c0 = c0 + * ( buffer + i );
> >  c1 =c1 +c0;
> >   }
> >   * ( buffer + count - 2 ) = c0 - c1;
> >   * ( buffer + count - 1 ) = c1 - 2*c0;
> > }
> >
> >
> > My problem with PHP was with the unsigned char.
>
> Well, as I guess that would effectively be an integer in the range 0-255,
I'd just treat it as an integer and reduce it modulo 256 in places where it
might overflow that value.
>
> Exactly how this translates into your PHP code depends on how you're
translating the rest of the routine, and especially what you turn buffer
into, but the loop might go something like:
>
>for ($i=0; $i<$count; $i++):
>   $c0 = ($c0+$buffer[i])%256;
>   $c1 = ($c1+$c0)%256;
>endfor;
>
> You could also do the modulo 256 reduction by doing a bitwise and with
0xff (or 0377, or 255), of course -- this is likely to be more efficient,
and may, depending on your point of view, be more obvious as to what's going
on.  Then your loop might look like this:
>
>for ($i=0; $i<$count; $i++):
>   $c0 = ($c0+$buffer[i])&0xff;
>   $c1 = ($c1+$c0)&0xff;
>endfor;
>
> Hope this is helpful and sets you off on the right track.
>
> Cheers!
>
> Mike
>
> -
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211



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




[PHP] Encrypt in Javascript and Decrypt in PHP????

2003-01-10 Thread Scott Fletcher
Here's the challenging project I'm doing.  I'm trying to encrypt the user_id
and password in javascript and submit it.  Then have PHP to decrypt the
user_id and password.  The only problem I have is I don't know what
javascript function or javascript algorithm that can also work the same way
as the php function or php algorithm.  Anybody know?

Thanks,
 FletchSOD



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




[PHP] Re: PHP and DB2

2003-01-10 Thread Scott Fletcher
Yes, it can.  Use the odbc_connect.   Here's what I use that work...

--clip--
   $database = "TEST_DB";
   $user = "db2inst1";
   $pass = "ibmdb2";

   $cid = @odbc_connect($database,$user,$pass) or die("Unable to Connect to
Database !!!") ;
   if ($cid == 0){
exit("Unable to Connect to Database
!!!");
   }
--clip--

"Jack Schroeder" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Can PHP connect to IMB DB2 dbms running on an AIX Unix server?
>
> Jack
>



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




[PHP] Re: PHP and DB2

2003-01-10 Thread Scott Fletcher
Be care of the PHP bug on one of hte php function, odbc_fetch_row().  This
function does not very well start at 0 when the odbc_fetch_row() start
automatically, so you'll have to at the counter inside the function.  Why is
that, I do not know.  Here's the example of the workaround I did.
--clip--

$cid = odbc_connect('blah blah blah');

$ask7 = "SELECT * FROM INQUIRIES WHERE USER_ID = '38SCK3'";

$R7 = odbc_exec($cid,$ask7);

$result = odbc_result($R7,1);

echo "Result or No Result??? --> ".odbc_fetch_row($R7);

$bug_workaround=0;

while (odbc_fetch_row($R7,++$bug_workaround))

{

odbc_fetch_into($R7,$inquiry,$inq_c);

echo $inquiry[0], $inquiry[1];

}

--clip--

"Jack Schroeder" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Can PHP connect to IMB DB2 dbms running on an AIX Unix server?
>
> Jack
>



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




[PHP] Re: PHP and DB2

2003-01-10 Thread Scott Fletcher
G...  I meant to say "Be careful of the PHP bug".

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Be care of the PHP bug on one of hte php function, odbc_fetch_row().  This
> function does not very well start at 0 when the odbc_fetch_row() start
> automatically, so you'll have to at the counter inside the function.  Why
is
> that, I do not know.  Here's the example of the workaround I did.
> --clip--
>
> $cid = odbc_connect('blah blah blah');
>
> $ask7 = "SELECT * FROM INQUIRIES WHERE USER_ID = '38SCK3'";
>
> $R7 = odbc_exec($cid,$ask7);
>
> $result = odbc_result($R7,1);
>
> echo "Result or No Result??? --> ".odbc_fetch_row($R7);
>
> $bug_workaround=0;
>
> while (odbc_fetch_row($R7,++$bug_workaround))
>
> {
>
> odbc_fetch_into($R7,$inquiry,$inq_c);
>
> echo $inquiry[0], $inquiry[1];
>
> }
>
> --clip--
>
> "Jack Schroeder" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Can PHP connect to IMB DB2 dbms running on an AIX Unix server?
> >
> > Jack
> >
>
>



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




Re: [PHP] session_destroy problem

2003-01-10 Thread Scott Fletcher
Session Destroy will work if you provide the user a way to log out of the
website.  But if the user closed the browser then that's it.  Session
Destory can't be used because the browser is a client side and Session
Destroy is a server side.  So, once the browser close, it doesn't contact
the server before closing.

You're only option is to clean up the session data from the webserver as I
usually have done.  I also use the database to find out about the session id
and the timestamp it was updated.  That way, I will know which session not
to delete if it is active.

"Ken Nagorski" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there,
>
> So it is the browsers problem. I tested what you said and Mozilla acts as
> you stated and IE does as well. I guess my question is. Is there no way to
> close clear out the session when the user logs out?
>
> The way I set things up the class that I wrote just gets the current
> sessionid and does a select from the database to see if it has been
logged.
> The problem this creates is that someone could sit down and reopen a
> browser and have access to the site as if they where logged because the
> session is not gone.
>
> Hmm - Like a said I have never used sessions before so I am learning about
> them. Thank you for your input...
>
> Ken
>
>
> > What browser are you running?  I find that IE drops the session when
> > you close the browser window actively working the site.  On Mozilla I
> > have to close every instance of Mozilla regardless of the site before
> > it drops the session.  Pretty aggravating so I'm going to have to start
> > working on a method based on responses to your post.
> >
> > Larry S. Brown
> > Dimension Networks, Inc.
> > (727) 723-8388
> >
> > -Original Message-
> > From: Ken Nagorski [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, January 09, 2003 1:35 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] session_destroy problem
> >
> > Hi there,
> >
> > I have written a class that manages sessions. I have never used
> > sessions before so all this is new to me. Everything works fine as far
> > as starting the session and logging in however when I call sessoin
> > destroy it doesn't seem to work the function returns 1 as it should if
> > all goes well however if I go to another page and do some other
> > browsing even if I close the browser the session still hangs around. Is
> > there something I don't know about sessions? I have read the
> > documentation on the session_destroy function, I don't think that I am
> > missing anything...
> >
> > Anyone have any suggestions? I am totally confused.
> >
> > Thanks
> > Ken
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



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




[PHP] Re: session problem

2003-01-10 Thread Scott Fletcher
I don't normally have problem with using session functions on the Win2000
Server using IIS 5.  It work pretty well.  You may will want to narrow down
the problem and find out if it is a session problem only or if it is
something else.  I don't use some of the IIS patches like the IIS Lockdown
as an example because some of those patches prevent hte PHP function from
working.  IIS is so filled with holes that I had to use hte firewall.

"Supra" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I got serious problem I need to solve a.s.a.p.
> Well, I've developed a database application with PHP and MySql, I used
> sessions.
> While developing I used my own computer as a web server - Windows 2000
Pro,
> IIS 5, PHP 4.2.3 via ISAPI. And all my code was tested successfully while
my
> computer is the server and the client. Now after moving the sources to the
> server (Windows 2000 Advanced Server) and exporting the MySql database to
> the server, the application fail. While debugging I got to a firm
conclusion
> that the sessions doesn't work well. I copied the php.ini to the system
root
> on the server and it still doesn't work.
>
> Please advice me what to do in order to make the application work on the
> server.
>
> Thanks I advance,
>
> Supra
>
>



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




Re: [PHP] Encrypt in Javascript and Decrypt in PHP????

2003-01-10 Thread Scott Fletcher
I'll look into this and try it out.  The only thing that is important to me
is that the password get encrypted before transmitting across the internet.
I'm not worry if the JS is disabled because if it is then the login will
never be authenticated.  I'll keep on exploring for way to increase
security.   Thanks for the response.


"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The way you want it can be securely done only using asymetric
> encryption, which is not available to JS.
> Do you really need to encrypt user_id? You could use md5 to hash
> password with some random string,
> store the hash in a hidden field and erase password. On server side if
> the hidden field is set compare it
> whith a hash you create with password and the random string (keep the
> string as a session variable, don't
> pass it as a form hidden field). If the hidden hash field is not set,
> use normal procedure.
>
> code:
>
> server:
> $_SESSION[random]=create_random_string();
>
> client:
> function onsubmit(form)  {
> form.hiddenfield.value= md5( md5(form.password.value) +
> form.randomstring.value);
> form.password.value='';
> return true;
> }
>
> server:
> if($_POST[hiddenfield]) {
>   $res=mysql_query("SELECT * FROM users WHERE user='$_POST[user]'
> AND
> '$_POST[hiddenfield]'=MD5(CONCAT(password,$_SESSION[random]))");
>
> } else {
> $res=mysql_query("SELECT * FROM users WHERE user='$_POST[user]'
> AND password=MD5($_POST[password]");
> }
>
> this example assumes passwords are stored as md5 hashes in the database
>
> Scott Fletcher wrote:
>
> >Here's the challenging project I'm doing.  I'm trying to encrypt the
user_id
> >and password in javascript and submit it.  Then have PHP to decrypt the
> >user_id and password.  The only problem I have is I don't know what
> >javascript function or javascript algorithm that can also work the same
way
> >as the php function or php algorithm.  Anybody know?
> >
> >Thanks,
> > FletchSOD
> >
> >
> >
> >
> >
>



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




Re: [PHP] session_destroy problem

2003-01-10 Thread Scott Fletcher
That would work only if the webserver IP address is '127.0.0.1' (local
machine), but not any other IP address.  Because of the ACK synchrious
communication that get interrupted as result of the browser closing.

"Larry Brown" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Javascript has a function for performing actions on window close.  You
could
> have a submit action on the page that is sent when the window closes.
I've
> not used it yet but it should work I would think.
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
> -Original Message-
> From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 10, 2003 10:58 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] session_destroy problem
>
> Session Destroy will work if you provide the user a way to log out of the
> website.  But if the user closed the browser then that's it.  Session
> Destory can't be used because the browser is a client side and Session
> Destroy is a server side.  So, once the browser close, it doesn't contact
> the server before closing.
>
> You're only option is to clean up the session data from the webserver as I
> usually have done.  I also use the database to find out about the session
id
> and the timestamp it was updated.  That way, I will know which session not
> to delete if it is active.
>
> "Ken Nagorski" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi there,
> >
> > So it is the browsers problem. I tested what you said and Mozilla acts
as
> > you stated and IE does as well. I guess my question is. Is there no way
to
> > close clear out the session when the user logs out?
> >
> > The way I set things up the class that I wrote just gets the current
> > sessionid and does a select from the database to see if it has been
> logged.
> > The problem this creates is that someone could sit down and reopen a
> > browser and have access to the site as if they where logged because the
> > session is not gone.
> >
> > Hmm - Like a said I have never used sessions before so I am learning
about
> > them. Thank you for your input...
> >
> > Ken
> >
> >
> > > What browser are you running?  I find that IE drops the session when
> > > you close the browser window actively working the site.  On Mozilla I
> > > have to close every instance of Mozilla regardless of the site before
> > > it drops the session.  Pretty aggravating so I'm going to have to
start
> > > working on a method based on responses to your post.
> > >
> > > Larry S. Brown
> > > Dimension Networks, Inc.
> > > (727) 723-8388
> > >
> > > -Original Message-
> > > From: Ken Nagorski [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, January 09, 2003 1:35 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] session_destroy problem
> > >
> > > Hi there,
> > >
> > > I have written a class that manages sessions. I have never used
> > > sessions before so all this is new to me. Everything works fine as far
> > > as starting the session and logging in however when I call sessoin
> > > destroy it doesn't seem to work the function returns 1 as it should if
> > > all goes well however if I go to another page and do some other
> > > browsing even if I close the browser the session still hangs around.
Is
> > > there something I don't know about sessions? I have read the
> > > documentation on the session_destroy function, I don't think that I am
> > > missing anything...
> > >
> > > Anyone have any suggestions? I am totally confused.
> > >
> > > Thanks
> > > Ken
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] session_destroy problem

2003-01-10 Thread Scott Fletcher
Yes, the JavaScript code can run before the browser is closed but it would
not be finish running because the browser closing had been executed.
Someone had tried it before and struggled with it.   But that is a good
advice, thanks for jumping in.

"Tamas Arpad" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Friday 10 January 2003 17:39, Scott Fletcher wrote:
> > Javascript has a function for performing actions on window close
> That would work only if the webserver IP address is '127.0.0.1' (local
> machine), but not any other IP address.  Because of the ACK synchrious
> communication that get interrupted as result of the browser closing.
I think the javascrit code runs before the browser is closed, other way what
would run it?

Arpi



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




Re: [PHP] session_destroy problem

2003-01-10 Thread Scott Fletcher
You meant the tab browers.  Like 2 tabs...  I haven't tried it but now that
you mentioned it, I'm going to have to look at it soon.  I do noticed one
thing, the status bar, if it have comments, it will show up on other tabs
even though it is a completely a different website.  I get the impression
that it doesn't seem to be as independent of each other, know what I meant?

What I did with the php script is to expire the session first, at the
beginning of hte webpage before the login page showed up and before
attempting to create a session.  Maybe this will help a little bit.

"Larry Brown" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Question...Do you know if Mozilla runs a browser instance that might
handle
> the process after one of the browser windows is closed?  Right now the
> situation is that IE closes the session when the window that opened it
> closes.  I have a site that is authenticated and then runs sessions on the
> authenticated user.  If you close the browser window and open another one,
> you are prompted for the login and password and have your new
> identity/session.  On Mozilla if I close the window actively on the site
and
> have other windows up on other sites I can open another Mozilla instance
and
> return to the site and it still has my session open and identity.  I have
to
> close every Mozilla instance for the session to close.  If Mozilla is run
by
> one central process I would think maybe it could do this onwindowclose
> behaviour?  Maybe a good question for the Javascript list but since it
> sounds like you guys have seen this tried before maybe you already know.
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
> -Original Message-
> From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 10, 2003 12:02 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] session_destroy problem
>
> Yes, the JavaScript code can run before the browser is closed but it would
> not be finish running because the browser closing had been executed.
> Someone had tried it before and struggled with it.   But that is a good
> advice, thanks for jumping in.
>
> "Tamas Arpad" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Friday 10 January 2003 17:39, Scott Fletcher wrote:
> > > Javascript has a function for performing actions on window close
> > That would work only if the webserver IP address is '127.0.0.1' (local
> > machine), but not any other IP address.  Because of the ACK synchrious
> > communication that get interrupted as result of the browser closing.
> I think the javascrit code runs before the browser is closed, other way
what
> would run it?
>
> Arpi
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] Encrypt in Javascript and Decrypt in PHP????

2003-01-10 Thread Scott Fletcher
Hey!  There's no MD5 in Javascript which is why I post hte question in the
first place.  Now I lost 5 hours of my time working on writing this script.
You're going to have to be careful because you had to make sure there is MD5
features in Javascript before posting a reply.

I found a workaround to it.  You have to manually create a MD5 algorithm in
Javascript.  I did the google search and got this, it is at
http://www-adele.imag.fr/~donsez/cours/exemplescourstechnoweb/js_securehash/
.  Pretty cool, isn't it!

Take care,
 Scott
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'll look into this and try it out.  The only thing that is important to
me
> is that the password get encrypted before transmitting across the
internet.
> I'm not worry if the JS is disabled because if it is then the login will
> never be authenticated.  I'll keep on exploring for way to increase
> security.   Thanks for the response.
>
>
> "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > The way you want it can be securely done only using asymetric
> > encryption, which is not available to JS.
> > Do you really need to encrypt user_id? You could use md5 to hash
> > password with some random string,
> > store the hash in a hidden field and erase password. On server side if
> > the hidden field is set compare it
> > whith a hash you create with password and the random string (keep the
> > string as a session variable, don't
> > pass it as a form hidden field). If the hidden hash field is not set,
> > use normal procedure.
> >
> > code:
> >
> > server:
> > $_SESSION[random]=create_random_string();
> >
> > client:
> > function onsubmit(form)  {
> > form.hiddenfield.value= md5( md5(form.password.value) +
> > form.randomstring.value);
> > form.password.value='';
> > return true;
> > }
> >
> > server:
> > if($_POST[hiddenfield]) {
> >   $res=mysql_query("SELECT * FROM users WHERE user='$_POST[user]'
> > AND
> > '$_POST[hiddenfield]'=MD5(CONCAT(password,$_SESSION[random]))");
> >
> > } else {
> > $res=mysql_query("SELECT * FROM users WHERE user='$_POST[user]'
> > AND password=MD5($_POST[password]");
> > }
> >
> > this example assumes passwords are stored as md5 hashes in the database
> >
> > Scott Fletcher wrote:
> >
> > >Here's the challenging project I'm doing.  I'm trying to encrypt the
> user_id
> > >and password in javascript and submit it.  Then have PHP to decrypt the
> > >user_id and password.  The only problem I have is I don't know what
> > >javascript function or javascript algorithm that can also work the same
> way
> > >as the php function or php algorithm.  Anybody know?
> > >
> > >Thanks,
> > > FletchSOD
> > >
> > >
> > >
> > >
> > >
> >
>
>



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




Re: [PHP] Encrypt in Javascript and Decrypt in PHP????

2003-01-10 Thread Scott Fletcher
It would be nice if I can use the SSL but I don't want to spend a lot of
time on it on IIS.  Beside part of that website is only for internal part
for my company.  Beside the end user wouldn't know where hte login link is
anyway.

"Brent Baisley" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> If you want to increase security then you really should use a secure
> connection, then everything is encrypted as well as other security
> measures. Even if you do encrypt the password you also need to establish
> and track a session to make sure it's the same computer you are
> communicating with, guarding against a hijacked connection.
> Besides, using SSL is a heck of a lot easier. Just get a certificate for
> the server and slap https:// on the front of the URL. I'll admit I
> summarized the process a bit.
>
>
> On Friday, January 10, 2003, at 11:12 AM, Scott Fletcher wrote:
>
> > I'll look into this and try it out.  The only thing that is important
> > to me
> > is that the password get encrypted before transmitting across the
> > internet.
> > I'm not worry if the JS is disabled because if it is then the login will
> > never be authenticated.  I'll keep on exploring for way to increase
> > security.
> --
> Brent Baisley
> Systems Architect
> Landover Associates, Inc.
> Search & Advisory Services for Advanced Technology Environments
> p: 212.759.6400/800.759.0577
>



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




Re: [PHP] Encrypt in Javascript and Decrypt in PHP????

2003-01-10 Thread Scott Fletcher
Here's the message I got from someone.  It is pretty cool!

--clip--
if U want MD5 for Java Script try down load PHPLib and search in this
package. and you will find MD5 script with Java Script.

--clip--

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Really, pretty cool. I don't know why I was so sure there was a md5
> function in javascript (propably because I thought is was everywhere -
> untill now). Thanks for the link.
>
> Scott Fletcher wrote:
>
> >Hey!  There's no MD5 in Javascript which is why I post hte question in
the
> >first place.  Now I lost 5 hours of my time working on writing this
script.
> >You're going to have to be careful because you had to make sure there is
MD5
> >features in Javascript before posting a reply.
> >
> >I found a workaround to it.  You have to manually create a MD5 algorithm
in
> >Javascript.  I did the google search and got this, it is at
>
>http://www-adele.imag.fr/~donsez/cours/exemplescourstechnoweb/js_securehash
/
> >.  Pretty cool, isn't it!
> >
> >Take care,
> > Scott
> >"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> >
> >>I'll look into this and try it out.  The only thing that is important to
> >>
> >>
> >me
> >
> >
> >>is that the password get encrypted before transmitting across the
> >>
> >>
> >internet.
> >
> >
> >>I'm not worry if the JS is disabled because if it is then the login will
> >>never be authenticated.  I'll keep on exploring for way to increase
> >>security.   Thanks for the response.
> >>
> >>
> >>"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
> >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >>
> >>
> >>>The way you want it can be securely done only using asymetric
> >>>encryption, which is not available to JS.
> >>>Do you really need to encrypt user_id? You could use md5 to hash
> >>>password with some random string,
> >>>store the hash in a hidden field and erase password. On server side if
> >>>the hidden field is set compare it
> >>>whith a hash you create with password and the random string (keep the
> >>>string as a session variable, don't
> >>>pass it as a form hidden field). If the hidden hash field is not set,
> >>>use normal procedure.
> >>>
> >>>code:
> >>>
> >>>server:
> >>>$_SESSION[random]=create_random_string();
> >>>
> >>>client:
> >>>function onsubmit(form)  {
> >>>form.hiddenfield.value= md5( md5(form.password.value) +
> >>>form.randomstring.value);
> >>>form.password.value='';
> >>>return true;
> >>>}
> >>>
> >>>server:
> >>>if($_POST[hiddenfield]) {
> >>>  $res=mysql_query("SELECT * FROM users WHERE user='$_POST[user]'
> >>>AND
> >>>'$_POST[hiddenfield]'=MD5(CONCAT(password,$_SESSION[random]))");
> >>>
> >>>} else {
> >>>$res=mysql_query("SELECT * FROM users WHERE user='$_POST[user]'
> >>>AND password=MD5($_POST[password]");
> >>>}
> >>>
> >>>this example assumes passwords are stored as md5 hashes in the database
> >>>
> >>>Scott Fletcher wrote:
> >>>
> >>>
> >>>
> >>>>Here's the challenging project I'm doing.  I'm trying to encrypt the
> >>>>
> >>>>
> >>user_id
> >>
> >>
> >>>>and password in javascript and submit it.  Then have PHP to decrypt
the
> >>>>user_id and password.  The only problem I have is I don't know what
> >>>>javascript function or javascript algorithm that can also work the
same
> >>>>
> >>>>
> >>way
> >>
> >>
> >>>>as the php function or php algorithm.  Anybody know?
> >>>>
> >>>>Thanks,
> >>>>FletchSOD
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>
> >>
> >
> >
> >
> >
> >
>



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




Re: [PHP] Encrypt in Javascript and Decrypt in PHP????

2003-01-10 Thread Scott Fletcher
I got the script working so, I'm posting a script that work for me.  If you
wanna try it out or use it then you'll need to get the MD5.js that come with
the libPHP.  Just download the libPHP and pull out only one file, MD5.js and
then junk the libPHP.

I found one thing interesting about this code is that whether the login is
successfull or failed.  The password will not be shown, neither is the
encrypted password.  That is a good thing.

I had to create a Session ID also.

You'll have to forgive me for include some script for PHP 4.0.6 and PHP
4.2.3 since I'm stuck with one of the employee who doesn't have time to
upgrade one of the website.

--clip--
http://www.whatever.com/admin/main_index.php?$SID";);
} else {
   $login_action = "Failed!!";
}
  } else {
//Creation of the Session ID.
$salt = strtoupper(md5(uniqid(rand(;

session_id($salt);

session_start();

//PHP 4.0.x Only ==
session_register('admin_detail');
$admin_detail['random_number'] = rand();
//=
//PHP 4.2.x Only  ===
//$_SESSION['random_number'] = rand();
//=
  }
?>




function encryptPass(formObj) {
formObj.HiddenField.value =
MD5(MD5(formObj.pass.value)+formObj.RandomString.value);
formObj.pass.value="";
return true;
}



"; ?>
  
   

  
 Use the Login to access the Administration Site.


 
  
   

 
  
   Username:
   
   
   Password:
   
   
  
 
 
  
     
   
   ";
 //=
 //PHP 4.2.3 Only 
 //echo "";
 //=
 echo "";
  ?>
  
 

   
  
 
    
   
   

 The Login Attempt had Failed!!";
   }
 ?>

   
  
 
--clip--

Enjoy!
 FletchSOD

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Here's the message I got from someone.  It is pretty cool!
>
> --clip--
> if U want MD5 for Java Script try down load PHPLib and search in this
> package. and you will find MD5 script with Java Script.
>
> --clip--
>



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




[PHP] Here's the sample code for encrypting the login password....

2003-01-10 Thread Scott Fletcher
Here's the sample script that will let the user login then have Javascript
encrypt the password and carry it over to PHP and have PHP encrypt the
password and match the Javascript encrypted password.  This script is pretty
effective without the SSL.

I got the script working so, I'm posting a script that work for me.  If you
wanna try it out or use it then you'll need to get the MD5.js that come with
the libPHP.  Just download the libPHP and pull out only one file, MD5.js and
then junk the libPHP.

I found one thing interesting about this code is that whether the login is
successfull or failed.  The password will not be shown, neither is the
encrypted password.  That is a good thing.

I had to create a Session ID also.

You'll have to forgive me for include some script for PHP 4.0.6 and PHP
4.2.3 since I'm stuck with one of the employee who doesn't have time to
upgrade one of the website.

--clip--
http://www.whatever.com/admin/main_index.php?$SID";);
} else {
   $login_action = "Failed!!";
}
  } else {
//Creation of the Session ID.
$salt = strtoupper(md5(uniqid(rand(;

session_id($salt);

session_start();

//PHP 4.0.x Only ==
session_register('admin_detail');
$admin_detail['random_number'] = rand();
//=
//PHP 4.2.x Only  ===
//$_SESSION['random_number'] = rand();
//=
  }
?>




function encryptPass(formObj) {
formObj.HiddenField.value =
MD5(MD5(formObj.pass.value)+formObj.RandomString.value);
formObj.pass.value="";
return true;
}



"; ?>
  
   

  
 Use the Login to access the Administration Site.


 
  
   

 
  
   Username:
   
   
   Password:
   
   
  
 
 
  
     
   
   ";
 //=
 //PHP 4.2.3 Only 
 //echo "";
 //=
 echo "";
  ?>
  
 

   
  
 

   
   

 The Login Attempt had Failed!!";
   }
 ?>

   
  
 
--clip--

Enjoy!
 FletchSOD



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




Re: [PHP] session_destroy problem

2003-01-13 Thread Scott Fletcher
Let us know how it goes...  The unload event had been tried also.  The
javascript have been running for a while but the network communication is a
bit tricky, it haven't worked well.


"VĂ­Ă£ ĂƒĂ°Ă£ " <[EMAIL PROTECTED]> wrote in message
004701c2b90d$5de0c440$0700a8c0@sp">news:004701c2b90d$5de0c440$0700a8c0@sp...
> > Yes, the JavaScript code can run before the browser is closed but it
would
> > not be finish running because the browser closing had been executed.
> > Someone had tried it before and struggled with it.   But that is a good
> > advice, thanks for jumping in.
> I really doubt that browsers doesn't run the code that is in unload event
of
> the page because the window is closed. That would be a very bad thing.
Isn't
> it what the unload event is for? I mean to run code when the page is
> unloaded, it doesn't matter if the window is being closed or the user is
> going to another page. I think the browser should finish all the opened
> window's unload code and only after that close the application really.
> I made a quick test for it:
> 
> 
> 
> function wait(msec){
>  var enter_date = new Date();
>  var enter_time = enter_date.getTime();
>
>  var leave_date = new Date();
>  var leave_time = leave_date.getTime();
>
>  while (enter_time + msec > leave_time)
>  {
>   leave_date = new Date();
>   leave_time = leave_date.getTime();
>  }
>  alert('unload test');
> }
> 
> 
>
> 
>  unload test
> 
> 
> It works fine for me in ie6 and mozila 0.9.6, it shows the alert message
> after about 5 seconds.
>
> Arpi
>
>
>



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




Re: [PHP] Encrypt in Javascript and Decrypt in PHP????

2003-01-13 Thread Scott Fletcher
Yea, the hacker would guess a random number in html & javascript but the
hacker have no way of putting it into php on the server-side.  So, we get
two different random number and a invalid match.

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This has been solved - the extra characters are stored in session,
> otherwise attacker can repeat it too. Password can be stored on
> the server using one way has - on the client the script hashes
> twice, first to get hashed password, then together with random
> string
>
> Gerald Timothy Quimpo wrote:
>
> >On Saturday 11 January 2003 12:12 am, Scott Fletcher wrote:
> >
> >
> >>The only thing that is important to me is that the password get
> >>encrypted before transmitting across the internet.
> >>
> >>
> >
> >from other posts further in the thread it looks like you aren't
> >ready to use https.  that's too bad.  that would really be the
> >right solution.
> >
> >but since you must hash, one problem with hashing is, it is still
> >necessary  to have the hash vary from one invocation to another.
> >otherwise, if the hash is the same every time the user logs in
> >(i.e., if all you do is take the password and run it through md5),
> >then anyone who can sniff the hash will be able to replay a login.
> >
> >unfortunately, if you want the hash to be different from one
> >invocation to the next, then the password cannot be stored
> >on the server as a one-way hash.  instead, it would be either
> >plaintext or encrypted on the server.  this way, when you
> >want to send the hash over the internet, instead of just hashing
> >the password, you can generate a few extra characters.  append
> >(or prepend) the characters to the password.  then hash the
> >whole thing.
> >
> >then, when you send the hash over, send the extra characters
> >too.  on the server side, you would then take the password from
> >the database (or wherever), decrypt it (if it's encrypted), append
> >or prepend the extra characters, hash the whole thing, and
> >compare the hashes.
> >
> >tiger
> >
> >
> >
>



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




Re: [PHP] session_destroy problem

2003-01-13 Thread Scott Fletcher
It's no problem.  We're all very interesting in finding out what can work.

Maybe I can help with one of this problem.  The Gecko browser does have the
option of blocking the opening of hte unrequest window which is maybe why
yours doesn't work in Mozilla.  Just wondeirng...


"Tamas Arpad" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Monday 13 January 2003 15:14, Scott Fletcher wrote:
> Let us know how it goes...  The unload event had been tried also.  The
> javascript have been running for a while but the network communication is
a
> bit tricky, it haven't worked well.
Sorry, maybe I missed or forgot the original problem. If I remember right
the
problem is that the session must be deleted if the visitor closes the
browser. I think it can be done with the method that "ugly sex" sites use
for
opening ads when their window is closed.
An example:

I know it's not a 100% reliable sollution, but in javascript what is that?
This way you can make a request that'll destroy the session and sends
javascript code that immediately closes the window.
It works for me in opera but not in mozilla :((
Maybe there's another sollution, the idea is to somehow send a a request
when
the onunload event happens (I'm sure you already knew this Scott). I tried
to
search in google for how to make http request but didn't find anything
really
useful in a few minutes, of course that doesn't mean that it can't work at
all.
Good luck with it Larry!
Arpi



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




Re: [PHP] session_destroy problem

2003-01-14 Thread Scott Fletcher
Me too.  I alway try to avoid javascript.  I have one workaround to the
problem that keep me from having a headache with the browser
incompatibilities.  Since I already have a table in the database that deal
with the session number, timestamp and user id.  All I have to do is to
detect the duplicate user id and check to see if if user is online for no
more than 15 minutes by checking the timestamp.  If more than 15 minutes
then I deleted the existing session id then delete the duplicate user.  When
all goes well, then I create a new session id and insert it into the
database along with the user id and a timestamp.  And I do the manual clean
up of the leftover session in the /tmp directory every few weeks.  Not what
I would like to have but there's nothing I can do about browser
incompatibilities and javascript issues.  If we're lucky, this would take 20
years or more for the problem to be fixed.

"Tamas Arpad" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Monday 13 January 2003 18:09, Scott Fletcher wrote:
> It's no problem.  We're all very interesting in finding out what can work.
>
> Maybe I can help with one of this problem.  The Gecko browser does have
the
> option of blocking the opening of hte unrequest window which is maybe why
> yours doesn't work in Mozilla.  Just wondeirng...
No, the setting called "Open unrequested windows" is turned on in my browser
(Mozilla 1.0.1), and all other settings on that page are also turned on, so
I
don't know why window.open call doesn't work in onunload event handler.
By the way it's not a problem for me :)) I don't know if it works for the
original poster.
I try to always avoid using javascript, I think the session expiration is
still a better way to force logging out a visitor who forgot to click on the
logout button.
Arpi



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




[PHP] emptying hte array??

2003-01-14 Thread Scott Fletcher
How to do the proper way of emptying hte array??

Example...

$a[0] = "test1";
$a[1] = "test2";
$a[2] = "test3";
$a[3] = "test4";

$a = "";<-- Is this hte proper way to do it

I would like the array to be cleared before being it get to be use over and
over

Thanks...



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




[PHP] Re: emptying hte array??

2003-01-14 Thread Scott Fletcher
Got an email...   The answer to this question is ...

--clip--
$a = array();

--clip--

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How to do the proper way of emptying hte array??
>
> Example...
>
> $a[0] = "test1";
> $a[1] = "test2";
> $a[2] = "test3";
> $a[3] = "test4";
>
> $a = "";<-- Is this hte proper way to do it
>
> I would like the array to be cleared before being it get to be use over
and
> over
>
> Thanks...
>
>



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




Re: [PHP] emptying hte array??

2003-01-15 Thread Scott Fletcher
It wouldn't be a good idea to undefined the array with 'unset()' if it is to
be re-use.

"Jason K Larson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> That's not going to 'empty' the array it's going to undefine it.
> Just overwrite the array with a new empty array like:
>
> $a = array();
>
> That keeps the variable an array variable type and is of course empty.
>
> HTH,
> Jason k Larson
>
> Justin French wrote:
>
> > on 15/01/03 7:52 AM, Scott Fletcher ([EMAIL PROTECTED]) wrote:
> >
> >
> > >How to do the proper way of emptying hte array??
> > >
> > >Example...
> > >
> > >$a[0] = "test1";
> > >$a[1] = "test2";
> > >$a[2] = "test3";
> > >$a[3] = "test4";
> > >
> > >$a = "";<-- Is this hte proper way to do it
> >
> >
> > unset($a);
> >
> > http://php.net/unset
> >
> > Justin
>



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




[PHP] Re: Windows vs Linux

2003-01-15 Thread Scott Fletcher
The default setting for hte error message is different in Windows and Linux.
I had that problem but reduced it when I configure the error setting in
php.ini.  Window just display more error over things that aren't really an
error, like an undefined variable that haven't been yet used.  In Unix and
Linux, it doesn't display it.


"Beauford.2002" <[EMAIL PROTECTED]> wrote in message
000701c2bc0c$8c20bb60$6401a8c0@p1">news:000701c2bc0c$8c20bb60$6401a8c0@p1...
> Hi
>
> I just installed MySQL and PHP on Windows, and I have found that I am
> getting all sorts of errors (in both) when I try to use some of the same
> commands I use in the Linux versions.  Are their a lot of differences in
the
> two, and where can I find out what these are - I just got used to using
them
> in Linux
>
> TIA
>
>



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




[PHP] Is there a way to substitute HTTP_REFERER for PHPSESSID ???

2003-01-15 Thread Scott Fletcher
My company's website rely heavily on $_SERVER["HTTP_REFERER"] and it use
Session ID also.  Problem is HTTP_REFERER is not reliable because it's data
come from the web browser, just like javascript in a way.  When I use the
Hier Menus or the javascript, 'location.replace', it prevent the
HTTP_REFERER from working and it instead show a blank.

I have been experimenting with a new sway of checking.  Is there a way that
Session ID that can completely replace the HTTP_REFERER?  HTTP_REFERER have
been a lot of help for my company's website because it prevent the direct
access attempt without logging in.  This is pretty important for the credit
bureau.

I'm open to your ideas and what you use...

Thanks,
 Scott F.



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




[PHP] Re: PHP/Flash Dynamic Graphs?

2003-01-15 Thread Scott Fletcher
I did once read the article on the website about using PHP and Flash.  As we
know, that HTML & Javascript is client side and the PHP is the server side.
The Flash help to bridge that gap by acting as a glue that hold them
together.  So, it is indeed possible for the Flash to contact the PHP server
to get data and display it without having to refresh the web browser.  It's
a really great article on how to do it.

Unfortunately, I don't remember where on the internet.  I found it on Google
in the past.


"Mh" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I want to create dynamic graphs with PHP and Flash for data that changes
> constantly (let's say every 2 seconds).  The graphs must change visibly in
> the browser window without refreshing the page.  Is this possible?  I have
> read most that I could find on MING and searched the web as well, but
didn't
> have much luck.  Is PHP/Flash approach the best?
>
> Any info/scripts/url's would be appreciated.
>
> TX
> MH
>
>



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




[PHP] Re: Windows PHP vs Linux PHP

2003-01-15 Thread Scott Fletcher
global register had nothing to do with it.  It's the configuration in the
PHP.INI.

Look for error_report & display_error in php.ini.  Once you reduced the
error messages on the webpages, then put hte @ in front of the php variable
or function

Windows is not equal to Linux or Unix.  Windows is not even a language
environment like Linux or Unix do.  So, we're gonna have to deal with M$
Window.

"Beauford.2002" <[EMAIL PROTECTED]> wrote in message
000901c2bcbe$d18c34b0$6401a8c0@p1">news:000901c2bcbe$d18c34b0$6401a8c0@p1...
> Hi,
>
> I asked previously about the differences between the two and the concensus
> was any differences are in the operating systems themselves and not with
> PHP. Knowing this, how do I get rid of these errors that keep coming up in
> Windows, that don't in Linux. One specific one is  "Notice: Undefined
> variable: add in E:\IIS Webs\address.php on line 3"
>
> Someone said to turn on register_globals which I have. Another suggestion
> was to put a @ sign in from of all variables. This is a real pain. Anyone
> have any other suggestions, or is this basically it?
>
> Also, is there anything else that anyone can think of that I may have to
> look forward to using PHP under Windows?
>
> TIA
>
>
>



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




[PHP] Re: Windows PHP vs Linux PHP

2003-01-15 Thread Scott Fletcher
Well, beaten to it..

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> global register had nothing to do with it.  It's the configuration in the
> PHP.INI.
>
> Look for error_report & display_error in php.ini.  Once you reduced the
> error messages on the webpages, then put hte @ in front of the php
variable
> or function
>
> Windows is not equal to Linux or Unix.  Windows is not even a language
> environment like Linux or Unix do.  So, we're gonna have to deal with M$
> Window.
>
> "Beauford.2002" <[EMAIL PROTECTED]> wrote in message
> 000901c2bcbe$d18c34b0$6401a8c0@p1">news:000901c2bcbe$d18c34b0$6401a8c0@p1...
> > Hi,
> >
> > I asked previously about the differences between the two and the
concensus
> > was any differences are in the operating systems themselves and not with
> > PHP. Knowing this, how do I get rid of these errors that keep coming up
in
> > Windows, that don't in Linux. One specific one is  "Notice: Undefined
> > variable: add in E:\IIS Webs\address.php on line 3"
> >
> > Someone said to turn on register_globals which I have. Another
suggestion
> > was to put a @ sign in from of all variables. This is a real pain.
Anyone
> > have any other suggestions, or is this basically it?
> >
> > Also, is there anything else that anyone can think of that I may have to
> > look forward to using PHP under Windows?
> >
> > TIA
> >
> >
> >
>
>



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




[PHP] HTTP_REFERER work without a problem....

2003-01-15 Thread Scott Fletcher
Here's what I found so interesting

This code, $_SERVER['HTTP_REFERER'] have worked without a problem when I use
the latest Mozilla build.  It even work with the HierMenus,
location.replace('http://whatever.com'), and location.href =
http://whatever.com...

This is a good news for PHP everywhere.

Unfortunately, Internet Explorer still have this bug...



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




Re: [PHP] HTTP_REFERER work without a problem....

2003-01-15 Thread Scott Fletcher
It's not a PHP bug.  Many PHP programmer tried to their best to use
HTTP_REFERER so they can keep track of which webpages on the current website
did the user last visited.  That way, they can keep out the unauthorized
access to the website without first logging in to the website.

Well, my company's website use both SSL and Session ID.  They are good for
starter but they aren't any secure if anyone can make a direct access
without logging in.  That's where I use HTTP_REFERER to see what last page
did he or she visited, if the last page being visited is outside of my
company's website then php moved the end user to the login page.  It is
pretty effective.

The common problem with the browsers is that they aren't compactible so
HTTP_REFERER don't alway work right and sometime return a blank if those
three are being used.  I had been observing it for a few years.  Those three
are  1) HierMenus, 2) location.replace('') and 3) location.href=''.  When
either one of these are in use, some browsers return with a blank in
HTTP_REFERER.

Cheers

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > Here's what I found so interesting
> >
> > This code, $_SERVER['HTTP_REFERER'] have worked without a
> > problem when I use the latest Mozilla build. It even work
> > with the HierMenus,
> location.replace('http://whatever.com'),
> > and location.href = http://whatever.com...
> >
> > This is a good news for PHP everywhere.
> >
> > Unfortunately, Internet Explorer still have this
> > bug...
>
> What bug is that?
>
> Is there a question here somewhere? I think I am having a
> hard time interpreting it.
>
> Chris



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




Re: [PHP] HTTP_REFERER work without a problem....

2003-01-15 Thread Scott Fletcher
That wouldn't work if there is already a Session ID, so that's where
HTTP_REFERER come into play.

Try it out by logging to any webpages with Session ID.  Then copy the URL
address with the Session ID already there.  Paste it into an email and send
it to a different computer.  On the new computer, substitute a couple of
alpha-numeric characters with a different one.  Like replace any of the 5
characters with a different 5 characters.  Finally, copy the URL address
with the alter Session ID and paste it into the URL address of a browser and
press enter.  You'll find yourself being able to access the website without
logging in.  The $_SESSION data would not exist but it gave the hacker what
they need to break in and hacker aren't pretty dumb, they can figure out to
make it work along the way.

What so ironic is that the SSL can be established anyway.


"Paul Roberts" <[EMAIL PROTECTED]> wrote in message
021c01c2bcda$d007cde0$28ef86d9@laptop1">news:021c01c2bcda$d007cde0$28ef86d9@laptop1...
try looking at sessions,

if they don't have a login session id send them to the login page otherwise
they are logged in so let them see the page.

works for me

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]
++++
- Original Message -
From: "Scott Fletcher" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 9:07 PM
Subject: Re: [PHP] HTTP_REFERER work without a problem


It's not a PHP bug.  Many PHP programmer tried to their best to use
HTTP_REFERER so they can keep track of which webpages on the current website
did the user last visited.  That way, they can keep out the unauthorized
access to the website without first logging in to the website.

Well, my company's website use both SSL and Session ID.  They are good for
starter but they aren't any secure if anyone can make a direct access
without logging in.  That's where I use HTTP_REFERER to see what last page
did he or she visited, if the last page being visited is outside of my
company's website then php moved the end user to the login page.  It is
pretty effective.

The common problem with the browsers is that they aren't compactible so
HTTP_REFERER don't alway work right and sometime return a blank if those
three are being used.  I had been observing it for a few years.  Those three
are  1) HierMenus, 2) location.replace('') and 3) location.href=''.  When
either one of these are in use, some browsers return with a blank in
HTTP_REFERER.

Cheers

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > Here's what I found so interesting
> >
> > This code, $_SERVER['HTTP_REFERER'] have worked without a
> > problem when I use the latest Mozilla build. It even work
> > with the HierMenus,
> location.replace('http://whatever.com'),
> > and location.href = http://whatever.com...
> >
> > This is a good news for PHP everywhere.
> >
> > Unfortunately, Internet Explorer still have this
> > bug...
>
> What bug is that?
>
> Is there a question here somewhere? I think I am having a
> hard time interpreting it.
>
> Chris



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






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




Re: [PHP] HTTP_REFERER work without a problem....

2003-01-15 Thread Scott Fletcher
I agree with you on that.  Having something that is reliable is not a bad
idea.  Anyway, this HTTP_REFERER script have been in use for 4 years and we
sometime very little have problem with it.  It the HTTP_REFERER doesn't work
then all the user will experienced is a direct access attempt and be brought
to the login page, it's part of the fail-safe code.  I haven't come up with
an alternative to HTTP_REFERER that work even better than this.  So, better
safe than sorry.  :-)

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > Many PHP programmer tried to their best to use
> > HTTP_REFERER so they can keep track of which
> > webpages on the current website did the user
> > last visited.
>
> I think I see what you are referring to now.
>
> The reason that many people (myself included) discourage
> the use of REFERER for this purpose is not only because
> support is inconsistent, but also because it is not
> required that a Web client send this header. In fact, the
> only required header in the latest version of HTTP (1.1) is
> the Host header. So, it really boils down to not depending
> on something that is not guaranteed to be there.
>
> More reliable solutions usually incorporate some sort of
> shared secret between the client and the server. For
> example, say you have a form located at foo.php that
> submits to bar.php. Rather than checking the REFERER on
> bar.php to make sure it is foo.php, it is better to include
> a hidden form field on foo.php that is dynamically
> generated and stored in the user's session. You can be
> assured that the hidden form field will be included with
> the other form elements, so you can compare it to the value
> stored in the user's session and not run the risk of it
> being absent or blank (for the legitimate user, the good
> guy).
>
> Of course, this is just one example of many, but the point
> is that you need to rely on something that is reliable. :-)
>
> Chris



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




Re: [PHP] HTTP_REFERER work without a problem....

2003-01-15 Thread Scott Fletcher
Or worse, not substituting the characters in the Session ID.  Just use the
same Session ID.  What if there is leftover session file in the /tmp
directory of the Unix machine and we're dealing with hundred of users each
day.  Some of those session files aren't deleted because the user just
closed the browser without logging out.  It is unfortunate that there is no
better solution to this.

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> That wouldn't work if there is already a Session ID, so that's where
> HTTP_REFERER come into play.
>
> Try it out by logging to any webpages with Session ID.  Then copy the URL
> address with the Session ID already there.  Paste it into an email and
send
> it to a different computer.  On the new computer, substitute a couple of
> alpha-numeric characters with a different one.  Like replace any of the 5
> characters with a different 5 characters.  Finally, copy the URL address
> with the alter Session ID and paste it into the URL address of a browser
and
> press enter.  You'll find yourself being able to access the website
without
> logging in.  The $_SESSION data would not exist but it gave the hacker
what
> they need to break in and hacker aren't pretty dumb, they can figure out
to
> make it work along the way.
>
> What so ironic is that the SSL can be established anyway.
>
>
> "Paul Roberts" <[EMAIL PROTECTED]> wrote in message
> 021c01c2bcda$d007cde0$28ef86d9@laptop1">news:021c01c2bcda$d007cde0$28ef86d9@laptop1...
> try looking at sessions,
>
> if they don't have a login session id send them to the login page
otherwise
> they are logged in so let them see the page.
>
> works for me
>
> Best Wishes & Happy New Year
>
> Paul Roberts
> [EMAIL PROTECTED]
> 
> - Original Message -
> From: "Scott Fletcher" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 15, 2003 9:07 PM
> Subject: Re: [PHP] HTTP_REFERER work without a problem
>
>
> It's not a PHP bug.  Many PHP programmer tried to their best to use
> HTTP_REFERER so they can keep track of which webpages on the current
website
> did the user last visited.  That way, they can keep out the unauthorized
> access to the website without first logging in to the website.
>
> Well, my company's website use both SSL and Session ID.  They are good for
> starter but they aren't any secure if anyone can make a direct access
> without logging in.  That's where I use HTTP_REFERER to see what last page
> did he or she visited, if the last page being visited is outside of my
> company's website then php moved the end user to the login page.  It is
> pretty effective.
>
> The common problem with the browsers is that they aren't compactible so
> HTTP_REFERER don't alway work right and sometime return a blank if those
> three are being used.  I had been observing it for a few years.  Those
three
> are  1) HierMenus, 2) location.replace('') and 3) location.href=''.  When
> either one of these are in use, some browsers return with a blank in
> HTTP_REFERER.
>
> Cheers
>
> "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > > Here's what I found so interesting
> > >
> > > This code, $_SERVER['HTTP_REFERER'] have worked without a
> > > problem when I use the latest Mozilla build. It even work
> > > with the HierMenus,
> > location.replace('http://whatever.com'),
> > > and location.href = http://whatever.com...
> > >
> > > This is a good news for PHP everywhere.
> > >
> > > Unfortunately, Internet Explorer still have this
> > > bug...
> >
> > What bug is that?
> >
> > Is there a question here somewhere? I think I am having a
> > hard time interpreting it.
> >
> > Chris
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>



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




Re: [PHP] HTTP_REFERER work without a problem....

2003-01-15 Thread Scott Fletcher
That sound wonderful!!!  I'm looking forward to hearing about this in the
near future...

Thanks,
 Scott F.

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > Or worse, not substituting the characters in the
> > Session ID. Just use the same Session ID. What if
> > there is leftover session file in the /tmp
> > directory of the Unix machine and we're dealing
> > with hundred of users each day. Some of those
> > session files aren't deleted because the user
> > just closed the browser without logging out. It
> > is unfortunate that there is no better solution to
> > this.
>
> Actually, there is a better solution.
>
> Your observations are perfectly valid and correct. If the
> session ID is given complete trust (which is the case for
> many people, unfortunately, especially with the default
> configuration for sessions), then there are many security
> risks. Given your observations, I think you are on the
> right track to developing more secure state and session
> management mechanisms yourself.
>
> I am actually considering submitting a proposal to speak
> about this topic (well, Web application security with PHP
> in general) at OSCON and perhaps the PHP Conference coming
> in May. The reason that many people are hesitant to offer
> solutions is because no solution is perfectly secure. There
> are, however, many reliable methods you can use that will
> not adversely affect your legitimate users in any way and
> make life a bit harder for the bad guys.
>
> A common example I give just to get you going is that you
> can store the user agent in a session variable. While all
> Web clients may not send the User-Agent header, you can be
> assured that those that do will send the same User-Agent
> header for every request. Verifying this against the
> session variable can at least prevent the copy/paste from
> an email attack that you mentioned unless the attacker
> replicates the exact same User-Agent header.
>
> Anyway, you have very valid points. Hopefully I will get
> the chance to speak about this in more depth at a
> conference soon, and if not, I will probably at least write
> an article on it.
>
> Chris



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




Re: [PHP] HTTP_REFERER work without a problem....

2003-01-15 Thread Scott Fletcher
I understand.  To combine the Session Id with HTTP_REFERER sound good but it
didn't work too well.  I'm still open to idea...   :-)   Fortunately, not
many people know it because it is done behind the scene, so they'll have a
lot more to guess about what's working behind the scene.



"Christoph Grottolo" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> [EMAIL PROTECTED] (Chris Shiflett) wrote:
>
> >--- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> >> Many PHP programmer tried to their best to use
> >> HTTP_REFERER so they can keep track of which
> >> webpages on the current website did the user
> >> last visited.
> >
> >I think I see what you are referring to now.
> >
> >The reason that many people (myself included) discourage
> >the use of REFERER for this purpose is not only because
> >support is inconsistent, but also because it is not
> >required that a Web client send this header. In fact, the
> >only required header in the latest version of HTTP (1.1) is
> >the Host header. So, it really boils down to not depending
> >on something that is not guaranteed to be there.
>
> It even dangerous to rely on HTTP_REFERER because it's not under your
> control. The client could set the HTTP headers itself (e.g. a php
> script using CURL, www.php.net/curl). You should at least combine the
> REFERER check with a valid session on your host or look for a
> corresponding log entry or something alike.
>
> Christoph



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




Re: [PHP] HTTP_REFERER work without a problem....

2003-01-15 Thread Scott Fletcher
Here's one way I can do, I checked the session id in the HTTP_REFERER and
grab the existing session id in the database table.  This is still not an
effective method.

"Christoph Grottolo" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> [EMAIL PROTECTED] (Chris Shiflett) wrote:
>
> >--- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> >> Many PHP programmer tried to their best to use
> >> HTTP_REFERER so they can keep track of which
> >> webpages on the current website did the user
> >> last visited.
> >
> >I think I see what you are referring to now.
> >
> >The reason that many people (myself included) discourage
> >the use of REFERER for this purpose is not only because
> >support is inconsistent, but also because it is not
> >required that a Web client send this header. In fact, the
> >only required header in the latest version of HTTP (1.1) is
> >the Host header. So, it really boils down to not depending
> >on something that is not guaranteed to be there.
>
> It even dangerous to rely on HTTP_REFERER because it's not under your
> control. The client could set the HTTP headers itself (e.g. a php
> script using CURL, www.php.net/curl). You should at least combine the
> REFERER check with a valid session on your host or look for a
> corresponding log entry or something alike.
>
> Christoph



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




[PHP] session_destroy have strange effect....

2003-01-16 Thread Scott Fletcher
session_destroy() do work when I logged out of the website.  But if I'm
logged in and open a 2nd browser and try to log in.  This where the script I
use to detect exisitng session and destroy it before generating a new one.
Problem is that session_destroy does not work on the 2nd browser...

So, my question is what is the workaround to using session_destroy() 
How do I unset it  Etc

I tried this one but it had no effect if I'm the 2nd user...

---

$_SESSION = array();
session_destroy();

---



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




Re: [PHP] HTTP_REFERER work without a problem....

2003-01-16 Thread Scott Fletcher
IP address is not an effective solution.  Anyone can use a 2nd browser on
the same machine.  Also, if for a company with 1000 machine behind the
firewall, they all get one and the same IP address outside the firewall.


"Kevin Stone" <[EMAIL PROTECTED]> wrote in message
00a701c2bcdd$316349a0$6601a8c0@kevin">news:00a701c2bcdd$316349a0$6601a8c0@kevin...
> You can never fully rely on any information given to you by the browser.
> You can't rely it being accurate or even being there at all.  What I
suggest
> to you is code a solution around the IP address.  The IP address of
course,
> like any information coming from the client, can be tampered with but more
> than likely it's not going to change while the user is browsing your
> website.  Right?  So you just use it as a temporary ID.  Log the IP to the
> database, track the IP's movements on your website, log those actions to a
> database.  That's the best way to do it without having to force the user
to
> login.  If you're concerned about people browsing from network IP then
code
> a solution using Sessions and track the session id.  And finally if you
need
> to know that a client has 'returned' to your website set a cookie on their
> computer.  I'm sure you'll find ways to elaborate from there.  You can do
> all of this without requiring the user to "login".
> -Kevin
>
> - Original Message -
> From: "Scott Fletcher" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 15, 2003 2:07 PM
> Subject: Re: [PHP] HTTP_REFERER work without a problem
>
>
> > It's not a PHP bug.  Many PHP programmer tried to their best to use
> > HTTP_REFERER so they can keep track of which webpages on the current
> website
> > did the user last visited.  That way, they can keep out the unauthorized
> > access to the website without first logging in to the website.
> >
> > Well, my company's website use both SSL and Session ID.  They are good
for
> > starter but they aren't any secure if anyone can make a direct access
> > without logging in.  That's where I use HTTP_REFERER to see what last
page
> > did he or she visited, if the last page being visited is outside of my
> > company's website then php moved the end user to the login page.  It is
> > pretty effective.
> >
> > The common problem with the browsers is that they aren't compactible so
> > HTTP_REFERER don't alway work right and sometime return a blank if those
> > three are being used.  I had been observing it for a few years.  Those
> three
> > are  1) HierMenus, 2) location.replace('') and 3) location.href=''.
When
> > either one of these are in use, some browsers return with a blank in
> > HTTP_REFERER.
> >
> > Cheers
> >
> > "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > > > Here's what I found so interesting
> > > >
> > > > This code, $_SERVER['HTTP_REFERER'] have worked without a
> > > > problem when I use the latest Mozilla build. It even work
> > > > with the HierMenus,
> > > location.replace('http://whatever.com'),
> > > > and location.href = http://whatever.com...
> > > >
> > > > This is a good news for PHP everywhere.
> > > >
> > > > Unfortunately, Internet Explorer still have this
> > > > bug...
> > >
> > > What bug is that?
> > >
> > > Is there a question here somewhere? I think I am having a
> > > hard time interpreting it.
> > >
> > > Chris
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>



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




[PHP] Re: session_destroy have strange effect....

2003-01-16 Thread Scott Fletcher
Oh never mind.  I found a work around to it.  I can use the passthru
command.  Like this...

--clip--
passthru("rm -f /tmp/sess_*")
--clip--

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> session_destroy() do work when I logged out of the website.  But if I'm
> logged in and open a 2nd browser and try to log in.  This where the script
I
> use to detect exisitng session and destroy it before generating a new one.
> Problem is that session_destroy does not work on the 2nd browser...
>
> So, my question is what is the workaround to using session_destroy() 
> How do I unset it  Etc
>
> I tried this one but it had no effect if I'm the 2nd user...
>
> ---
>
> $_SESSION = array();
> session_destroy();
>
> ---
>
>



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




[PHP] REQUEST_URI, which part of $_ is it from??

2003-01-16 Thread Scott Fletcher
Hi!

Which part of $_ is the REQUEST_URI be found from?

I did the print_r on GLOBALS and found that it is part of $_GET.  I'm
sure it will work on $_POST also.  So, it meant it shoudl work on
$_REQUEST["REQUEST_URI"] also  Can this also be part of
$_SERVER["."]???

Thanks for your input

Scott F.



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




[PHP] Is there a way to undo the md5() encryption??

2003-01-22 Thread Scott Fletcher
Hi!  Is there a way to do the decryption of the encrypted data with the use
of md5()??



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




[PHP] Re: Is there a way to undo the md5() encryption??

2003-01-22 Thread Scott Fletcher
Darn!!  There's no way to undo it.  So, I can't use this method of
encryption for my other project.  In that case, I'll live.

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!  Is there a way to do the decryption of the encrypted data with the
use
> of md5()??
>
>



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




Re: [PHP] Is there a way to undo the md5() encryption??

2003-01-22 Thread Scott Fletcher
I had it figured out!!   Don't need to decrypt it.  Instead, I can encrypt
the account number by javascript.  Grab the unencrypted account number.  Put
it into two variable, encrypt the first one with PHP and match it by
Javascript.  If accept then I use the 2nd variable to grab the data from the
data and put it into the sessions.  This will take care of the problem with
my other project

Cheers!

Thanks,
 Scott F.

"Brad Pauly" <[EMAIL PROTECTED]> wrote in message
1043271786.1236.34.camel@earth">news:1043271786.1236.34.camel@earth...
> > Hi!  Is there a way to do the decryption of the encrypted data with the
use
> > of md5()??
>
> Nope. md5 is a one way function.
>
> http://www.faqs.org/faqs/cryptography-faq/part07/
>
> Brad
>



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




[PHP] A way to detach the existing session data while making a new one???

2003-01-23 Thread Scott Fletcher
Hi!

I'm wondering is, is there a way to lose the existing session and
existing session data while making a new session id???   I can't use
session_destroy() function because it affected IE users, it doesn't affect
the non-IE user at all.  I got so tired of problems with IE and having it to
work properly with the session id, so I decided not to use
session_destory().

So, a case situation here is when an IE user closed the browser without
logging out.  Then later on, fire-up the browser and log in.  Problem with
this is when I create a new session_id(), it should work but for some
reason, a couple of IE users are being affected because the original user
did not log out in the first place.  So, I decided not to use
session_destroy() because of some strange relation between many IEs and the
PHP session_id.  So, is there a way to detach any existing session data then
creating a new session id when logging in???

Thanks!!!



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




Re: [PHP] A way to detach the existing session data while making a new one???

2003-01-23 Thread Scott Fletcher
Can't do the unset either..  For some reason, the session file aren't doing
what it is suppose to do.  When one IE browser closed, it lose it's link
to this session file in /tmp.  If I remove this unused file or something, it
affected other session files where other IE browsers had already established
hte link to 

This is what I don't get  There's nothinig wrong with the PHP code I
use.


"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
001101c2c303$c8e193a0$7c02a8c0@coconut">news:001101c2c303$c8e193a0$7c02a8c0@coconut...
> > I'm wondering is, is there a way to lose the existing session and
> > existing session data while making a new session id???   I can't use
> > session_destroy() function because it affected IE users, it doesn't
> affect
> > the non-IE user at all.  I got so tired of problems with IE and having
> it
> > to
> > work properly with the session id, so I decided not to use
> > session_destory().
>
> Unset($_SESSION) will get rid of the data in the session...
>
> > So, a case situation here is when an IE user closed the browser
> > without
> > logging out.  Then later on, fire-up the browser and log in.  Problem
> with
> > this is when I create a new session_id(), it should work but for some
> > reason, a couple of IE users are being affected because the original
> user
> > did not log out in the first place.  So, I decided not to use
> > session_destroy() because of some strange relation between many IEs
> and
> > the
> > PHP session_id.  So, is there a way to detach any existing session
> data
> > then
> > creating a new session id when logging in???
>
> Sounds like you have a problem in your code logic, not in how PHP
> handles sessions. Whether someone logs off or not shouldn't affect other
> people.
>
> ---John Holmes...
>
>



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




Re: [PHP] A way to detach the existing session data while making anew one???

2003-01-23 Thread Scott Fletcher
Look like this is something I'll stick to from now on.  Just create a new session when 
a login is being attempt.  No destruction or anything of that sort.  I have been 
trouble free for a couple of days now...  It seem that destruction of hte session data 
and files aren't being done correctly.  I didn't have that problem before until a 
newer version of IE come into play.  I'm not worried about cleaning up the garbage 
collection because I wrote a bash script to take care of that at each rebooting since 
apache would be offline.  The overnight rebooting is done twice a week.  Cheer!!!
  "Adam Voigt" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  When a session is closed, even though the file in /tmp may still exist, it is simply 
  waiting for garbage collection to clean it up. New sessions in no-way cross link 
  themselves with old ones, I promise you, you can have 1000 concurrent sessions 
  and no one's data will overlap unless bad programming is involved, and even then 
  setting a value to $_SESSION only sets it for the person who view's the particular 
page 
  that session code is on. 

  On Thu, 2003-01-23 at 12:33, Scott Fletcher wrote: 
Can't do the unset either.. For some reason, the session file aren't doing 
what it is suppose to do. When one IE browser closed, it lose it's link 
to this session file in /tmp. If I remove this unused file or something, it 
affected other session files where other IE browsers had already established 
hte link to  

This is what I don't get There's nothinig wrong with the PHP code I 
use. 


"John W. Holmes" <[EMAIL PROTECTED]> wrote in message 
001101c2c303$c8e193a0$7c02a8c0@coconut">news:001101c2c303$c8e193a0$7c02a8c0@coconut... 
> > I'm wondering is, is there a way to lose the existing session and 
> > existing session data while making a new session id??? I can't use 
> > session_destroy() function because it affected IE users, it doesn't 
> affect 
> > the non-IE user at all. I got so tired of problems with IE and having 
> it 
> > to 
> > work properly with the session id, so I decided not to use 
> > session_destory(). 
> 
> Unset($_SESSION) will get rid of the data in the session... 
> 
> > So, a case situation here is when an IE user closed the browser 
> > without 
> > logging out. Then later on, fire-up the browser and log in. Problem 
> with 
> > this is when I create a new session_id(), it should work but for some 
> > reason, a couple of IE users are being affected because the original 
> user 
> > did not log out in the first place. So, I decided not to use 
> > session_destroy() because of some strange relation between many IEs 
> and 
> > the 
> > PHP session_id. So, is there a way to detach any existing session 
> data 
> > then 
> > creating a new session id when logging in??? 
> 
> Sounds like you have a problem in your code logic, not in how PHP 
> handles sessions. Whether someone logs off or not shouldn't affect other 
> people. 
> 
> ---John Holmes... 
> 
> 



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

-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc 



[PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Found a PHP bug, I'm using PHP version 4.2.3.  I have been struggling with
why PHP code failed to work with the month is August or September, so I have
been playing around it and found the problem.  I recently wrote a demo
script for you all to play around with.  Let me know which PHP version does
this bug not affected you  I'm going to file a PHP bug at
http://bug.php.net..  I'll let you know where PHP bug # is it.  To tell
you the truth, I don't know how to search for existing bug on this one if
there is any because I don't know if it is an if-statement issue or if it is
something else  Feel free to submit a patch if you know how.

Let me know what you found and post it here...

--clip--
";

  if ($month == 01) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 02) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 03) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 04) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 05) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 06) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 07) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 08) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 09) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 10) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 11) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }
  if ($month == 12) { echo "It's a Match!!"; } else { echo "It's not
a Match!!"; }

  echo "";
   }

   //Strange Workaround to 08 and 09 ===
   echo "Strange Workaround to the Problem!!";

   $month = substr($VARIABLE[7],5,2);
   echo "The # of month is 08";
   if (trim($month) == 8) {
  echo "It's working!!!";
   }

   $month = substr($VARIABLE[8],5,2);
   echo "The # of month is 09";
   if (trim($month) == 9) {
  echo "It's working!!!";
   }

   //Testing (Should this be working or not??) =
   echo "";
   $month = substr($VARIABLE[0],5,2);
   echo "The # of month is 1";
   if (trim($month) == 1) { //With "1" as an integer...
  echo "It's working!!!";
   }

   echo "";
   $month = substr($VARIABLE[0],5,2);
   echo "The # of month is 01";
   if (trim($month) == 01) { //With "01" as an integer
  echo "It's working!!!";
   }

   echo "";
   $month = substr($VARIABLE[0],5,2);
   echo "The # of month is 1";
   if (trim($month) == "1") { //With "1" as an integer...
  echo "It's working!!!";
   }

   echo "";
   $month = substr($VARIABLE[0],5,2);
   echo "The # of month is 01";
   if (trim($month) == "01") { //With "01" as an integer
  echo "It's working!!!";
   }
?>
--clip--



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
I don't see why a string wouldn't work when I use "08" (string) and match it
against the integer 8, or 08.


"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
>
> > -Original Message-
> > From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> >
> > Found a PHP bug, I'm using PHP version 4.2.3.  I have been
> > struggling with
> > why PHP code failed to work with the month is August or
> > September
>
> I stumbled into this one a short while ago myself. It is not a bug, but a
> feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP interprets
> them as octal numbers (because of the leading 0). However, 08 and 09 are
> invalid octal numbers, so PHP converts them to zero.
>
> The fixes are numerous:
>  - remove the leading zero;
>  - add zero to them before passing (addition forces a type conversion to
> int);
>  - force a type conversion to integer using (int);
>  - quote them (when PHP converts a string to an integer, it removes the
> leading zero);
>
> Kirk



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
I'm referring to '08' and '09' that don't work

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > Found a PHP bug
> ...
> > if ($month == 01)
>
> I guess you mean:
>
> if ($month == '01')
>
> If so, this is not a bug. Otherwise, please explain what
> you think is wrong.
>
> Chris



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
I do know that integer, string, double, float, etc  are different..  I
have been using hte appropriate method like in javascript and c programming,
like converting it to integer and so on  But when I start using PHP, I
find no such document of it and I have been using it for 3 years without a
problem.  I asked people is there such a thing as converting it by using the
function and they told me there is no such a thing and that it is done
automatically...  Now my time is a little bit wasted.   So, I will correct
the problem with the php script...

I recently looked up on the manual as Jason Wong instructed me to.  I
havne't found the answer since the document is a little bit mixed up.

Okay, I'm going back to my old way as I did in javascript and c programming.
So for php, it would be

floatval() for float...
strval() for string
settype() for whatever..
intval() for integer

Um, what about double???

Thanks,
 Scott F.

"Chris Hayes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>  >Re: [PHP] Found a PHP bug!
> uh oh...
>
>
> >I don't see why a string wouldn't work when I use "08" (string) and match
it
> >against the integer 8, or 08.
>
> They're just different types. Normally PHP is veeery flexible with
> types,  like javascript, but it just can't be flexible for you here
because
> it needs to choose the most logic to the entire pool of programmers, and
then
> "08" = a string
>8 = a decimal integer
>   08 = by definition an impossible octal integer, so 0.
>
> Since you cannot tell PHP that $var is of a certain type like in [other]
> programming languages, for example you want it to be treated as an
integer,
> PHP will handle it as what seems to be the most logic.
>
>
> You can try to use intval (does not alter a variable, only the value as it
> is used in a calculation or an if() statement) or settype (alters the
> variable).
>
>
>
> >"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
> >B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
> > >
> > > > -Original Message-
> > > > From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> > > >
> > > > Found a PHP bug, I'm using PHP version 4.2.3.  I have been
> > > > struggling with
> > > > why PHP code failed to work with the month is August or
> > > > September
> > >
> > > I stumbled into this one a short while ago myself. It is not a bug,
but a
> > > feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP
interprets
> > > them as octal numbers (because of the leading 0). However, 08 and 09
are
> > > invalid octal numbers, so PHP converts them to zero.
> > >
> > > The fixes are numerous:
> > >  - remove the leading zero;
> > >  - add zero to them before passing (addition forces a type conversion
to
> > > int);
> > >  - force a type conversion to integer using (int);
> > >  - quote them (when PHP converts a string to an integer, it removes
the
> > > leading zero);
> > >
> > > Kirk
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Whoop!  FOund it,  it is doubleval()...


What does settype() do exactly


"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I do know that integer, string, double, float, etc  are different..  I
> have been using hte appropriate method like in javascript and c
programming,
> like converting it to integer and so on  But when I start using PHP, I
> find no such document of it and I have been using it for 3 years without a
> problem.  I asked people is there such a thing as converting it by using
the
> function and they told me there is no such a thing and that it is done
> automatically...  Now my time is a little bit wasted.   So, I will correct
> the problem with the php script...
>
> I recently looked up on the manual as Jason Wong instructed me to.  I
> havne't found the answer since the document is a little bit mixed up.
>
> Okay, I'm going back to my old way as I did in javascript and c
programming.
> So for php, it would be
>
> floatval() for float...
> strval() for string
> settype() for whatever..
> intval() for integer
>
> Um, what about double???
>
> Thanks,
>  Scott F.
>
> "Chris Hayes" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> >  >Re: [PHP] Found a PHP bug!
> > uh oh...
> >
> >
> > >I don't see why a string wouldn't work when I use "08" (string) and
match
> it
> > >against the integer 8, or 08.
> >
> > They're just different types. Normally PHP is veeery flexible with
> > types,  like javascript, but it just can't be flexible for you here
> because
> > it needs to choose the most logic to the entire pool of programmers, and
> then
> > "08" = a string
> >8 = a decimal integer
> >   08 = by definition an impossible octal integer, so 0.
> >
> > Since you cannot tell PHP that $var is of a certain type like in [other]
> > programming languages, for example you want it to be treated as an
> integer,
> > PHP will handle it as what seems to be the most logic.
> >
> >
> > You can try to use intval (does not alter a variable, only the value as
it
> > is used in a calculation or an if() statement) or settype (alters the
> > variable).
> >
> >
> >
> > >"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
> > >B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
> > > >
> > > > > -Original Message-
> > > > > From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> > > > >
> > > > > Found a PHP bug, I'm using PHP version 4.2.3.  I have been
> > > > > struggling with
> > > > > why PHP code failed to work with the month is August or
> > > > > September
> > > >
> > > > I stumbled into this one a short while ago myself. It is not a bug,
> but a
> > > > feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP
> interprets
> > > > them as octal numbers (because of the leading 0). However, 08 and 09
> are
> > > > invalid octal numbers, so PHP converts them to zero.
> > > >
> > > > The fixes are numerous:
> > > >  - remove the leading zero;
> > > >  - add zero to them before passing (addition forces a type
conversion
> to
> > > > int);
> > > >  - force a type conversion to integer using (int);
> > > >  - quote them (when PHP converts a string to an integer, it removes
> the
> > > > leading zero);
> > > >
> > > > Kirk
> > >
> > >
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
I would need to use intval() to solve this problem

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm referring to '08' and '09' that don't work
>
> "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > > Found a PHP bug
> > ...
> > > if ($month == 01)
> >
> > I guess you mean:
> >
> > if ($month == '01')
> >
> > If so, this is not a bug. Otherwise, please explain what
> > you think is wrong.
> >
> > Chris
>
>



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Yea, it's too bad that not many people know about it.  I first asked and
they told me it is done automatically.  That was 3 years ago.  I never had a
problem for 3 years until now.  So, I'm going back to the old way as I did
in Javascript and C programming.  I first started PHP 3 years ago, so it's
no wonder why there's all the confusion when I was just an innocent victim.
:-)

"Cal Evans" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> John.
>
> > Actually, "08" is equal to 8 in PHP. PHP will convert the string to an
> >integer and the two will compare as equal.
>
> No they are not equal. Yes, PHP will do the conversion so that they are
> equal. That does not refute the fact that logically '08' != 8.
>
>
> > Someone already posted why the problem was happening, because the
numbers
> > were being converted to invalid octal numbers and being set to zero.
>
> I understand the problem at hand. (and did when I posted) However, if
Scott
> had been doing the conversions manually, he would never have run across
this
> problem.  It is a bad idea to rely on the language (whatever the language)
> to do automatic variable conversions.
>
> =C=
>



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Double and Float are not exactly the same thing.

Double is ---> 11.123
Float is --> .00238823993

"Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> No, it's floatval.  Doubleval is an alias left over from hwen floats
> were called doubles...
>
> Scott Fletcher wrote:
>
> >Whoop!  FOund it,  it is doubleval()...
> >
> >
> >What does settype() do exactly
> >
> >
> >"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> >
> >>I do know that integer, string, double, float, etc  are different..
I
> >>have been using hte appropriate method like in javascript and c
> >>
> >>
> >programming,
> >
> >
> >>like converting it to integer and so on  But when I start using PHP,
I
> >>find no such document of it and I have been using it for 3 years without
a
> >>problem.  I asked people is there such a thing as converting it by using
> >>
> >>
> >the
> >
> >
> >>function and they told me there is no such a thing and that it is done
> >>automatically...  Now my time is a little bit wasted.   So, I will
correct
> >>the problem with the php script...
> >>
> >>I recently looked up on the manual as Jason Wong instructed me to.  I
> >>havne't found the answer since the document is a little bit mixed up.
> >>
> >>Okay, I'm going back to my old way as I did in javascript and c
> >>
> >>
> >programming.
> >
> >
> >>So for php, it would be
> >>
> >>floatval() for float...
> >>strval() for string
> >>settype() for whatever..
> >>intval() for integer
> >>
> >>Um, what about double???
> >>
> >>Thanks,
> >> Scott F.
> >>
> >>"Chris Hayes" <[EMAIL PROTECTED]> wrote in message
> >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >>
> >>
> >>> >Re: [PHP] Found a PHP bug!
> >>>uh oh...
> >>>
> >>>
> >>>
> >>>
> >>>>I don't see why a string wouldn't work when I use "08" (string) and
> >>>>
> >>>>
> >match
> >
> >
> >>it
> >>
> >>
> >>>>against the integer 8, or 08.
> >>>>
> >>>>
> >>>They're just different types. Normally PHP is veeery flexible with
> >>>types,  like javascript, but it just can't be flexible for you here
> >>>
> >>>
> >>because
> >>
> >>
> >>>it needs to choose the most logic to the entire pool of programmers,
and
> >>>
> >>>
> >>then
> >>
> >>
> >>>"08" = a string
> >>>   8 = a decimal integer
> >>>  08 = by definition an impossible octal integer, so 0.
> >>>
> >>>Since you cannot tell PHP that $var is of a certain type like in
[other]
> >>>programming languages, for example you want it to be treated as an
> >>>
> >>>
> >>integer,
> >>
> >>
> >>>PHP will handle it as what seems to be the most logic.
> >>>
> >>>
> >>>You can try to use intval (does not alter a variable, only the value as
> >>>
> >>>
> >it
> >
> >
> >>>is used in a calculation or an if() statement) or settype (alters the
> >>>variable).
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
> >>>>B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef">news:B11731D518B5D61183C700A0C98BE0D9FFBE5D@chef...
> >>>>
> >>>>
> >>>>>>-Original Message-
> >>>>>>From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> >>>>>>
> >>>>>>Found a PHP bug, I'm using PHP version 4.2.3.  I have been
> >>>>>>struggling with
> >>>>>>why PHP code failed to work with the month is August or
> >>>>>>September
> >>>>>>
> >>>>>>
> >>>>>I stumbled into this one a short while ago myself. It is not a bug,
> >>>>>
> >>>>>
> >>but a
> >>
> >>
> >>>>>feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP
> >>>>>
> >>>>>
> >>interprets
> >>
> >>
> >>>>>them as octal numbers (because of the leading 0). However, 08 and 09
> >>>>>
> >>>>>
> >>are
> >>
> >>
> >>>>>invalid octal numbers, so PHP converts them to zero.
> >>>>>
> >>>>>The fixes are numerous:
> >>>>> - remove the leading zero;
> >>>>> - add zero to them before passing (addition forces a type
> >>>>>
> >>>>>
> >conversion
> >
> >
> >>to
> >>
> >>
> >>>>>int);
> >>>>> - force a type conversion to integer using (int);
> >>>>> - quote them (when PHP converts a string to an integer, it removes
> >>>>>
> >>>>>
> >>the
> >>
> >>
> >>>>>leading zero);
> >>>>>
> >>>>>Kirk
> >>>>>
> >>>>>
> >>>>
> >>>>--
> >>>>PHP General Mailing List (http://www.php.net/)
> >>>>To unsubscribe, visit: http://www.php.net/unsub.php
> >>>>
> >>>>
> >>>
> >>>
> >>
> >>
> >
> >
> >
> >
> >
>
> --
> The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
>
>
>



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Aw nut!!!  The intval() doesn't work..  I had enough, I'm going to do
what Kirk Johnson recommend.  That one work better.....

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Yea, it's too bad that not many people know about it.  I first asked and
> they told me it is done automatically.  That was 3 years ago.  I never had
a
> problem for 3 years until now.  So, I'm going back to the old way as I did
> in Javascript and C programming.  I first started PHP 3 years ago, so it's
> no wonder why there's all the confusion when I was just an innocent
victim.
> :-)
>
> "Cal Evans" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > John.
> >
> > > Actually, "08" is equal to 8 in PHP. PHP will convert the string to an
> > >integer and the two will compare as equal.
> >
> > No they are not equal. Yes, PHP will do the conversion so that they are
> > equal. That does not refute the fact that logically '08' != 8.
> >
> >
> > > Someone already posted why the problem was happening, because the
> numbers
> > > were being converted to invalid octal numbers and being set to zero.
> >
> > I understand the problem at hand. (and did when I posted) However, if
> Scott
> > had been doing the conversions manually, he would never have run across
> this
> > problem.  It is a bad idea to rely on the language (whatever the
language)
> > to do automatic variable conversions.
> >
> > =C=
> >
>
>



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Another workaround to this problem is as an addition to Kirk Johnson's
suggestion

--clip--
$month = "08";
 if (trim($month) == 8) {
echo "You got it!!!";
     }
--clip--
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Aw nut!!!  The intval() doesn't work..  I had enough, I'm going to do
> what Kirk Johnson recommend.  That one work better.
>
> "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Yea, it's too bad that not many people know about it.  I first asked and
> > they told me it is done automatically.  That was 3 years ago.  I never
had
> a
> > problem for 3 years until now.  So, I'm going back to the old way as I
did
> > in Javascript and C programming.  I first started PHP 3 years ago, so
it's
> > no wonder why there's all the confusion when I was just an innocent
> victim.
> > :-)
> >
> > "Cal Evans" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > John.
> > >
> > > > Actually, "08" is equal to 8 in PHP. PHP will convert the string to
an
> > > >integer and the two will compare as equal.
> > >
> > > No they are not equal. Yes, PHP will do the conversion so that they
are
> > > equal. That does not refute the fact that logically '08' != 8.
> > >
> > >
> > > > Someone already posted why the problem was happening, because the
> > numbers
> > > > were being converted to invalid octal numbers and being set to zero.
> > >
> > > I understand the problem at hand. (and did when I posted) However, if
> > Scott
> > > had been doing the conversions manually, he would never have run
across
> > this
> > > problem.  It is a bad idea to rely on the language (whatever the
> language)
> > > to do automatic variable conversions.
> > >
> > > =C=
> > >
> >
> >
>
>



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




Re: [PHP] Found a PHP bug!!!!!!!!!

2003-01-27 Thread Scott Fletcher
Okay, correction...

Double --> 11.1237
Float --> 0.

Cheers!  It's the way it work in C Programming...  Double won't be as long
or as infinite as the floating point.


"White Wolf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> "Scott Fletcher" wrote:
> > Double and Float are not exactly the same thing.
> >
> > Double is ---> 11.123
> > Float is --> .00238823993
>
> I am absolutely new to PHP but what is above (since PHP seems to take most
> of its low-level terminology from C) is a fixed point number and the next
> is a floating point number, which may not fit into the 8 significant
digits
> what is guaranteed for a float on all platforms.  What do I miss?
>
> WW
>
>



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




[PHP] A way to break up the string????

2003-01-29 Thread Scott Fletcher
Just curious, is there a PHP function that will break up the string for us?

Here's the example

--clip--
//Original
$name = "Jennifer B Cuff";

//Whatever is to be end result of the original
$first_name = "Jennifer";
$middle_name = "B";
$last_name = "Cuff";
--clip--

It is a mind challenging game to seperate the data from the whitespace and
break them up.  I wrote a lengthy script to do it for me but it's not
perfect.  I welcome someone with a fresh mind to do that for me.  My next
nightmare is to break up the address into 1) street number, 2) street name,
3) street tty, 4) city, 5) state, 6) zip while I have to interrupt it the
script to put in the "N/A" in street number, street name and street tty if
there is something like "PO Box 1600" or "Apt #23"...  It is a sucker that
the credit bureau, Experian doesn't keep things any simplier.  I like
Equifax better.

You up to the challenge??



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




Re: [PHP] A way to break up the string????

2003-01-29 Thread Scott Fletcher
Wow!!  A lot easier.  I think I can do the counting to find out if which go
which.  For example, "Jennifer B Cuff" as oppose to "Jennifer Cuff".  Say, I
find 3 words instead of 2 then do something to it.  If 2 then do something
to it.  Etc.  I do realize that it is possible for there to be a logic
error, like "Cuff" which can't be tell as first name or last name if I don't
get the data like "Jennifer Cuff".

Thanks!!!   You are the best newsgroup to talk to  :-)


"Jon Haworth" <[EMAIL PROTECTED]> wrote in message
67DF9B67CEFAD4119E4200D0B720FA3F0241EC3B@BOOTROS">news:67DF9B67CEFAD4119E4200D0B720FA3F0241EC3B@BOOTROS...
> Hi Scott,
>
> > Just curious, is there a PHP function that will break up the
> > string for us?
>
> http://php.net/explode
>
>
> Cheers
> Jon



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




Re: [PHP] A way to break up the string????

2003-01-29 Thread Scott Fletcher
> * if there is something inbetween it's probably all middle names (allow
for
> several middle names for catholic dutch people that tend to have names
such
> as Wilhemus Antonius Johannes Maria den Braber)
> Curse those people with double back names, like 'den Braber' here. Or
> spaced first names.

This is what I'm afraid of..   :-)

It would be easier to force Experian to comply with the programming standard
or something like first name into one section, last name into another
section, etc.  Well, all business care about is , I'm so thankful
for open source..



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




[PHP] mail() and php.ini (Any Luck???)

2003-02-11 Thread Scott Fletcher
Hi Everyone

The webserver is a Unix machine.  I don't want to send the email from the
Unix machine, I want to do that from Window.  So, if I configure hte php.ini
to find the MS-Exchange on Window and use it to send the email while the
webpage is on the Unix webserver, such as form fill out and click the send
button.

Have anyone try this and does it work?  Anyone struggle with it??  I'm going
to go ahead and do it.

Thanks,
 Scott F.



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




Re: [PHP] mail() and php.ini (Any Luck???)

2003-02-11 Thread Scott Fletcher
Someone send me an email to take a look at this
URLhttp://www.php.net/manual/fi/ref.imap.php .

The send mail on Unix is too basic, not like MS-Exchange...  I need things
like file attachment, Bcc, cc, etc  Also, it is too slow because the
machine have problem with DNS while many Windows doesn't have this problem.

Thanks for the link to www.phpclasses.org .  Will look into it.

Scott F.

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Wednesday 12 February 2003 02:12, Scott Fletcher wrote:
>
> > The webserver is a Unix machine.  I don't want to send the email from
the
> > Unix machine, I want to do that from Window.  So, if I configure hte
> > php.ini to find the MS-Exchange on Window and use it to send the email
> > while the webpage is on the Unix webserver, such as form fill out and
click
> > the send button.
> >
> > Have anyone try this and does it work?  Anyone struggle with it??  I'm
> > going to go ahead and do it.
>
> It wouldn't work. On Unix, mail() uses the sendmail binary and ignores any
> SMTP setting. You can get yourself a mail class from www.phpclasses.org
which
> can use SMTP regardless of whether you're on Unix or Windows.
>
> Anyway, what is the reason for using an external mailserver?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Mausoleum:  The final and funniest folly of the rich.
> -- Ambrose Bierce
> */
>



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




Re: [PHP] mail() and php.ini (Any Luck???)

2003-02-11 Thread Scott Fletcher
No, nothing is misconfigured on this machine.  The problem is the firewall
and the nameserver.  So, the easy workaround to it is to use the MS-Exchange
on Window.  Sendmail on Unix still doesn't allow me to use more stuffs, so I
had to use MS-Exchange.  Sendmail is not the right kind of email service to
use, so I can't use it.

By the way, Found a nice open-source script at www.phpclasses.org that would
allow me to connect to MS-Exchange.  Very nice, I'm going to use this.
Thanks!!!

Thanks,
 Scott F.

"Reuben D. Budiardja" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Tuesday 11 February 2003 02:19 pm, Scott Fletcher wrote:
> Someone send me an email to take a look at this
> URLhttp://www.php.net/manual/fi/ref.imap.php .
>
> The send mail on Unix is too basic, not like MS-Exchange...  I need things
> like file attachment, Bcc, cc, etc

All of those can be done with sendmail. Bcc and cc can be done with just
adding extra header. In the php mail() function, it's the last argument
IIRC.

There are a lot of classes out there that will allow you to put attachment
using the mail() function. Basically you only need the correct MIME-encoding
and stuff. Read the manual for mail() again in php.net, or google for php
mail attachment.
You have to do it the same way to even in Windoze machine. It's not because
of
"sendmail on Unix is too basic".

If you still want to use Windoze smtp server for sending your mail, then I
think you need to open a socket connection to the machine running smtp. In
my
opinion, this complicates stuff that can be done easier, but you can look
here:
http://www.php.net/manual/en/function.fsockopen.php.

There is even an example by some user contributed notes on how to do that.

> Also, it is too slow because the
> machine have problem with DNS while many Windows doesn't have this
problem.

hmm.. that sounds like something misconfigured in the machine, maybe??

Hope that helps.
--RDB


> Thanks for the link to www.phpclasses.org .  Will look into it.
>
> Scott F.
>
> "Jason Wong" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > On Wednesday 12 February 2003 02:12, Scott Fletcher wrote:
> > > The webserver is a Unix machine.  I don't want to send the email from
>
> the
>
> > > Unix machine, I want to do that from Window.  So, if I configure hte
> > > php.ini to find the MS-Exchange on Window and use it to send the email
> > > while the webpage is on the Unix webserver, such as form fill out and
>
> click
>
> > > the send button.
> > >
> > > Have anyone try this and does it work?  Anyone struggle with it??  I'm
> > > going to go ahead and do it.
> >
> > It wouldn't work. On Unix, mail() uses the sendmail binary and ignores
> > any SMTP setting. You can get yourself a mail class from
> > www.phpclasses.org
>
> which
>
> > can use SMTP regardless of whether you're on Unix or Windows.
> >
> > Anyway, what is the reason for using an external mailserver?
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.biz
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> > --
> > Search the list archives before you post
> > http://marc.theaimsgroup.com/?l=php-general
> > --
> > /*
> > Mausoleum:  The final and funniest folly of the rich.
> > -- Ambrose Bierce
> > */

--
-
/"\  ASCII Ribbon Campaign against HTML
\ /  email and proprietary format
 X   attachments.
/ \
-
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-



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




Re: [PHP] mail() and php.ini (Any Luck???)

2003-02-11 Thread Scott Fletcher
I can see what you meant about the MIME-encoding and stuffs.  This is pretty
cool also.


"Reuben D. Budiardja" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Tuesday 11 February 2003 02:19 pm, Scott Fletcher wrote:
> Someone send me an email to take a look at this
> URLhttp://www.php.net/manual/fi/ref.imap.php .
>
> The send mail on Unix is too basic, not like MS-Exchange...  I need things
> like file attachment, Bcc, cc, etc

All of those can be done with sendmail. Bcc and cc can be done with just
adding extra header. In the php mail() function, it's the last argument
IIRC.

There are a lot of classes out there that will allow you to put attachment
using the mail() function. Basically you only need the correct MIME-encoding
and stuff. Read the manual for mail() again in php.net, or google for php
mail attachment.
You have to do it the same way to even in Windoze machine. It's not because
of
"sendmail on Unix is too basic".

If you still want to use Windoze smtp server for sending your mail, then I
think you need to open a socket connection to the machine running smtp. In
my
opinion, this complicates stuff that can be done easier, but you can look
here:
http://www.php.net/manual/en/function.fsockopen.php.

There is even an example by some user contributed notes on how to do that.

> Also, it is too slow because the
> machine have problem with DNS while many Windows doesn't have this
problem.

hmm.. that sounds like something misconfigured in the machine, maybe??

Hope that helps.
--RDB


> Thanks for the link to www.phpclasses.org .  Will look into it.
>
> Scott F.
>
> "Jason Wong" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > On Wednesday 12 February 2003 02:12, Scott Fletcher wrote:
> > > The webserver is a Unix machine.  I don't want to send the email from
>
> the
>
> > > Unix machine, I want to do that from Window.  So, if I configure hte
> > > php.ini to find the MS-Exchange on Window and use it to send the email
> > > while the webpage is on the Unix webserver, such as form fill out and
>
> click
>
> > > the send button.
> > >
> > > Have anyone try this and does it work?  Anyone struggle with it??  I'm
> > > going to go ahead and do it.
> >
> > It wouldn't work. On Unix, mail() uses the sendmail binary and ignores
> > any SMTP setting. You can get yourself a mail class from
> > www.phpclasses.org
>
> which
>
> > can use SMTP regardless of whether you're on Unix or Windows.
> >
> > Anyway, what is the reason for using an external mailserver?
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.biz
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> > --
> > Search the list archives before you post
> > http://marc.theaimsgroup.com/?l=php-general
> > --
> > /*
> > Mausoleum:  The final and funniest folly of the rich.
> > -- Ambrose Bierce
> > */

--
-
/"\  ASCII Ribbon Campaign against HTML
\ /  email and proprietary format
 X   attachments.
/ \
-
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-



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




[PHP] sending e-mail with 'Bcc:' and 'Cc:' not working....

2003-02-13 Thread Scott Fletcher
I'm a little puzzled on why does either of these two, 'Bcc' and 'Cc' not
work when I had successfully send the e-mail.  My best guess is that I need
additional header, if so then what are the required header needed to make
this 'Bcc' and 'Cc' work?

Here's the Internet Header from the " To:  " e-mail that worked.

--clip--
Received: from localhost (host.domain.com [0.0.0.0]) by hostname.domain with
SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13)
 id 1KAAMHG6; Thu, 13 Feb 2003 11:58:34 -0500
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Return-Path: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: e-Mail Test
Date: Thu, 13 Feb 2003 12:03:48 EST
--clip--

Thanks



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




[PHP] php.ini for UNIX sendmail????

2003-02-18 Thread Scott Fletcher
Hi!

  What is the appropriate filepath with the flag command for the sendmail on
the UNIX machine??  I send an email to yahoo and got the error message which
I'm going to paste it here...

--clip--
- The following addresses had permanent fatal errors -
[EMAIL PROTECTED]

  --- The transcript of the session follows ---
... while talking to mx2.mail.yahoo.com.:
>>> MAIL From: SIZE=40
<<< 501 Syntax error in parameters or arguments
501 [EMAIL PROTECTED] Data format error
--clip--

One thing I know for sure is that the sendmail is working and that hte
PHP code is working.  I don't think I did the bad php command.  Could it be
the sendmail command be set wrong???

Thanks,
 FletchSOD



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




Re: [PHP] php.ini for UNIX sendmail????

2003-02-18 Thread Scott Fletcher
Here's is the response to the command, 'where sendmail'.
>>bash: where: command not found

So, I don't have a where command but I did the phpinfo() and it showed .

--clip--
Directive  ||  Local Value ||  master value

sendmail_from || no value ||  no value 
sendmail_path  || /usr/sbin/sendmail -t -i  ||  /usr/sbin/sendmail -t -i 
--clip--

I don't have email problem when I send email to anywhere, the only problem is the 
yahoo itself...

Thanks...
  "Adam Voigt" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Umm, are you asking for Sendmail's path? 
  It's usually /usr/bin/sendmail -t -i but you can verify where it is 
  on your system by typing "where sendmail". 

  On Tue, 2003-02-18 at 10:25, Scott Fletcher wrote: 
Hi! 

What is the appropriate filepath with the flag command for the sendmail on 
the UNIX machine?? I send an email to yahoo and got the error message which 
I'm going to paste it here... 

--clip-- 
- The following addresses had permanent fatal errors - 
[EMAIL PROTECTED] 

--- The transcript of the session follows --- 
... while talking to mx2.mail.yahoo.com.: 
>>> MAIL From: SIZE=40 
<<< 501 Syntax error in parameters or arguments 
501 [EMAIL PROTECTED] Data format error 
--clip-- 

One thing I know for sure is that the sendmail is working and that hte 
PHP code is working. I don't think I did the bad php command. Could it be 
the sendmail command be set wrong??? 

Thanks, 
FletchSOD 



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

-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc 



Re: [PHP] php.ini for UNIX sendmail????

2003-02-18 Thread Scott Fletcher
Here's the command...

--clip--
mail("[EMAIL PROTECTED]", "the subject", $message,
"From: webmaster@$SERVER_NAME\r\n"
."Return-Path: [EMAIL PROTECTED]"
."Reply-To: webmaster@$SERVER_NAME\r\n"
."X-Mailer: PHP/" . phpversion());
--clip--

The bad thing is that when I send the mail.  I never get an email back when something 
is not working right by using the return-path.


  "Adam Voigt" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Oh, ok, well how about your PHP code then (the actual mail() line)? 

  On Tue, 2003-02-18 at 10:34, Scott Fletcher wrote: 
Here's is the response to the command, 'where sendmail'. 
>>bash: where: command not found 

So, I don't have a where command but I did the phpinfo() and it showed . 

--clip-- 
Directive || Local Value || master value 


 
sendmail_from || no value || no value 
sendmail_path || /usr/sbin/sendmail -t -i || /usr/sbin/sendmail -t -i 
--clip-- 

I don't have email problem when I send email to anywhere, the only problem is the 
yahoo itself... 

Thanks... 
"Adam Voigt" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 
Umm, are you asking for Sendmail's path? 
It's usually /usr/bin/sendmail -t -i but you can verify where it is 
on your system by typing "where sendmail". 

On Tue, 2003-02-18 at 10:25, Scott Fletcher wrote: 
Hi! 

What is the appropriate filepath with the flag command for the sendmail on 
the UNIX machine?? I send an email to yahoo and got the error message which 
I'm going to paste it here... 

--clip-- 
- The following addresses had permanent fatal errors - 
[EMAIL PROTECTED] 

--- The transcript of the session follows --- 
... while talking to mx2.mail.yahoo.com.: 
>>> MAIL From: SIZE=40 
<<< 501 Syntax error in parameters or arguments 
501 [EMAIL PROTECTED] Data format error 
--clip-- 

One thing I know for sure is that the sendmail is working and that hte 
PHP code is working. I don't think I did the bad php command. Could it be 
the sendmail command be set wrong??? 

Thanks, 
FletchSOD 



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

-- 
Adam Voigt ([EMAIL PROTECTED]) 
The Cryptocomm Group 
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc 
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc 



Re: [PHP] php.ini for UNIX sendmail????

2003-02-18 Thread Scott Fletcher
Well, okay, even with the '\r\n' path, I still have problem.   Here's the new script 
and I retested it.

--clip--
$message = "This is a test";

mail("[EMAIL PROTECTED]", "the subject", $message,
"From: webmaster@$SERVER_NAME\r\n"
."Return-Path: [EMAIL PROTECTED]\r\n"
."Reply-To: webmaster@$SERVER_NAME\r\n"
."X-Mailer: PHP/".phpversion()."\r\n");
--clip--

So far, I never got the email at yahoo and I never got the email at abcoa.com.
  "Adam Voigt" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Well your missing your \r\n at the end of your return path. 

  On Tue, 2003-02-18 at 10:57, Scott Fletcher wrote: 
Here's the command... 

--clip-- 
mail("[EMAIL PROTECTED]", "the subject", $message, 
"From: webmaster@$SERVER_NAME\r\n" 
."Return-Path: [EMAIL PROTECTED]" 
."Reply-To: webmaster@$SERVER_NAME\r\n" 
."X-Mailer: PHP/" . phpversion()); 
--clip-- 

The bad thing is that when I send the mail. I never get an email back when 
something is not working right by using the return-path. 


"Adam Voigt" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 
Oh, ok, well how about your PHP code then (the actual mail() line)? 

On Tue, 2003-02-18 at 10:34, Scott Fletcher wrote: 
Here's is the response to the command, 'where sendmail'. 
>>bash: where: command not found 

So, I don't have a where command but I did the phpinfo() and it showed . 

--clip-- 
Directive || Local Value || master value 


 
sendmail_from || no value || no value 
sendmail_path || /usr/sbin/sendmail -t -i || /usr/sbin/sendmail -t -i 
--clip-- 

I don't have email problem when I send email to anywhere, the only problem is the 
yahoo itself... 

Thanks... 
"Adam Voigt" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 
Umm, are you asking for Sendmail's path? 
It's usually /usr/bin/sendmail -t -i but you can verify where it is 
on your system by typing "where sendmail". 

On Tue, 2003-02-18 at 10:25, Scott Fletcher wrote: 
Hi! 

What is the appropriate filepath with the flag command for the sendmail on 
the UNIX machine?? I send an email to yahoo and got the error message which 
I'm going to paste it here... 

--clip-- 
- The following addresses had permanent fatal errors - 
[EMAIL PROTECTED] 

--- The transcript of the session follows --- 
... while talking to mx2.mail.yahoo.com.: 
>>> MAIL From: SIZE=40 
<<< 501 Syntax error in parameters or arguments 
501 [EMAIL PROTECTED] Data format error 
--clip-- 

One thing I know for sure is that the sendmail is working and that hte 
PHP code is working. I don't think I did the bad php command. Could it be 
the sendmail command be set wrong??? 

Thanks, 
FletchSOD 



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

-- 
Adam Voigt ([EMAIL PROTECTED]) 
The Cryptocomm Group 
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc 
-- 
Adam Voigt ([EMAIL PROTECTED]) 
The Cryptocomm Group 
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc 
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc 



Re: [PHP] php.ini for UNIX sendmail????

2003-02-18 Thread Scott Fletcher
Found the solution to the problem, Take a look at this at 
http://forums.devshed.com/archive/5/2002/09/4/43013 ..  Very useful.

  "Adam Voigt" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Well your missing your \r\n at the end of your return path. 

  On Tue, 2003-02-18 at 10:57, Scott Fletcher wrote: 
Here's the command... 

--clip-- 
mail("[EMAIL PROTECTED]", "the subject", $message, 
"From: webmaster@$SERVER_NAME\r\n" 
."Return-Path: [EMAIL PROTECTED]" 
."Reply-To: webmaster@$SERVER_NAME\r\n" 
."X-Mailer: PHP/" . phpversion()); 
--clip-- 

The bad thing is that when I send the mail. I never get an email back when 
something is not working right by using the return-path. 


"Adam Voigt" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 
Oh, ok, well how about your PHP code then (the actual mail() line)? 

On Tue, 2003-02-18 at 10:34, Scott Fletcher wrote: 
Here's is the response to the command, 'where sendmail'. 
>>bash: where: command not found 

So, I don't have a where command but I did the phpinfo() and it showed . 

--clip-- 
Directive || Local Value || master value 


 
sendmail_from || no value || no value 
sendmail_path || /usr/sbin/sendmail -t -i || /usr/sbin/sendmail -t -i 
--clip-- 

I don't have email problem when I send email to anywhere, the only problem is the 
yahoo itself... 

Thanks... 
"Adam Voigt" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 
Umm, are you asking for Sendmail's path? 
It's usually /usr/bin/sendmail -t -i but you can verify where it is 
on your system by typing "where sendmail". 

On Tue, 2003-02-18 at 10:25, Scott Fletcher wrote: 
Hi! 

What is the appropriate filepath with the flag command for the sendmail on 
the UNIX machine?? I send an email to yahoo and got the error message which 
I'm going to paste it here... 

--clip-- 
- The following addresses had permanent fatal errors - 
[EMAIL PROTECTED] 

--- The transcript of the session follows --- 
... while talking to mx2.mail.yahoo.com.: 
>>> MAIL From: SIZE=40 
<<< 501 Syntax error in parameters or arguments 
501 [EMAIL PROTECTED] Data format error 
--clip-- 

One thing I know for sure is that the sendmail is working and that hte 
PHP code is working. I don't think I did the bad php command. Could it be 
the sendmail command be set wrong??? 

Thanks, 
FletchSOD 



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

-- 
Adam Voigt ([EMAIL PROTECTED]) 
The Cryptocomm Group 
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc 
-- 
Adam Voigt ([EMAIL PROTECTED]) 
The Cryptocomm Group 
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc 
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc 



[PHP] Using mail() function in php.ini (Unix/Linux)

2003-02-18 Thread Scott Fletcher
For those of you who don't know it or are struggling with the problem with
the slow sending of hte e-mail behind the firewall.  This problem doesn't
alway lie with the DNS itself.  The workaround to the problem is the
hostname resolution or the alias to the hostname.  Just open up the
/etc/hosts file using either vi or emac and add this ...   (Substitute the
term in the bracket for something else)

--clip--

--clip--

Do not use the dot between the hostname and the domain name.   Just like
this as you normally see in most host files




Enjoy.




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




Re: [PHP] php.ini for UNIX sendmail????

2003-02-19 Thread Scott Fletcher
Not that I know of..

Found out the reason Yahoo reject the email I send to Yahoo is because the
'From: ' address isn't [EMAIL PROTECTED] with the proper domain name.  What
Yahoo got is root@chevy in the 'From: ' section of the email.  This is the
email that is send from the Unix server.  So, I tried overriding it with the
'From: [EMAIL PROTECTED]' option in the mail function.  Unfortunately that
doesn't work because root@chevy override that 'From: ' option.  The
workaround to the problem in Unix is to use the hostname resolution in the
/etc/hosts file.  I'm not having much luck yet.  Because I am only able to
get Yahoo to accept my email if it is outside of the abcoa.com in the
/etc/hosts file but return with an unknown error message for any email that
end with abcoa.com.


"Robin Mordasiewicz" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is there any way to specify to use a remote smtp server in the php.ini
>
> On Tue, 18 Feb 2003, Scott Fletcher wrote:
>
> > Well, okay, even with the '\r\n' path, I still have problem.   Here's
the new script and I retested it.
> >
> > --clip--
> > $message = "This is a test";
> >
> > mail("[EMAIL PROTECTED]", "the subject", $message,
> > "From: webmaster@$SERVER_NAME\r\n"
> > ."Return-Path: [EMAIL PROTECTED]\r\n"
> > ."Reply-To: webmaster@$SERVER_NAME\r\n"
> > ."X-Mailer: PHP/".phpversion()."\r\n");
> > --clip--
> >
> > So far, I never got the email at yahoo and I never got the email at
abcoa.com.
> >   "Adam Voigt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >   Well your missing your \r\n at the end of your return path.
> >
> >   On Tue, 2003-02-18 at 10:57, Scott Fletcher wrote:
> > Here's the command...
> >
> > --clip--
> > mail("[EMAIL PROTECTED]", "the subject", $message,
> > "From: webmaster@$SERVER_NAME\r\n"
> > ."Return-Path: [EMAIL PROTECTED]"
> > ."Reply-To: webmaster@$SERVER_NAME\r\n"
> > ."X-Mailer: PHP/" . phpversion());
> > --clip--
> >
> > The bad thing is that when I send the mail. I never get an email
back when something is not working right by using the return-path.
> >
> >
> > "Adam Voigt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Oh, ok, well how about your PHP code then (the actual mail() line)?
> >
> > On Tue, 2003-02-18 at 10:34, Scott Fletcher wrote:
> > Here's is the response to the command, 'where sendmail'.
> > >>bash: where: command not found
> >
> > So, I don't have a where command but I did the phpinfo() and it
showed .
> >
> > --clip--
> > Directive || Local Value || master value
>
  --
--
> > sendmail_from || no value || no value
> > sendmail_path || /usr/sbin/sendmail -t -i ||
/usr/sbin/sendmail -t -i
> > --clip--
> >
> > I don't have email problem when I send email to anywhere, the only
problem is the yahoo itself...
> >
> > Thanks...
> > "Adam Voigt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Umm, are you asking for Sendmail's path?
> > It's usually /usr/bin/sendmail -t -i but you can verify where it is
> > on your system by typing "where sendmail".
> >
> > On Tue, 2003-02-18 at 10:25, Scott Fletcher wrote:
> > Hi!
> >
> > What is the appropriate filepath with the flag command for the
sendmail on
> > the UNIX machine?? I send an email to yahoo and got the error
message which
> > I'm going to paste it here...
> >
> > --clip--
> > - The following addresses had permanent fatal errors -
> > [EMAIL PROTECTED]
> >
> > --- The transcript of the session follows ---
> > ... while talking to mx2.mail.yahoo.com.:
> > >>> MAIL From: SIZE=40
> > <<< 501 Syntax error in parameters or arguments
> > 501 [EMAIL PROTECTED] Data format error
> > --clip--
> >
> > One thing I know for sure is that the sendmail is working and that
hte
> > PHP code is working. I don't think I did the bad php command. Could
it be
> > the sendmail command be set wrong???
> >
> > Thanks,
> > FletchSOD
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> > Adam Voigt ([EMAIL PROTECTED])
> > The Cryptocomm Group
> > My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
> > --
> > Adam Voigt ([EMAIL PROTECTED])
> > The Cryptocomm Group
> > My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
> >
>
> --
> Robin Mordasiewicz
> 416-207-7012
> UNIX System Developer
> Primus Canada
>



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




[PHP] Finally!!! A workaround to mail() in PHP...

2003-02-19 Thread Scott Fletcher
Finally a workaround to the problem in mail() in PHP  I did the posting
somewhere, so I'll cut to the chase by posting it here  My recent
posting does not work too well

--clip--
This is for any Unix or Linux machine using the Sendmail.  However, no
guarentee that it would work in Windows.

Some SMTP won't accept e-mail with the "From: host@domain" without the
suffix "com", like "domain.com", so using the "From: [EMAIL PROTECTED]" option
in the $header in the mail() does not solve the problem for me.

Someone suggest using the php.ini with the configuration by adding the "-f
[EMAIL PROTECTED]" to the sendmail path.  Example look like this

--clip--
sendmail_path = /usr/sbin/sendmail -t -i -f [EMAIL PROTECTED]
--clip--

This is not an option for me because it is limit to one user, not more than
one and it override the "From: [EMAIL PROTECTED]" option in the $header in
mail()..  So, Finally there is a workaround to the problem and it is very
simple  Just add this entrie to the /etc/hosts file in Unix or Linux.
Just substitute the word in bracket for a value
--clip--

--clip--

Example ...
--clip--
123.456.789.012  xyz.abc.com
--clip--

Make sure your machine do the search order with the host first before the
DNS or Nameserver.  In my case in AIX, is "/etc/netsvc.conf".

Hope

Make sure your machine is set to read the host file first before the DNS or
the nameserver, if not then make some changes to it.  In my case for AIX, it
is "/etc/netsvc.conf"...

Hope this help
--clip--



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




[PHP] mail() using "Return-Path:" and "Error-To:"....

2003-02-19 Thread Scott Fletcher
Hiya fellas

I'm doing the test on sending emails and what I found is that I haven't
got these two to to work which is "Return-Path:" and "Error-To:"  Does
anyone know why does it not work???  Here's my sample codes

--clip--
  $Header = "From: [EMAIL PROTECTED]\r\n";
  $Header .= "Return-Path: [EMAIL PROTECTED]\r\n";
  $Header .= "Error-To: [EMAIL PROTECTED]\r\n";
  $Header .= "MIME-Version: 1.0\r\n";
  $Header .= "Content-type: text/plain; charset=iso-8859-1\r\n";
  $Header .= "X-Priority: 3\r\n";
  $Header .= "X-MSMail-Priority: Normal\r\n";
  $Header .= "X-Mailer: PHP ".phpversion()."\r\n";

  mail([EMAIL PROTECTED],"test","This is a test",$Header);
--clip--



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




Re: [PHP] Finally!!! A workaround to mail() in PHP...

2003-02-19 Thread Scott Fletcher
That doesn't work either because this machine's SMTP doesn't know it's user
in it's own domain, so a modification of the /etc/hosts file is
necessnary

"Danny Shepherd" <[EMAIL PROTECTED]> wrote in message
023901c2d836$773f83c0$6400a8c0@DANNYS">news:023901c2d836$773f83c0$6400a8c0@DANNYS...
> I'd say an even simpler workaround would be to add '[EMAIL PROTECTED]' as
> the fifth parameter to the mail function - just as in example 3 of the
docs.
>
> Danny.
>
> - Original Message -
> From: "Scott Fletcher" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 19, 2003 3:43 PM
> Subject: [PHP] Finally!!! A workaround to mail() in PHP...
>
>
> > Finally a workaround to the problem in mail() in PHP  I did the
> posting
> > somewhere, so I'll cut to the chase by posting it here  My recent
> > posting does not work too well
> >
> > --clip--
> > This is for any Unix or Linux machine using the Sendmail.  However, no
> > guarentee that it would work in Windows.
> >
> > Some SMTP won't accept e-mail with the "From: host@domain" without the
> > suffix "com", like "domain.com", so using the "From: [EMAIL PROTECTED]"
> option
> > in the $header in the mail() does not solve the problem for me.
> >
> > Someone suggest using the php.ini with the configuration by adding the
"-f
> > [EMAIL PROTECTED]" to the sendmail path.  Example look like this
> >
> > --clip--
> > sendmail_path = /usr/sbin/sendmail -t -i -f [EMAIL PROTECTED]
> > --clip--
> >
> > This is not an option for me because it is limit to one user, not more
> than
> > one and it override the "From: [EMAIL PROTECTED]" option in the $header in
> > mail()..  So, Finally there is a workaround to the problem and it is
very
> > simple  Just add this entrie to the /etc/hosts file in Unix or
Linux.
> > Just substitute the word in bracket for a value
> > --clip--
> > 
> > --clip--
> >
> > Example ...
> > --clip--
> > 123.456.789.012  xyz.abc.com
> > --clip--
> >
> > Make sure your machine do the search order with the host first before
the
> > DNS or Nameserver.  In my case in AIX, is "/etc/netsvc.conf".
> >
> > Hope
> >
> > Make sure your machine is set to read the host file first before the DNS
> or
> > the nameserver, if not then make some changes to it.  In my case for
AIX,
> it
> > is "/etc/netsvc.conf"...
> >
> > Hope this help
> > --clip--
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>



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




Re: [PHP] Finally!!! A workaround to mail() in PHP...

2003-02-19 Thread Scott Fletcher
The reason for this is due to the fact that PHP can override Sendmail but
Sendmail can not override the Unix/Linux Operating System.  So, once
sendmail work without a problem in O/S, including inside the domain on the
local network where hte machine reside and outside of the local network
then you can safely use the 5th parameter...

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> That doesn't work either because this machine's SMTP doesn't know it's
user
> in it's own domain, so a modification of the /etc/hosts file is
> necessnary
>
> "Danny Shepherd" <[EMAIL PROTECTED]> wrote in message
> 023901c2d836$773f83c0$6400a8c0@DANNYS">news:023901c2d836$773f83c0$6400a8c0@DANNYS...
> > I'd say an even simpler workaround would be to add '[EMAIL PROTECTED]'
as
> > the fifth parameter to the mail function - just as in example 3 of the
> docs.
> >
> > Danny.
> >
> > - Original Message -
> > From: "Scott Fletcher" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, February 19, 2003 3:43 PM
> > Subject: [PHP] Finally!!! A workaround to mail() in PHP...
> >
> >
> > > Finally a workaround to the problem in mail() in PHP  I did the
> > posting
> > > somewhere, so I'll cut to the chase by posting it here  My recent
> > > posting does not work too well
> > >
> > > --clip--
> > > This is for any Unix or Linux machine using the Sendmail.  However, no
> > > guarentee that it would work in Windows.
> > >
> > > Some SMTP won't accept e-mail with the "From: host@domain" without the
> > > suffix "com", like "domain.com", so using the "From: [EMAIL PROTECTED]"
> > option
> > > in the $header in the mail() does not solve the problem for me.
> > >
> > > Someone suggest using the php.ini with the configuration by adding the
> "-f
> > > [EMAIL PROTECTED]" to the sendmail path.  Example look like this
> > >
> > > --clip--
> > > sendmail_path = /usr/sbin/sendmail -t -i -f [EMAIL PROTECTED]
> > > --clip--
> > >
> > > This is not an option for me because it is limit to one user, not more
> > than
> > > one and it override the "From: [EMAIL PROTECTED]" option in the $header
in
> > > mail()..  So, Finally there is a workaround to the problem and it is
> very
> > > simple  Just add this entrie to the /etc/hosts file in Unix or
> Linux.
> > > Just substitute the word in bracket for a value
> > > --clip--
> > > 
> > > --clip--
> > >
> > > Example ...
> > > --clip--
> > > 123.456.789.012  xyz.abc.com
> > > --clip--
> > >
> > > Make sure your machine do the search order with the host first before
> the
> > > DNS or Nameserver.  In my case in AIX, is "/etc/netsvc.conf".
> > >
> > > Hope
> > >
> > > Make sure your machine is set to read the host file first before the
DNS
> > or
> > > the nameserver, if not then make some changes to it.  In my case for
> AIX,
> > it
> > > is "/etc/netsvc.conf"...
> > >
> > > Hope this help
> > > --clip--
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
>
>



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




[PHP] Re: mail() using "Return-Path:" and "Error-To:"....

2003-02-19 Thread Scott Fletcher
Okay, saw the other posting I made earlier today and someone spoke about
using the 5th parameter, '[EMAIL PROTECTED]'.   So, I tried it and it work
with the "Return-Path:" and "Error-To:"...  Finally!!!  I have been working
on the sendmail problem for a week and now I'm glad to see it coming to an
end.

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hiya fellas
>
> I'm doing the test on sending emails and what I found is that I
haven't
> got these two to to work which is "Return-Path:" and "Error-To:"  Does
> anyone know why does it not work???  Here's my sample codes
>
> --clip--
>   $Header = "From: [EMAIL PROTECTED]\r\n";
>   $Header .= "Return-Path: [EMAIL PROTECTED]\r\n";
>   $Header .= "Error-To: [EMAIL PROTECTED]\r\n";
>   $Header .= "MIME-Version: 1.0\r\n";
>   $Header .= "Content-type: text/plain; charset=iso-8859-1\r\n";
>   $Header .= "X-Priority: 3\r\n";
>   $Header .= "X-MSMail-Priority: Normal\r\n";
>   $Header .= "X-Mailer: PHP ".phpversion()."\r\n";
>
>   mail([EMAIL PROTECTED],"test","This is a test",$Header);
> --clip--
>
>



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




[PHP] php.ini - PHP version 4.3.1 - CGI Error....

2003-03-10 Thread Scott Fletcher
I'm a little baffled and I'm wondering if anyone here can help me out on
this one...  I just upgraded the PHP from 4.0.6 to 4.3.1, yes I know the
upgrade is long overdue  Anyway, I just upgraded and update the php
scripts to work with newer versions but here is on part that I have not
figured out why is that.  By the way, I'm using IIS 5.0  The error message I
got are 

--clip--
CGI Error

The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
--clip--

Can anyone help me out?
 Thanks
  Scott Fletcher



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



[PHP] Please Help.. cgi.force_redirect does not work

2003-07-03 Thread Scott Fletcher
Hi!

To make the long story short, we use IIS 5.0 with PHP 4.0.6 for a while.
Then we builted a new database server, SQL-2000 and point the website to the
new server.  Then we notice the problem with the CGI error.  So, we last
week downloaded the PHP 4.3.3 and update the IIS with the newer PHP version
and set the cgi.force_redirect to zero in php.ini.  See example below
--snip--
; cgi.force_redirect is necessary to provide security running PHP as a CGI
under
; most web servers.  Left undefined, PHP turns this on by default.  You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
cgi.force_redirect = 0
--snip--

We still have problem with CGI error.  The use of php function, header() is
what cause the error.  Yes, the IIS and the website are reading the php.ini
correctly.  I checked that out and it is verified.

So, what is the workaround to the CGI error??

Thanks,
 Scott



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



[PHP] Re: Please Help.. cgi.force_redirect does not work

2003-07-03 Thread Scott Fletcher
Oddly, the CGI Error message is intermitted.  It come on some of the time
and some of the other time doesn't.  What is the problem here.?

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi!
>
> To make the long story short, we use IIS 5.0 with PHP 4.0.6 for a
while.
> Then we builted a new database server, SQL-2000 and point the website to
the
> new server.  Then we notice the problem with the CGI error.  So, we last
> week downloaded the PHP 4.3.3 and update the IIS with the newer PHP
version
> and set the cgi.force_redirect to zero in php.ini.  See example below
> --snip--
> ; cgi.force_redirect is necessary to provide security running PHP as a CGI
> under
> ; most web servers.  Left undefined, PHP turns this on by default.  You
can
> ; turn it off here AT YOUR OWN RISK
> ; **You CAN safely turn this off for IIS, in fact, you MUST.**
> cgi.force_redirect = 0
> --snip--
>
> We still have problem with CGI error.  The use of php function, header()
is
> what cause the error.  Yes, the IIS and the website are reading the
php.ini
> correctly.  I checked that out and it is verified.
>
> So, what is the workaround to the CGI error??
>
> Thanks,
>  Scott
>
>



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



[PHP] odbc_result...

2003-07-08 Thread Scott Fletcher
Hi!

   Is there a way to verify that odbc_resut($result,1) is successfull or
not.  I'm not talking about

--snip--
$result = odbc_exec($connect,$ask);
if ($result) { echo "Successfull!"; } else { echo "Failed!!"; }
--snip--

--snip--
$result = odbc_exec($connect,$ask);
$db_result = odbc_exec($result,1);
if ($db_result) { echo "Successfull!"; } else { echo "Failed!!"; }
--snip--

because it check on database connection, not whether is the SQL
Statement had been successfully execuated or failed.  What I'm looking for
is whether is the SQL Statement, 'INSERT' is successful or fail.  Not the
database connection.

Thanks!



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



Re: [PHP] PHP4 and PHP5 at one machine

2003-07-09 Thread Scott Fletcher
Well, it is not possible to run two seperate php4ts.dll file in the same
file path with the same file name even though they have different version.
One workaround to it would be to compile the older version into a different
file name while making sure the script point to that different file name but
it got to be tough to do that.  Because you'll be modifying the codes and
compile it, into windows files and so on.

"Milan Reznicek" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Yes all these things I know, because already I'm running these two
servers,
> but both with PHP4.
> But now I came accros the problem of "php4ts.dll". Because in both
versiones
> it has the same name. And if I have the old one my \WINNT\SYSTEM32 the
> server which is running PHP5 won't start, and if i put there the newer one
> the one with PHP4 won't start. That's my problem. Do you know how to solve
> this?
>
>
> Milan
>
> --
> --
> Milan Reznicek
> Software Developer
>
> e-mail:   [EMAIL PROTECTED]
> "Burhan Khalid" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > On Tuesday, July 8, 2003, 8:42:16 PM, Milan wrote:
> >
> > MR> is there any posibility to run PHP4 and PHP5 at one machine,
with
> two
> > MR> Apache servers running at the same time.
> >
> > MR> Windows 2000 SP3
> > MR> Apache 1.3.27/PHP 4.3.0
> > MR> Apache 2.0.46/PHP 5.0.0b1
> >
> > Yes it is possible. If you want both of the servers to be running at
> > one time, then you'll have to change the Listen directive on one of
> > them, since both will default to port 80. So, change one to something
> > else, like 8080. Then access it with the port number
> > http://address:port
> >
> > As far as the PHP install goes, you can have two PHP installs (one for
> > each server), you just have to make sure where the .ini files are
> > stored, and that the configuration directives for PHP (such as
> > LoadModule, etc.) point to the right direction for each server.
> >
> > I also believe that the Apache Service Monitor can handle more than
> > one Apache install, so you'll have a convienient place to control your
> > servers.
> >
> > --
> > Regards,
> > Burhan Khalid
> > phplist[at]meidomus[dot]com
> > http://www.meidomus.com
> >
>
>



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



Re: [PHP] Refresh PHP

2003-07-09 Thread Scott Fletcher
PHP session functions and $_SESSION work kind of funny with Internet
Explorer while this problem rarely happen in 3rd party browser due to the
bad design of Internet Explorer...  It's a microsoft problem.  I have this
similiar problem with Internet Explorer.  The workaround to the problem I
have is to eliminate the use of session_destroy().  Someone anyone login, a
new session token will be created anyway.  Shockingly, when going from one
webpage to another, Internet Explorer sometime grab a wrong session token.

"Mauricio" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ralph,
>
> Before anything, I would like to thank you for the time you are spending
> with my problem!
>
> Ok. I changed using $_SESSION and the problem still happens. I printed
both,
> $_SESSION and $HTTP_SESSION_VARS and they are the same... not the current
> user, but the last logged. It's funny that in the next page, after login,
if
> I print $_SESSION or $HTTP_SESSION_VARS they are right, but when I call
> another page (using a link), like some report, it appears the wrong user.
> All pages has the same header, setting no cache...
>
> any ideas?
>
> Thank you
>
> Mauricio Valente
>
> - Original Message -
> From: "Ralph Guzman" <[EMAIL PROTECTED]>
> To: "'Mauricio'" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 08, 2003 6:57 PM
> Subject: RE: [PHP] Refresh PHP
>
>
> > I though you were passing the variable through the url. If you have this
> > stored in a session, then try replacing $_GET with $_SESSION
> >
> > -Original Message-
> > From: Mauricio [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, July 08, 2003 1:56 PM
> > To: 'PHP'
> > Subject: Re: [PHP] Refresh PHP
> >
> > Doing this, it works. The variable 'url_variable' is changed when it
> > pass
> > over the if. But I don't want to use a get variable, it could be easily
> > changed by the users... its my problem...
> >
> > MaurĂ­cio Valente
> >
> > - Original Message -
> > From: "Ralph Guzman" <[EMAIL PROTECTED]>
> > To: "'Mauricio'" <[EMAIL PROTECTED]>; "'PHP'"
> > <[EMAIL PROTECTED]>
> > Sent: Tuesday, July 08, 2003 4:05 PM
> > Subject: RE: [PHP] Refresh PHP
> >
> >
> > > How about:
> > >
> > > if($_GET['url_variable'] != $url_variable){
> > >$url_variable = $_GET['url_variable'];
> > >session_register('url_variable')
> > > }
> > >
> > >
> > > -Original Message-
> > > From: Mauricio [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, July 08, 2003 11:14 AM
> > > To: PHP
> > > Subject: Re: [PHP] Refresh PHP
> > >
> > > Hello Ralph,
> > >
> > > Actually, after calling session_destroy() I reset those variables
> > > assigning
> > > an empty value like you said. But it still doesn't work. I did a test
> > > after
> > > destroying session variables, printing them. They are empty.
> > >
> > > Another weird thing is that when a login as "joao" them logoff,
> > exclude
> > > IE
> > > cache, going in Tools >> Internet Option..., and login again with
> > > another
> > > user, this way the variable are printed correctly.
> > >
> > > It happens in any windows version (95,98,ME,2K,XP) using IE 6.0 and
> > > Netscape
> > > 7.
> > >
> > >
> > >
> > > - Original Message -
> > > From: "Ralph Guzman" <[EMAIL PROTECTED]>
> > > To: "'Mauricio'" <[EMAIL PROTECTED]>
> > > Sent: Tuesday, July 08, 2003 2:11 PM
> > > Subject: RE: [PHP] Refresh PHP
> > >
> > >
> > > > Rather than using session_destroy() reset the session variable by
> > > > assigning it an empty value. For example, lets say your url looks
> > > > something like this:
> > > >
> > > > http://www.mydomain.com/?url_variable=Mauricio
> > > >
> > > > then do the following:
> > > >
> > > > if($_GET['url_variable'] != $url_variable){
> > > >$url_variable = "";
> > > >session_register('url_variable')
> > > > }
> > > >
> > > >
> > > > -Original Message-
> > > > From: Mauricio [mailto:[EMAIL PROTECTED]
> > > > Sent: Tuesday, July 08, 2003 7:02 AM
> > > > To: PHP
> > > > Subject: [PHP] Refresh PHP
> > > >
> > > > Hi people!
> > > >
> > > > Did anyone get this situation?
> > > >
> > > > I'm creating a Site that uses 3 session variables. One of them I
> > > always
> > > > print at the top of the page, it's the name of the user. There is a
> > > link
> > > > that calls the function session_destroy(). Everytime that I follow
> > > this
> > > > link
> > > > and log in with another user, that session variable printed doesn't
> > > > change,
> > > > but if I press F5 in IE or Netscape them it brings the right user. I
> > > > can't
> > > > make the page return the current user login, it always came with the
> > > > last
> > > > user logged. I tried to add some headers to set no cache in all php
> > > > pages,
> > > > but it doesn't work.
> > > >
> > > > Anyone can help me???
> > > >
> > > > Thanks
> > > >
> > > > PS: Sorry about my poor english...
> > > >
> > > >
> > > > MaurĂ­cio Valente
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubsc

[PHP] $_SESSION act funny...

2003-07-09 Thread Scott Fletcher
Noticed that if I assign data to a $_SESSION array and go to the next
webpage then you'll have that new data.  If you go to the next webpage by
using the same file (webpage) or a $_SERVER['PHP_SELF'], the data in the
$_SESSION array remain the same, it does not change as it should.  But if
you do the browser refresh, the data would remain the same which it should
be.

How do I do a workaround to the problem.  I would appreciate any help...

--snip--
< page1.php>>

Next Page";
?>
--snip--



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



  1   2   3   4   5   6   7   8   >