[PHP] $argv[] ??

2002-03-19 Thread Kancha .

I'm using php 4.1.0. In earlier versions of php i
could access parameters passed throught command line
as $argv[1], $argv[2] and so on. With the version that
i'm usign now it says undefined variable.

What is the new method of accessign command line
parameters ??

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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




Re: [PHP] apache, php user names

2002-03-19 Thread heinisch

At 18.03.2002  17:28, you wrote:
Even if I think you´ll not be able (should not be able) to put
files elswehere than /home/~myname:

On a shared hosting provider, I have an account like:

/home/~myname/www/
and
/home/~myname/resources/

As far as I know, apache can only access what's in the www directory and
below.

That depends on how the apache is configured but the place
/home/~myname/ could be a good place, as this couldn´t be listed by the
apache (means client). Mostly the documentroot for apache begins
in home/.../www/.

However,
php can include stuff from the resources directory. This is where it's
recommended to keep the database passwords.

How did the sysop, (not me), set this up?

(how does the world get made ;-) )

if your isp has not set the apache user explicit, it should be wwwrun/nogroup
but I hope he/she changed the user

What user/group would apache run as?
Also, what user/group would the php script be in, apache's?
Your script´s could be yourname/users (if apache belongs to users)

If you want to store passwords for mysql, check out if your ISP
supports the usage of .htaccess files in each directory, then
you can prevent the listing of the directory. Details can be found
www.apache.org  search the manual. Or you try to store these data
in /home/~myname/. If these files were not found, try an absolute path
when you include f.e. include /home/~myname/passwords.inc:
HTH Oliver


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




Re: [PHP] $argv[] ??

2002-03-19 Thread Jason Wong

On Tuesday 19 March 2002 16:18, Kancha . wrote:
 I'm using php 4.1.0. In earlier versions of php i
 could access parameters passed throught command line
 as $argv[1], $argv[2] and so on. With the version that
 i'm usign now it says undefined variable.

 What is the new method of accessign command line
 parameters ??

I think they're turned off by default.


Look in php.ini for

register_argc_argv = ??



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Preserve wildlife -- pickle a squirrel today!
*/

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




[PHP] Re: replace digits

2002-03-19 Thread liljim

Hi Marc,

try this:

$string = preg_replace(/^41/, 0, $string);

http://www.php.net/preg_replace

/ and / = delimiters
^ = start of string (line in multiline mode)

So, it translates as, replace a leading 41 in $string with 0.

..or try the ereg function, which has already been mentioned.

James


Marc Bleuler [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello all,

 Im trying to replace the first two digits (41) from a telephone no. with a
0
 (zero), like 41763334455 should end wit 0763334455. Anybody a idea howto?
My
 php programming experiance is not very high so if any body could provide a
 code example

 thank you very mutch for help
 Marc





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




[PHP] how to pass values to PHP by clicking on imagemap

2002-03-19 Thread Simon De Deyne

does anybody has a good suggestion for doing this?
I just would like to pass a number by clicking on an imagemap
to a php script...

Sorry for the novice-ity of this mail,
have a nice day!
simon


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




[PHP] Printing an array

2002-03-19 Thread Alexander Skwar

Hello!

I'd like to print an array kinda like the way it was created.  Ie., I've
got the following array:

$r[0][0]['name'] = 'joe';
$r[0][0]['gender'] = 'male';
$r[0][0]['prop'] = 'prefs';
$r[0][0][0]['text'] = 'mail';
$r[0][0][0]['set'] = 'yes';
$r[0][0][1]['text'] = 'phone';
$r[0][0][1]['set'] = 'no';

Now I'd like to have a function which I'd pass the array and get the
following output:

r[0][0]['name'] = 'joe'
r[0][0]['gender'] = 'male'
r[0][0]['prop'] = 'prefs'
r[0][0][0]['text'] = 'mail'
r[0][0][0]['set'] = 'yes'
r[0][0][1]['text'] = 'phone'
r[0][0][1]['set'] = 'no'

Right now, I've got the following not quite working function:

?php
function output($array, $name, $prefix = array()){
  foreach ($array as $key = $value){
if (! is_array($value)){
  if (0  count($prefix)){
// Prefix vorhanden
printf (%s%s[%s] = '%s'\n, $name, implode('', $prefix), $key, $value);
  } else {
// Kein Prefix angegeben
printf (%s[%s] = %s\n, $name, $key, $value);
  }
} else {
  $prefix[] = sprintf('[%s]', $key);
  output($value, $name, $prefix);
}
  }
}
?

This produces the following output:

r[0][0][name] = 'joe'
r[0][0][gender] = 'male'
r[0][0][prop] = 'prefs'
r[0][0][0][text] = 'mail'
r[0][0][0][set] = 'yes'
r[0][0][0][1][text] = 'phone'
r[0][0][0][1][set] = 'no'

As you can see in the line with phone, I've still got an error
somewhere.  The phone line should be:

r[0][0][1]['text'] = 'phone'

But it is:

r[0][0][0][1]['text'] = 'phone'

The 3rd [0] is too much.  This means, that I somehow need to get rid of
the 3rd [0].  It seems like I did not notice that I went up again in
the array.

Could somebody please help me in refining the function so that it works?

Thanks a lot!

-- 
  \  Alexander Skwar|  net-attach GmbH   \
   -+-X
  /  Web-Development and more   | http://www.net-attach.de   /
--
   Uptime: 1 day 1 hour 19 minutes

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




RE: [PHP] how to pass values to PHP by clicking on imagemap

2002-03-19 Thread Niklas Lampén

Just declare the link to have variable to be a number depending on point
where user clicks:

www.server.com/mypage.php?number=1

Now the variable $number is set to '1'.


Niklas

-Original Message-
From: Simon De Deyne [mailto:[EMAIL PROTECTED]] 
Sent: 19. maaliskuuta 2002 11:50
To: [EMAIL PROTECTED]
Subject: [PHP] how to pass values to PHP by clicking on imagemap


does anybody has a good suggestion for doing this?
I just would like to pass a number by clicking on an imagemap to a php
script...

Sorry for the novice-ity of this mail,
have a nice day!
simon


-- 
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: object reflection in php?

2002-03-19 Thread Filippo Veneri

Thanks to all who posted!

What i was looking for is
object_get_vars(), which,
for some reason, is not
present in my (offline) copy
of the manual.

Thanks again,

fbv

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




[PHP] EMAIL problem

2002-03-19 Thread Dani

Hi,

I have been trying to use a form to send an email.

I use the mail() function. But I have a bit of problem.
The email send does not display the email is from. So, for example I
send an email using my my webform then when I receive it the from
coloumn in my email browser says nobody.

how do I display this information? What should I write in the mail()
function?

thanks

Regards,
Ardani


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




Re: [PHP] Printing an array

2002-03-19 Thread scott furt

...because you never shrink $prefix

after output(), try array_pop($prefix);

Alexander Skwar wrote:
 Hello!
 
 I'd like to print an array kinda like the way it was created.  Ie., I've
 got the following array:
 
 $r[0][0]['name'] = 'joe';
 $r[0][0]['gender'] = 'male';
 $r[0][0]['prop'] = 'prefs';
 $r[0][0][0]['text'] = 'mail';
 $r[0][0][0]['set'] = 'yes';
 $r[0][0][1]['text'] = 'phone';
 $r[0][0][1]['set'] = 'no';
 
 Now I'd like to have a function which I'd pass the array and get the
 following output:
 
 r[0][0]['name'] = 'joe'
 r[0][0]['gender'] = 'male'
 r[0][0]['prop'] = 'prefs'
 r[0][0][0]['text'] = 'mail'
 r[0][0][0]['set'] = 'yes'
 r[0][0][1]['text'] = 'phone'
 r[0][0][1]['set'] = 'no'
 
 Right now, I've got the following not quite working function:
 
 ?php
 function output($array, $name, $prefix = array()){
   foreach ($array as $key = $value){
 if (! is_array($value)){
   if (0  count($prefix)){
 // Prefix vorhanden
 printf (%s%s[%s] = '%s'\n, $name, implode('', $prefix), $key, $value);
   } else {
 // Kein Prefix angegeben
 printf (%s[%s] = %s\n, $name, $key, $value);
   }
 } else {
   $prefix[] = sprintf('[%s]', $key);
   output($value, $name, $prefix);
 }
   }
 }
 ?
 
 This produces the following output:
 
 r[0][0][name] = 'joe'
 r[0][0][gender] = 'male'
 r[0][0][prop] = 'prefs'
 r[0][0][0][text] = 'mail'
 r[0][0][0][set] = 'yes'
 r[0][0][0][1][text] = 'phone'
 r[0][0][0][1][set] = 'no'
 
 As you can see in the line with phone, I've still got an error
 somewhere.  The phone line should be:
 
 r[0][0][1]['text'] = 'phone'
 
 But it is:
 
 r[0][0][0][1]['text'] = 'phone'
 
 The 3rd [0] is too much.  This means, that I somehow need to get rid of
 the 3rd [0].  It seems like I did not notice that I went up again in
 the array.
 
 Could somebody please help me in refining the function so that it works?
 
 Thanks a lot!
 
 



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




Re: [PHP] $argv[] ??

2002-03-19 Thread Kancha .


 On Tuesday 19 March 2002 16:18, Kancha . wrote:
  I'm using php 4.1.0. In earlier versions of php i
  could access parameters passed throught command
 line
  as $argv[1], $argv[2] and so on. With the version
 that
  i'm usign now it says undefined variable.
 
  What is the new method of accessign command line
  parameters ??
 
 I think they're turned off by default.
 
 
 Look in php.ini for
 
 register_argc_argv = ??
 

i have turned it on but still doesn't work. 


__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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




Re: [PHP] EMAIL problem

2002-03-19 Thread scott furt

you have to tell mail() who the email is from.

add in a header similar to: From: [EMAIL PROTECTED]
(read the docs for mail() for syntax)

Dani wrote:
 Hi,
 
 I have been trying to use a form to send an email.
 
 I use the mail() function. But I have a bit of problem.
 The email send does not display the email is from. So, for example I
 send an email using my my webform then when I receive it the from
 coloumn in my email browser says nobody.
 
 how do I display this information? What should I write in the mail()
 function?
 
 thanks
 
 Regards,
 Ardani
 
 
 



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




[PHP] Please explain...

2002-03-19 Thread Jan Rademaker

Can someone explain why this works?

$x = 0;
if ($x == foo) {
print yeah;
}

This prints 'yeah', but i can't figure out why...

-- 
Jan Rademaker [EMAIL PROTECTED]
http://www.ottobak.com



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




[PHP] Clear Form Details

2002-03-19 Thread Ramesh Nagendra Pillai

Hai 
I am new bie to PHP Can any one please give me a
solution for my problem
Thanx in Advance

I am using an form in an PHP page and I am submitting
it to the same page, 
After Submitting the form I want to clear the form
details.Please tell how to 
clear the form.

Code in first.php is

form name=first acion=?PHP_SELF? method=post
 input type=text name=first
value=?=$first?
 input type=text name=second
value=?=$second?
 input type=text name=third
value=?=$third?
 input type=submit value=submit
name=submit
/form

After submitting the form I want to Clear all the
textboxes.

With Regards
Ramesh.N

=
Take care.
Bye..Bye...

With Regards
Ramesh.N

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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




Re: [PHP] Printing an array

2002-03-19 Thread Alexander Skwar

»scott furt« sagte am 2002-03-19 um 05:28:51 -0500 :
 ...because you never shrink $prefix
 
 after output(), try array_pop($prefix);

Awesome!  This works!  *THANKS* a lot!  I was fighting with this for a
whole day :)

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 23 hours 34 minutes

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




RE: [PHP] Please explain...

2002-03-19 Thread Rudolf Visagie

I would guess that the string foo evaluates to integer 0 in the comparison
because $x is an integer, so that $x = 0 = true 
Use === (in PHP 4) to do type checking as well.

Rudolf Visagie
Principal Software Developer
Digital Healthcare Solutions
mailto:[EMAIL PROTECTED]
Tel: 011 2655478
Cell: 082 895 1598


-Original Message-
From: Jan Rademaker [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 12:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Please explain...


Can someone explain why this works?

$x = 0;
if ($x == foo) {
print yeah;
}

This prints 'yeah', but i can't figure out why...

-- 
Jan Rademaker [EMAIL PROTECTED]
http://www.ottobak.com



-- 
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] Please explain...

2002-03-19 Thread Alex Vargas

Because you are telling the parser to compare a numeric variable against
something called foo which (in your context) has to be numerical too.
Since foo has not been given any value, the parser defaults it to 0. So
foo = 0. So is true that foo=$x=0.

Alex.

- Original Message -
From: Jan Rademaker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 19, 2002 11:30 AM
Subject: [PHP] Please explain...


 Can someone explain why this works?

 $x = 0;
 if ($x == foo) {
 print yeah;
 }

 This prints 'yeah', but i can't figure out why...

 --
 Jan Rademaker [EMAIL PROTECTED]
 http://www.ottobak.com



 --
 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] Please explain...

2002-03-19 Thread Alexander Skwar

»Rudolf Visagie« sagte am 2002-03-19 um 12:19:04 +0200 :
 I would guess that the string foo evaluates to integer 0 in the comparison

Hmm, shouldn't a filled string (foo) evaluate to TRUE, ie. to 1?

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 23 hours 44 minutes

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




RE: [PHP] Please explain...

2002-03-19 Thread Rudolf Visagie

Yes, if you were comparing to a boolean, but in this case you are comparing
to an integer.

-Original Message-
From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 12:51 PM
To: Rudolf Visagie
Cc: Jan Rademaker; [EMAIL PROTECTED]
Subject: Re: [PHP] Please explain...


»Rudolf Visagie« sagte am 2002-03-19 um 12:19:04 +0200 :
 I would guess that the string foo evaluates to integer 0 in the
comparison

Hmm, shouldn't a filled string (foo) evaluate to TRUE, ie. to 1?

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 23 hours 44 minutes

-- 
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] Please explain...

2002-03-19 Thread Rudolf Visagie

For interest's sake the following code:

$x = 0;
if ($x == foo) {
echo This is an integer comparison with foo being .$x.br;
}
$y = true;
if ($y == foo) {
echo This is a boolean comparison with foo being .$y.br;
}

prints:

This is an integer comparison with foo being 0
This is a boolean comparison with foo being 1

Cheers

-Original Message-
From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 12:51 PM
To: Rudolf Visagie
Cc: Jan Rademaker; [EMAIL PROTECTED]
Subject: Re: [PHP] Please explain...


»Rudolf Visagie« sagte am 2002-03-19 um 12:19:04 +0200 :
 I would guess that the string foo evaluates to integer 0 in the
comparison

Hmm, shouldn't a filled string (foo) evaluate to TRUE, ie. to 1?

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 23 hours 44 minutes

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




[PHP] 100% repeatable problem with PHP 4.0.1 in WIN2k environment.

2002-03-19 Thread Balaji Ankem


Hi,
  I am able to produce the following problem 100% in WINDOWS. 

  Problem is u can not produce success message in new browser context ..

Error: php.exe has generated some errors and will be closed by
windows.

  I am facing this problem from last 1 year.

Files

Login.html 
==

!DOCTYPE html public -//w3c//dtd html 4.0 transitional//en
html

body ONLOAD=document.login.emp_id.focus()
font face=arial 
   brbrcenter  h1 WELCOME TO LOGIN PAGE /h1/centerbrbr
center
 form name=login method=post action=./authentication.php
 table border=0 width=100%
 center
 trtd width=50% align=rightbfont size=2
face=ArialEmployee Nonbsp;/font/b/tdtd width=5%/tdtd
width=50%input type=text size=10 name=emp_id maxlength=10
value=/td/tr
 trtd width=50% align=rightbfont size=2
face=ArialPasswordnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/font/
b/tdtd width=5%/tdtd width=50% input type=password
size=10 name=emp_pass maxlength=10 value=/td/tr
 tr
td width=50% align=right
p align=left

/td
td width=5%
/td
td width=50%
p align=left input type=submit
Value=LOGIN/td
 /tr

 /center
/table
/center
/form
/body
/html
===

Authentication.php

?php

// Connect to MySQL

if (isset ($HTTP_POST_VARS{emp_id})  isset
($HTTP_POST_VARS{emp_pass}))
{
$connection=mysql_connect( 'localhost', 'balaji',
'pingpong' )
or die ( 'Unable to connect to server.'
);

// Select database on MySQL server

mysql_select_db( 'amerm' ) or die ( 'Unable to select
database.' );

// Formulate the query


$sql = SELECT * FROM employee WHERE emp_id = '$emp_id'
AND  emp_pass = PASSWORD('$emp_pass');

// Execute the query and put results in $result

$result = mysql_query( $sql )   or die ( 'Unable to
execute query.' );

// Get number of rows in $result.

$num = mysql_numrows( $result );



if ( $num != 0 )
{
$row = mysql_fetch_object($result);

// A matching row was found - the user is
authenticated.
//start a new session by registering the
employee number.
session_start();
session_register(user,pw);
$user=$emp_id;
$pw  =$emp_pass;

//This is the value from employee table ..just
simplified for simulating this problem

  $n=2; 

if ($n==2)
{
//close mysql connection
mysql_close($connection);
header(Location: success.php);
exit;
}
}

else
{
//close mysql connection
mysql_close($connection);
//User does not exist or not authenticated.
header(Location:not_authorized.html);
exit;
}
}

else
{
//User does not exist or not authenticated.
header(Location:wrongusage.html);
exit;
}
?
=

Success.php


?php


echo you have logged in successfully!br;

echo Session variablesbr;

echo $HTTP_SESSION_VARS[user].$HTTP_SESSION_VARS[pw];

?

===

Can anybody tell me what is causing the problem.

Any help would be very appreciable.

Thanks in advance
Balaji



**Disclaimer
  


Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.



 



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


Re: [PHP] Please explain...

2002-03-19 Thread Andrey Hristov

AFAIK the problem reported comes from that $x is on the left but foo is on the right.
so you convert foo to int, and because there is not digit in foo it is 0.
?php
$a=4some;
$b=$a+2;
var_dump($b);
?
int(6)

?php
$x=0;
if ($x==foo) echo foobar;
?
?php
$x=1;
if (foo==$x) echo fubar; // same with ===
?
Output:
foobar

foo evaluates as 0 in the comparison.

Andrey


- Original Message -
From: Rudolf Visagie [EMAIL PROTECTED]
To: Alexander Skwar [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, March 19, 2002 1:01 PM
Subject: RE: [PHP] Please explain...


For interest's sake the following code:

$x = 0;
if ($x == foo) {
echo This is an integer comparison with foo being .$x.br;
}
$y = true;
if ($y == foo) {
echo This is a boolean comparison with foo being .$y.br;
}

prints:

This is an integer comparison with foo being 0
This is a boolean comparison with foo being 1

Cheers

-Original Message-
From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 12:51 PM
To: Rudolf Visagie
Cc: Jan Rademaker; [EMAIL PROTECTED]
Subject: Re: [PHP] Please explain...


»Rudolf Visagie« sagte am 2002-03-19 um 12:19:04 +0200 :
 I would guess that the string foo evaluates to integer 0 in the
comparison

Hmm, shouldn't a filled string (foo) evaluate to TRUE, ie. to 1?

Alexander Skwar
--
How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
Homepage: http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 23 hours 44 minutes

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




Fw: [PHP] 100% repeatable problem with PHP 4.0.1 in WIN2k environment.

2002-03-19 Thread TV Karthick Kumar


- Original Message -
From: TV Karthick Kumar [EMAIL PROTECTED]
To: Balaji Ankem [EMAIL PROTECTED]
Sent: Tuesday, March 19, 2002 12:35 PM
Subject: Re: [PHP] 100% repeatable problem with PHP 4.0.1 in WIN2k
environment.


 Hi,

 From the surface leve, it looks like your php.exe corrupted and
probably
 crashed ?. Or doesn't works properly with your webserver, PWS, Apache or
 whatever you have ?. But I don't know how did you manage to work with such
a
 *thing* for the past 1 year ?.

 Karthick


 
  Hi,
I am able to produce the following problem 100% in WINDOWS.
 
Problem is u can not produce success message in new browser context ..
 
  Error: php.exe has generated some errors and will be closed by
  windows.
 
I am facing this problem from last 1 year.
 
  Files
 
  Login.html
  ==
 
  !DOCTYPE html public -//w3c//dtd html 4.0 transitional//en
  html
 
  body ONLOAD=document.login.emp_id.focus()
  font face=arial 
 brbrcenter  h1 WELCOME TO LOGIN PAGE /h1/centerbrbr
  center
   form name=login method=post action=./authentication.php
   table border=0 width=100%
   center
   trtd width=50% align=rightbfont size=2
  face=ArialEmployee Nonbsp;/font/b/tdtd width=5%/tdtd
  width=50%input type=text size=10 name=emp_id maxlength=10
  value=/td/tr
   trtd width=50% align=rightbfont size=2
  face=ArialPasswordnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/font/
  b/tdtd width=5%/tdtd width=50% input type=password
  size=10 name=emp_pass maxlength=10 value=/td/tr
   tr
td width=50% align=right
p align=left
 
/td
td width=5%
/td
td width=50%
p align=left input type=submit
  Value=LOGIN/td
   /tr
 
   /center
  /table
  /center
  /form
  /body
  /html
  ===
 
  Authentication.php
  
  ?php
 
  // Connect to MySQL
 
  if (isset ($HTTP_POST_VARS{emp_id})  isset
  ($HTTP_POST_VARS{emp_pass}))
  {
  $connection=mysql_connect( 'localhost', 'balaji',
  'pingpong' )
  or die ( 'Unable to connect to server.'
  );
 
  // Select database on MySQL server
 
  mysql_select_db( 'amerm' ) or die ( 'Unable to select
  database.' );
 
  // Formulate the query
 
 
  $sql = SELECT * FROM employee WHERE emp_id = '$emp_id'
  AND  emp_pass = PASSWORD('$emp_pass');
 
  // Execute the query and put results in $result
 
  $result = mysql_query( $sql )   or die ( 'Unable to
  execute query.' );
 
  // Get number of rows in $result.
 
  $num = mysql_numrows( $result );
 
 
 
  if ( $num != 0 )
  {
  $row = mysql_fetch_object($result);
 
  // A matching row was found - the user is
  authenticated.
  //start a new session by registering the
  employee number.
  session_start();
  session_register(user,pw);
  $user=$emp_id;
  $pw  =$emp_pass;
 
  //This is the value from employee table ..just
  simplified for simulating this problem
 
$n=2;
 
  if ($n==2)
  {
  //close mysql connection
  mysql_close($connection);
  header(Location: success.php);
  exit;
  }
  }
 
  else
  {
  //close mysql connection
  mysql_close($connection);
  //User does not exist or not authenticated.
  header(Location:not_authorized.html);
  exit;
  }
  }
 
  else
  {
  //User does not exist or not authenticated.
  header(Location:wrongusage.html);
  exit;
  }
  ?
  =
 
  Success.php
  
 
  ?php
 
 
  echo you have logged in successfully!br;
 
  echo Session variablesbr;
 
  echo $HTTP_SESSION_VARS[user].$HTTP_SESSION_VARS[pw];
 
  ?
 
  ===
 
  Can anybody tell me what is causing the problem.
 
  Any help would be very appreciable.
 
  Thanks in advance
  Balaji
 
 


 --
--
 


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



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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




RE: [PHP] 100% repeatable problem with PHP 4.0.1 in WIN2k environment.

2002-03-19 Thread Balaji Ankem

Hi! Karthik,
Thankyou for reply!!!
You too will get if u try to execute the following files..
This is not the problem with php.exe.
Every one will get if anybody try to execute the following
logic.

You asked me how u r managing the problem..

I am managing like following:

1. Remove the if condition (if $n==2) from authentication.php
and execute ..
  2. Now replace that if condition and now try to execute then
problem will be solved.


Best Regards
Balaji


-Original Message-
From: TV Karthick Kumar [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 19, 2002 5:06 PM
To: Balaji Ankem
Subject: Re: [PHP] 100% repeatable problem with PHP 4.0.1 in WIN2k
environment.


Hi,

From the surface leve, it looks like your php.exe corrupted and
probably crashed ?. Or doesn't works properly with your webserver, PWS,
Apache or whatever you have ?. But I don't know how did you manage to
work with such a
*thing* for the past 1 year ?.

Karthick



 Hi,
   I am able to produce the following problem 100% in WINDOWS.

   Problem is u can not produce success message in new browser context 
 ..

 Error: php.exe has generated some errors and will be closed by 
 windows.

   I am facing this problem from last 1 year.

 Files

 Login.html
 ==

 !DOCTYPE html public -//w3c//dtd html 4.0 transitional//en html

 body ONLOAD=document.login.emp_id.focus()
 font face=arial 
brbrcenter  h1 WELCOME TO LOGIN PAGE /h1/centerbrbr

 center  form name=login method=post 
 action=./authentication.php  table border=0 width=100%
  center
  trtd width=50% align=rightbfont size=2
 face=ArialEmployee Nonbsp;/font/b/tdtd width=5%/tdtd
 width=50%input type=text size=10 name=emp_id maxlength=10
 value=/td/tr
  trtd width=50% align=rightbfont size=2

face=ArialPasswordnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;/font/
 b/tdtd width=5%/tdtd width=50% input type=password
 size=10 name=emp_pass maxlength=10 value=/td/tr  tr
   td width=50% align=right
   p align=left

   /td
   td width=5%
   /td
   td width=50%
   p align=left input type=submit
 Value=LOGIN/td
  /tr

  /center
 /table
 /center
 /form
 /body
 /html
 ===

 Authentication.php
 
 ?php

 // Connect to MySQL

 if (isset ($HTTP_POST_VARS{emp_id})  isset
 ($HTTP_POST_VARS{emp_pass}))
 {
 $connection=mysql_connect( 'localhost', 'balaji',
 'pingpong' )
 or die ( 'Unable to connect to server.'
 );

 // Select database on MySQL server

 mysql_select_db( 'amerm' ) or die ( 'Unable to select database.' );

 // Formulate the query


 $sql = SELECT * FROM employee WHERE emp_id = '$emp_id'
 AND  emp_pass = PASSWORD('$emp_pass');

 // Execute the query and put results in $result

 $result = mysql_query( $sql )   or die ( 'Unable to
 execute query.' );

 // Get number of rows in $result.

 $num = mysql_numrows( $result );



 if ( $num != 0 )
 {
 $row = mysql_fetch_object($result);

 // A matching row was found - the user is
 authenticated.
 //start a new session by registering the
 employee number.
 session_start();
 session_register(user,pw);
 $user=$emp_id;
 $pw  =$emp_pass;

 //This is the value from employee table ..just
 simplified for simulating this problem

   $n=2;

 if ($n==2)
 {
 //close mysql connection
 mysql_close($connection);
 header(Location: success.php);
 exit;
 }
 }

 else
 {
 //close mysql connection
 mysql_close($connection);
 //User does not exist or not authenticated. 
 header(Location:not_authorized.html);
 exit;
 }
 }

 else
 {
 //User does not exist or not authenticated. 
 header(Location:wrongusage.html);
 exit;
 }
 ?
 =

 Success.php
 

 ?php


 echo you have logged in successfully!br;

 echo Session variablesbr;

 echo $HTTP_SESSION_VARS[user].$HTTP_SESSION_VARS[pw];

 ?

 ===

 Can anybody tell me what is causing the problem.

 Any help would be very appreciable.

 Thanks in advance
 Balaji









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


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



**Disclaimer
  


Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.



 



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

Re: [PHP] 100% repeatable problem with PHP 4.0.1 in WIN2k environment.

2002-03-19 Thread scott furt

Have you examined the PHP error logs?

Have you turned up error reporting to the max (E_ALL)
and examined what it returned?

Have you examined $php_errmsg (if configured in php.ini)?

Have you tried putting echo statements every few lines
to see exactly where and why the script dies?

Balaji Ankem wrote:
 Hi,
   I am able to produce the following problem 100% in WINDOWS. 
 
   Problem is u can not produce success message in new browser context ..
 
   Error: php.exe has generated some errors and will be closed by
 windows.
 
   I am facing this problem from last 1 year.
 


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




RE: [PHP] Please explain...

2002-03-19 Thread Rudolf Visagie

Agreed. I thought that the type of the variable on the left of the
comparison had something to do with it, but then I ran this code:

$x = 0;
if (foo == $x) {
echo This is an integer comparison with foo being .$x. and on the
left of the comparisonbr;
}
$y = true;
if (foo == $y) {
echo This is a boolean comparison with foo being .$y. and on the
left of the comparisonbr;
}

and the output is:

This is an integer comparison with foo being 0 and on the left of the
comparison
This is a boolean comparison with foo being 1 and on the left of the
comparison

So all that I can think is that there is a type precedence in == comparisons
with numbers and boolean variables taking precedence over strings. Any
ideas?

-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 1:37 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Please explain...


AFAIK the problem reported comes from that $x is on the left but foo is on
the right.
so you convert foo to int, and because there is not digit in foo it is
0.
?php
$a=4some;
$b=$a+2;
var_dump($b);
?
int(6)

?php
$x=0;
if ($x==foo) echo foobar;
?
?php
$x=1;
if (foo==$x) echo fubar; // same with ===
?
Output:
foobar

foo evaluates as 0 in the comparison.

Andrey


- Original Message -
From: Rudolf Visagie [EMAIL PROTECTED]
To: Alexander Skwar [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, March 19, 2002 1:01 PM
Subject: RE: [PHP] Please explain...


For interest's sake the following code:

$x = 0;
if ($x == foo) {
echo This is an integer comparison with foo being .$x.br;
}
$y = true;
if ($y == foo) {
echo This is a boolean comparison with foo being .$y.br;
}

prints:

This is an integer comparison with foo being 0
This is a boolean comparison with foo being 1

Cheers

-Original Message-
From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 12:51 PM
To: Rudolf Visagie
Cc: Jan Rademaker; [EMAIL PROTECTED]
Subject: Re: [PHP] Please explain...


»Rudolf Visagie« sagte am 2002-03-19 um 12:19:04 +0200 :
 I would guess that the string foo evaluates to integer 0 in the
comparison

Hmm, shouldn't a filled string (foo) evaluate to TRUE, ie. to 1?

Alexander Skwar
--
How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
Homepage: http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 23 hours 44 minutes

--
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] More on: how to send a file to the user's browser?

2002-03-19 Thread scott furt

Are you using MSIE?

what file extension are you testing with?

i was having similar problems using this technique
with PDF files.  only with MSIE, sometimes it would
print text crap to the screen and sometimes it
would prompt for download.

MSIE is notorious for disregarding headers and
trying to handle files off of their extensions.

Carlos Fernando Scheidecker Antunes wrote:
 Hi Mark,
 
 It does not work. What it does is to echo the thing to the screen.
 
 How can I force the browser to download it with its original file name?
 
 
 
 - Original Message -
 From: Mark Heintz PHP Mailing Lists [EMAIL PROTECTED]
 To: Carlos Fernando Scheidecker Antunes [EMAIL PROTECTED]
 Cc: PHP-GENERAL [EMAIL PROTECTED]
 Sent: Monday, March 18, 2002 5:01 PM
 Subject: Re: [PHP] how to send a file to the user's browser?
 
 
 
 A couple more headers than absolutely necessary, but this should work:
 
 ?php
 // open file and send to user
 if($fp = fopen($downloadfile, r)){
   // output headers
   $downloadsize = filesize($downloadfile);
   header ( Expires: Mon, 1 Apr 1974 05:00:00 GMT );
   header ( Last-Modified:  . gmdate(D,d M YH:i:s T) );
   header ( Pragma: no-cache );
   header ( Content-type: application/octet-stream; name=$downloadfile );
   header ( Content-length: $downloadsize );
   header ( Content-Disposition: attachment; filename=$downloadfile );
   // read out file
   fpassthru($fp);
   fclose($fp);
 } else {
   // can't open file
 }
 ?
 
 
 mh.
 
 
 On Mon, 18 Mar 2002, Carlos Fernando Scheidecker Antunes wrote:
 
 
Hello all,

I've got a script that generates a txt file, compresses it into a Zip file

 and it all happens on a directory that is out of apache's web site.
 
This script generates the file based on MySQL server information and I

 have it then sent to the user's e-mail address. What I would like to do is
 to make the PHP script throw the file to the user's browser so that it
 would download it automatically. This file is created on a directory that is
 not the same as the web server where the pages and php scripts are located.
 
Anyone could help me with that?

Thanks.

regards,

Carlos Fernando Scheidecker Antunes
Linux User #207984



 
 
 --
 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] Please explain...

2002-03-19 Thread bvr


This is because of type conversion, see also manual chapter 'Type juggling'.

foo converted to integer type is also zero, if you try 1foo for 
example, it will convert to one.

if you want to check without type conversion use the === operator instead.

bvr.


Jan Rademaker wrote:

Can someone explain why this works?

$x = 0;
if ($x == foo) {
   print yeah;
}

This prints 'yeah', but i can't figure out why...





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




[PHP] session problems

2002-03-19 Thread Negrea Mihai

Hi!

I have a problem with sessions. I have an application that runs in a browser 
and on some menu's it window.opens other windows with the same session.

let's say that on the main window I have the interface to a tool to do 
traceroute to a host. In that main window I enter the host to traceroute to 
and click submit. The form is submitted to another script in a new window  
with the PHPSESSID in the url because only authenticated users are allowed to 
use the tool.
The secondary window takes the value of the host from the $_POST and runs 
traceroute and waits for it to finish to display the output.
The problem is if I minimize the secondary window and try to go to another 
menu on the main window before traceroute finishes... I believe that the main 
script cannot get a lock on the session file and hangs on session_start().
What could I do to make the second script have read-only access to the 
session file.. not interrupting the activity of the main script.

Thanks,

Mihai

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




RE: [PHP] 100% repeatable problem with PHP 4.0.1 in WIN2k environment.

2002-03-19 Thread Balaji Ankem

Hi scott,

Yes I examined..
It z dying in if loop (if $n==2) at the statement header(Location:
success.php);
 
It will be helpful to me if u try to execute those files as I told.

Thanks in advance
Balaji

-Original Message-
From: scott furt [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 19, 2002 5:26 PM
To: php
Subject: Re: [PHP] 100% repeatable problem with PHP 4.0.1 in WIN2k
environment.


Have you examined the PHP error logs?

Have you turned up error reporting to the max (E_ALL)
and examined what it returned?

Have you examined $php_errmsg (if configured in php.ini)?

Have you tried putting echo statements every few lines
to see exactly where and why the script dies?

Balaji Ankem wrote:
 Hi,
   I am able to produce the following problem 100% in WINDOWS.
 
   Problem is u can not produce success message in new browser context 
 ..
 
   Error: php.exe has generated some errors and will be closed by 
 windows.
 
   I am facing this problem from last 1 year.
 


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



**Disclaimer
  


Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.



 



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


[PHP] Calling Javascript-function from php-script ...

2002-03-19 Thread Marcel Besancon

Hi everybody,

is there someone who can tell me how to call a javascript-function by a
php-script.

Thanks for each answer

Marcel

--
registered Fli4l-User #0388



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




Re: [PHP] No Sense: [PHP] Update: [PHP] Weird?

2002-03-19 Thread scott furt

*shakes head*  i know that $date is a string.

your script is failing because you are trying to
write to directory C:\\ccl_www\\$date, which
does not exist.  you have to create it before
you try and write files into it.

jtjohnston wrote:
 No!? $date is a string?!
 
 $date = date (MD);
 
 How does that make a difference?
 
 $to_path = c:\\ccl_www\\.$date.\\ccl_www\\;
 
 You want me to change it to:
 
 $to_path = c:\\ccl_www\\$date\\ccl_www\\;
 
 Does anyone follow why?
 
 
Scott Furt wrote:

 
I meant, have you created a physical directory
named $date?
That's your problem.  There's no directory named $date on your computer, and
you're
trying to write files into a non-existent directory.

jtjohnston wrote:

I have created date :)
$date = date (MD);
That's not it. It seems to fail at one level or another, I think, becuase the
function calls itself - and probably gets lost somehow.
John



... i think you might have to create the
$date directory before writing a file to it.
writing to /tmp/dir/file.txt will fail if
the directory dir doesn't exist.


?php

###
$date = date (MD);
###
###  Don't forget trailing slash  #
###
$from_path = c:\\program files\\easyphp\\ccl_www\\;
$to_path = c:\\ccl_www\\.$date.ccl_www\\;
###

if(!is_dir($from_path))
{
echo failed;
exit;
}else{
rec_copy($from_path, $to_path);
echo files copies from $from_path and backed up to $to_path;
}

#
function rec_copy ($from_path, $to_path) {
if(!is_dir($to_path))
mkdir($to_path, 0777);

$this_path = getcwd();
 if (is_dir($from_path))
 {
chdir($from_path);
$handle=opendir('.');

while (($file = readdir($handle))!==false)
{
 if (($file != .)  ($file != ..)) {
  if (is_dir($file))
  {
  rec_copy ($from_path.$file./,  $to_path.$file./);
   chdir($from_path);
  }else{
#  echo error if (is_dir($file))br;
  }
  if (is_file($file))
  {
  copy($from_path.$file, $to_path.$file);
  }else{
#  echo error copy($from_path.$file, $to_path.$file)br;
  }
 }#end (($file != .)
}#end while (($file

closedir($handle);
 }# end if (is_dir
 else{
# echo if (is_dir($from_path))br;
 }
}# end function

?


 
 --
 John Taylor-Johnston
 -
   ' ' '   Collège de Sherbrooke:
  ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
- Université de Sherbrooke:
   http://compcanlit.ca/
   819-569-2064
 
 
 
 



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




Re: [PHP] Copy *.*

2002-03-19 Thread scott furt

Or, if you're on a *nix platform, try using 'tar'
to tar up the entire directory tree, copy the
'tar' file and un-tar it.

or 'cp -R' should work too.

Martin Towell wrote:
 Does xcopy support long file names?
 
 -Original Message-
 From: Robert V. Zwink [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, March 19, 2002 2:17 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP] Copy *.*
 
 
 You'll probably have the most success using the system() function to execute
 the xcopy command.  You shouldn't need to rewrite xcopy in php, seems like
 overkill.
 
 See: http://www.php.net/manual/en/function.system.php
 
 Here's the result of C:\xcopy /?
 
 XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
[/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U]
[/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z]
[/EXCLUDE:file1[+file2][+file3]...]
 
   source   Specifies the file(s) to copy.
   destination  Specifies the location and/or name of new files.
   /A   Copies only files with the archive attribute set,
doesn't change the attribute.
   /M   Copies only files with the archive attribute set,
turns off the archive attribute.
   /D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
   /EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings.  When any of
 the
strings match any part of the absolute path of the file to be
copied, that file will be excluded from being copied.  For
example, specifying a string like \obj\ or .obj will exclude
all files underneath the directory obj or all files with the
.obj extension respectively.
   /P   Prompts you before creating each destination file.
   /S   Copies directories and subdirectories except empty ones.
   /E   Copies directories and subdirectories, including empty ones.
Same as /S /E. May be used to modify /T.
   /V   Verifies each new file.
   /W   Prompts you to press a key before copying.
   /C   Continues copying even if errors occur.
   /I   If destination does not exist and copying more than one file,
assumes that destination must be a directory.
   /Q   Does not display file names while copying.
   /F   Displays full source and destination file names while
 copying.
   /L   Displays files that would be copied.
   /H   Copies hidden and system files also.
   /R   Overwrites read-only files.
   /T   Creates directory structure, but does not copy files. Does
 not
include empty directories or subdirectories. /T /E includes
empty directories and subdirectories.
   /U   Copies only files that already exist in destination.
   /K   Copies attributes. Normal Xcopy will reset read-only
 attributes.
   /N   Copies using the generated short names.
   /O   Copies file ownership and ACL information.
   /X   Copies file audit settings (implies /O).
   /Y   Suppresses prompting to confirm you want to overwrite an
existing destination file.
   /-Y  Causes prompting to confirm you want to overwrite an
existing destination file.
   /Z   Copies networked files in restartable mode.
 
 The switch /Y may be preset in the COPYCMD environment variable.
 This may be overridden with /-Y on the command line.
 
 -Original Message-
 From: jtjohnston [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, March 17, 2002 3:10 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Copy /
 
 
 Does anyone know of another snippet any place where I can copy *.*
 (files and all sub-directories) from one drive to another? In other
 words, a backing-up function. The snippet I got from
 http://www.php.net/manual/en/function.copy.php has been a disaster.
 
 John
 
 
 --
 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] Cookie Woes

2002-03-19 Thread scott furt

because the first argument of Setcookie is the name
of the cookie you want to set.
(and what the variable will be called on subsequent pages)

SetCookie('username', $username ...) will do what
you're expecting.

Jesse Warden wrote:
 I performed a:
 setCookie($username, $username, time()+3600,, , 0);
 echo header(Location: projects.php);
 
 ... on a php page that deals with a form submission.  However, when I get to
 projects.php, it claims $username doesn't exist.  The book said that to get
 a variable from a cookie, all I need to do is call a variable name that is
 the same name as what I named the cookie.
 
 Any suggestions?
 
 TIA,
 
 J
 
 
 ** Scanned for Viruses **
 
 



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




RE: [PHP] Calling Javascript-function from php-script ...

2002-03-19 Thread Niklas Lampén

AFAK it's not possible since PHP is server-side and I guess your
JavaScript is client-side.


Niklas


-Original Message-
From: Marcel Besancon [mailto:[EMAIL PROTECTED]] 
Sent: 19. maaliskuuta 2002 14:05
To: [EMAIL PROTECTED]
Subject: [PHP] Calling Javascript-function from php-script ...


Hi everybody,

is there someone who can tell me how to call a javascript-function
by a php-script.

Thanks for each answer

Marcel

--
registered Fli4l-User #0388



-- 
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] Calling Javascript-function from php-script ...

2002-03-19 Thread scott furt

Short answer: no.

Long answer: have the PHP script output javascript code
to the browser.

PHP = server-side
Javascript = client-side

Marcel Besancon wrote:
 Hi everybody,
 
 is there someone who can tell me how to call a javascript-function by a
 php-script.
 
 Thanks for each answer
 
 Marcel
 
 --
 registered Fli4l-User #0388
 
 
 
 



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




[PHP] Looking for modifiable web administration script for MySQL

2002-03-19 Thread Steve Clay

On another note,
Are there any open-source/freeware PHP scripts that have the
functionality of PHPMyAdmin, but modifiable for my custom tables/needs?  The
admin script I could write at this point would be an inferior web
interface for our MySQL DB (only 2 tables), so I'd rather save time
and just alter existing, well-crafted code and stick this on our
secure server.  How easy would it be to alter PHPMyAdmin itself?

Thanks for any insight..

Steve
-- 
[EMAIL PROTECTED] ** http://mrclay.org


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




[PHP] sessions not so secure..solution?

2002-03-19 Thread Steve Clay

Hello,
  I'm building an e-commerce site which uses sessions to
hold my $cart object.  This works great but I've two worries:

1) When the user connects through our secure hostname, can I ensure
the browser will send the server the cookie (w/ SESSID)?  The user
will shop through domain.com and checkout via https:secure.domain.com.
(haven't got cert yet)

2) While the user shops the SESSID is thrown around insecurely (no big
deal, just a cart).  But when I move the user to a secure server to
get sensitive info a resourceful hacker could also go to the checkout
script using this SESSID and 'confirm' the real user's personal
details (kept in another registered session object).

If I can't keep the user's details in the old session, can I delete
the old session and copy the cart to a new session?  Should I do this
anytime the user goes back to the insecure site and returns to finish
checking out?

As an alternative, would there be any problems with keeping the IP of
the user in a session variable for further authentication?  I assume
I'd record the IP immediately upon checking in at the secure server
then enforcing this per request.  That way, worst case scenario the
hackers gets a SESSID and heads to checkout first, server restricts
real user from accessing (because of different IP).

This is my first time coding for a secure server and my first post
here as well..

Steve
-- 
[EMAIL PROTECTED] ** http://mrclay.org


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




[PHP] Making a simple borderless pop up window with a Close button

2002-03-19 Thread Denis L. Menezes

Hello friends.

I am making a database website where I need to add a small help button for
every field on the form. Whenever the user clicks the small help button, I
wish to show a titleless popup window containing the help text and a close
button. Can someone  help me with the php script for this.

Thanks
Denis


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




RE: [PHP] Making a simple borderless pop up window with a Close button

2002-03-19 Thread Sven Jacobs

class.overlib does that nicely
http://www.posi.de/phpclass/



-Original Message-
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
Sent: mardi 19 mars 2002 13:12
To: [EMAIL PROTECTED]
Subject: [PHP] Making a simple borderless pop up window with a Close
button


Hello friends.

I am making a database website where I need to add a small help button for
every field on the form. Whenever the user clicks the small help button, I
wish to show a titleless popup window containing the help text and a close
button. Can someone  help me with the php script for this.

Thanks
Denis


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



Re: [PHP] Calling Javascript-function from php-script ...

2002-03-19 Thread Marcel Besancon

Hi,

i know that one is server-side and the other is client-side. But what i
meant ist the following. I have a script with a form. By submitting this
form and checking out some values php should call a javascript-function
(such as an alert). You see the php-script shall call the
javascript-function by refreshing the whole page.

Bye,

Marcel

--
registered Fli4l-User #0388
Scott Furt [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Short answer: no.

 Long answer: have the PHP script output javascript code
 to the browser.

 PHP = server-side
 Javascript = client-side

 Marcel Besancon wrote:
  Hi everybody,
 
  is there someone who can tell me how to call a javascript-function
by a
  php-script.
 
  Thanks for each answer
 
  Marcel
 
  --
  registered Fli4l-User #0388
 
 
 
 





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




RE: [PHP] Calling Javascript-function from php-script ...

2002-03-19 Thread Niklas Lampén

Then you need to do it like this:

? if ($myVal == ---) { ?
script language=JavaScript
alert(DOH!);
/script
? }; ?

But you can not make PHP call javascript functions directly.


Niklas


-Original Message-
From: Marcel Besancon [mailto:[EMAIL PROTECTED]] 
Sent: 19. maaliskuuta 2002 14:20
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Calling Javascript-function from php-script ...


Hi,

i know that one is server-side and the other is client-side. But
what i meant ist the following. I have a script with a form. By
submitting this form and checking out some values php should call a
javascript-function (such as an alert). You see the php-script shall
call the javascript-function by refreshing the whole page.

Bye,

Marcel

--
registered Fli4l-User #0388
Scott Furt [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Short answer: no.

 Long answer: have the PHP script output javascript code
 to the browser.

 PHP = server-side
 Javascript = client-side

 Marcel Besancon wrote:
  Hi everybody,
 
  is there someone who can tell me how to call a 
  javascript-function
by a
  php-script.
 
  Thanks for each answer
 
  Marcel
 
  --
  registered Fli4l-User #0388
 
 
 
 





-- 
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] Calling Javascript-function from php-script ...

2002-03-19 Thread scott furt

PHP cannot call a javascript function.

but PHP can examine the incoming variables
and then output Javascript to the browser
to do the appropriate work.

for example, calling $text.php?this=5
pops up an alert saying this=5

test.php
?
print script\n.
   alert('this='+. $this .);\n.
   /script
?


Marcel Besancon wrote:
 Hi,
 
 i know that one is server-side and the other is client-side. But what i
 meant ist the following. I have a script with a form. By submitting this
 form and checking out some values php should call a javascript-function
 (such as an alert). You see the php-script shall call the
 javascript-function by refreshing the whole page.
 
 Bye,
 
 Marcel
 
 --
 registered Fli4l-User #0388
 Scott Furt [EMAIL PROTECTED] schrieb im Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
Short answer: no.

Long answer: have the PHP script output javascript code
to the browser.

PHP = server-side
Javascript = client-side

Marcel Besancon wrote:

Hi everybody,

is there someone who can tell me how to call a javascript-function

 by a
 
php-script.

Thanks for each answer

Marcel

--
registered Fli4l-User #0388






 
 
 



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




Re: [PHP] 100% repeatable problem with PHP 4.0.1 in WIN2k environment.

2002-03-19 Thread scott furt

So it seems to be that your header is failing then.

try using the full URL:
http://localhost/.../success.php
instead of just
success.php

and verify that it's spelled correctly and
is lowercase (if on a *nix system)

Balaji Ankem wrote:
 No it z not failing if I replace it.
 
 -Original Message-
 From: scott furt [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, March 19, 2002 5:49 PM
 To: php
 Subject: Re: [PHP] 100% repeatable problem with PHP 4.0.1 in WIN2k
 environment.
 
 
 Try replacing header(Location: success.php)
 with something like echo Here we are;
 
 does it still fail?
 
 (I cannot run your code here, becuase without
 your database schema, the mysql queries will
 all fail)
 
 At a glance, I don't see any glaring errors
 with your script..
 
 Balaji Ankem wrote:
 
Hi scott,
  
Yes I examined..
It z dying in if loop (if $n==2) at the statement header(Location: 
success.php);
 
It will be helpful to me if u try to execute those files as I told.

Thanks in advance
Balaji

-Original Message-
From: scott furt [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 5:26 PM
To: php
Subject: Re: [PHP] 100% repeatable problem with PHP 4.0.1 in WIN2k
environment.


Have you examined the PHP error logs?

Have you turned up error reporting to the max (E_ALL)
and examined what it returned?

Have you examined $php_errmsg (if configured in php.ini)?

Have you tried putting echo statements every few lines
to see exactly where and why the script dies?

Balaji Ankem wrote:


Hi,
 I am able to produce the following problem 100% in WINDOWS.

 Problem is u can not produce success message in new browser context
..

 Error: php.exe has generated some errors and will be closed by
windows.

 I am facing this problem from last 1 year.





--
--

**Disclaimer**
**
  


Information contained in this E-MAIL being proprietary to Wipro 
Limited is 'privileged' and 'confidential' and intended for use only 
by the individual or entity to which it is addressed. You are notified

 
that any use, copying or dissemination of the information contained in

 
the E-MAIL in any manner whatsoever is strictly prohibited.



 



 
 
 
 
 
 
 **Disclaimer
   
 
 
 Information contained in this E-MAIL being proprietary to Wipro Limited
 is 'privileged' and 'confidential' and intended for use only by the
 individual or entity to which it is addressed. You are notified that any
 use, copying or dissemination of the information contained in the E-MAIL
 in any manner whatsoever is strictly prohibited.
 
 
 
  
 



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




Re: [PHP] More on: how to send a file to the user's browser?

2002-03-19 Thread Jason Wong

On Tuesday 19 March 2002 19:59, scott furt wrote:
 Are you using MSIE?

 what file extension are you testing with?

 i was having similar problems using this technique
 with PDF files.  only with MSIE, sometimes it would
 print text crap to the screen and sometimes it
 would prompt for download.

 MSIE is notorious for disregarding headers and
 trying to handle files off of their extensions.

This is a problem that has been fixed, then broken, then fixed again in 
various versions of IE. Best bet is to 'upgrade' to the latest version of IE, 
or apply the weekly service pack, or better still use Opera ;-)



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
S!!  I hear SIX TATTOOED TRUCK-DRIVERS tossing ENGINE BLOCKS into
empty OIL DRUMS ...
*/

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




Re: [PHP] Clear Form Details

2002-03-19 Thread Jason Wong

On Tuesday 19 March 2002 18:38, Ramesh Nagendra Pillai wrote:
 Hai
 I am new bie to PHP Can any one please give me a
 solution for my problem
 Thanx in Advance

 I am using an form in an PHP page and I am submitting
 it to the same page,
 After Submitting the form I want to clear the form
 details.Please tell how to
 clear the form.

 Code in first.php is

 form name=first acion=?PHP_SELF? method=post
  input type=text name=first
 value=?=$first?

Do not set a value, leave it empty.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Yow!  I want my nose in lights!
*/

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




Re: [PHP] More on: how to send a file to the user's browser?

2002-03-19 Thread scott furt

... or mozilla :)

Jason Wong wrote:
 On Tuesday 19 March 2002 19:59, scott furt wrote:
 
Are you using MSIE?

what file extension are you testing with?

i was having similar problems using this technique
with PDF files.  only with MSIE, sometimes it would
print text crap to the screen and sometimes it
would prompt for download.

MSIE is notorious for disregarding headers and
trying to handle files off of their extensions.

 
 This is a problem that has been fixed, then broken, then fixed again in 
 various versions of IE. Best bet is to 'upgrade' to the latest version of IE, 
 or apply the weekly service pack, or better still use Opera ;-)
 
 
 
 



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




[PHP] Session and SID

2002-03-19 Thread Chris Kay


Its 12am and I probly did something wrong but anyways...

I have php compiled with --enable-trans-id

Running on RH7.2
PHP 4.1.2
Apache

Question is that when I first view the page the SID is not in URL
As it should not be :)

All my links have the SID attached to it as should be...

After I click on a link and goto the page the SID is no longer attached
to further links...

Am I doing something wrong.. If so could some one shed some light for
me..

---
Chris Kay, Eleet Internet Services
[EMAIL PROTECTED]
---


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




[PHP] mysql question

2002-03-19 Thread Denis L. Menezes

Hello friends, 

Can someone tell me what is wrong with the foll script?

CREATE TABLE `sailordata` (`sailorid` INT(8) DEFAULT '' NOT NULL, 
`lastname` VARCHAR NOT NULL,
`firstname` VARCHAR NOT NULL, 
`middlenames` VARCHAR NOT NULL, 
`dob` VARCHAR NOT NULL, 
`telephone` VARCHAR NOT NULL, 
`fax` VARCHAR NOT NULL, 
`email` VARCHAR NOT NULL, .(some more code)

Thanks
Denis












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




[PHP] Sockets and Telnet

2002-03-19 Thread Hunter, Ray

Has anyone created a telnet session in php with sockets and can give me some
help on setting one up?



Thank you,

Ray Hunter
Firmware Engineer I

ENTERASYS NETWORKS

Phone:  801.887.9888
Fax:801.972.5789
Email:  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
www:www.enterasys.com http://www.enterasys.com 






Re: [PHP] Sockets and Telnet

2002-03-19 Thread Nick Winfield

On Tue, 19 Mar 2002, Hunter, Ray wrote:

 Has anyone created a telnet session in php with sockets and can give me some
 help on setting one up?

Take a look at PHP Shell to see how it's done.

http://www.gimpster.com/php/phpshell/index.php

Cheers,

Nick Winfield.


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




Re: [PHP] mysql question

2002-03-19 Thread Hiroshi Ayukawa

Hello,

The length of VARCHAR must be specified like;

CREATE TABLE  sailordata  ( sailorid  INT(8) NOT NULL DEFAULT 0, 
 lastname  VARCHAR(255) NOT NULL,
 firstname  VARCHAR(255) NOT NULL, 
 middlenames  VARCHAR(255) NOT NULL, 
 dob  VARCHAR(255) NOT NULL, 
 telephone  VARCHAR(255) NOT NULL, 
 fax  VARCHAR(255) NOT NULL, 
 email  VARCHAR(255) NOT NULL);
 
 
Regards,
Hiroshi Ayukawa
http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php

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




[PHP] Hi! Is there any equivalent function with header?

2002-03-19 Thread Balaji Ankem

Hi friend,
Is there any equivalent statement to header (Location:
user.php);
Because I am getting problem with that line in fresh browser
context.
How to see the php error log? And how to display an error
messages in php?

Thanks and Regards
-Balaji



**Disclaimer
  


Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.



 



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


[PHP] Re: Search for words

2002-03-19 Thread Joe Webster

if(stristr( $file_data, $word )) die( word found );

that will work for one word -- for many words -- I would use:

if(preg_match(/word1|word2|word3/i, $file_data)) die( one or more words
found );

However, that does use preg -- which is MUCH faster than EREG but neither is
as fast as a straight out text search.

if you go the preg route you need to make sure you form your expression
correctly... but for words ... just | will do you fine.

-Joe

Martin Kampherbeek [EMAIL PROTECTED] wrote in message
006701c1cecb$806e9be0$[EMAIL PROTECTED]">news:006701c1cecb$806e9be0$[EMAIL PROTECTED]...
Hi,

Someone submits an URL to me. Now I want a script that checks for some words
in the file right after submitting. When the word is in the file it must
stop.
For example the words: house and school.






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




Re: [PHP] Mac Classic and PHP...

2002-03-19 Thread Erik Price


On Monday, March 18, 2002, at 06:01  PM, Chuck PUP Payne wrote:

 The guy paid $6000 for this Mac, and the guy doesn't want to even
 hear new hardware. So it doesn't matter I am talk to a wall.

...

 I am dealing with just cheap people. So again thanks for all the 
 comments
 and info.

Good luck, then.  The fact of the matter is that computers sometimes do 
eventually need to be replaced, and yes this means more money.  Like 
cars.  If they don't want to put Linux on the computer they already 
have, which is like recycling a Ford Festiva into a Land Rover Defender, 
then the $150 offer you made them seems like the best thing they could 
do.


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] Apache+php+ldap problem

2002-03-19 Thread Cecilia Cabrera


Hi, i've search through the mail archive and couldn't find a solution for
this. Any ideas?


I'm installing Apache_1.3.23+php-4.1.2+OpenLDAP-2.0.23 in a NetBSD 1.5.1.

Apache alone worked fine, so did apache+php. When i added LDAP: i had no
compilation pronblems, but i can't start apache:

root@dodo$ /usr/local/apache/bin/apachectl start
Syntax error on line 216 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/libphp4.so into server:
/usr/local/apache/libexec/libphp4.so: Undefined PLT symbol ldap_msgfree
(reloc type = 21, symnum = 880)

Any ideas??

thanks Cecilia.

-

Some info:

root@dodo:~$ /usr/local/apache/bin/httpd -l
Compiled-in modules:
  http_core.c
  mod_env.c
  mod_log_config.c
  mod_mime.c
  mod_negotiation.c
  mod_status.c
  mod_include.c
  mod_autoindex.c
  mod_dir.c
  mod_cgi.c
  mod_asis.c
  mod_imap.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_access.c
  mod_auth.c
  mod_so.c
  mod_setenvif.c
suexec: disabled; invalid wrapper /usr/local/apache/bin/suexec



root@dodo:~$ ldd /usr/local/apache/bin/httpd
/usr/local/apache/bin/httpd:
 -lpthread.14 = /usr/lib/libpthread.so.14
 -lcrypt.0 = /usr/lib/libcrypt.so.0
 -lc.12 = /usr/lib/libc.so.12





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




Re: [PHP] Hi! Is there any equivalent function with header?

2002-03-19 Thread Jason Wong

On Tuesday 19 March 2002 22:20, Balaji Ankem wrote:
 Hi friend,
   Is there any equivalent statement to header (Location:
 user.php);
   Because I am getting problem with that line in fresh browser
 context.


The correct usage is:

header (Location: http://www.domain.com/user.php;);


ie you need the full URL.

   How to see the php error log? And how to display an error
 messages in php?

Read the chapter on Error Handling




-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
A man without a woman is like a statue without pigeons.
*/

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




RE: [PHP] Hi! Is there any equivalent function with header?

2002-03-19 Thread Balaji Ankem

Thanks for the reply!!!
I want equivalent statement to  header (Location:
http://www.domain.com/user.php;);

Because I am getting the problem saying php.exe has generated errors
and will be closed by windows. You need to restart the program. An error
log is being created And no error is logged in error log.

Thanks in advance
Balaji

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 19, 2002 7:57 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Hi! Is there any equivalent function with header?


On Tuesday 19 March 2002 22:20, Balaji Ankem wrote:
 Hi friend,
   Is there any equivalent statement to header (Location:
user.php);
   Because I am getting problem with that line in fresh browser
 context.


The correct usage is:

header (Location: http://www.domain.com/user.php;);


ie you need the full URL.

   How to see the php error log? And how to display an error
messages in 
 php?

Read the chapter on Error Handling




-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
A man without a woman is like a statue without pigeons.
*/

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



**Disclaimer
  


Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.



 



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


[PHP] i know it's been asked before... but virtual dedicated?

2002-03-19 Thread Jaxon

hi,

i know this is one of the nearly weekly questions, but i couldn't find an
appropriate answer on marc.theaimsgroup.com.

anyone have good experiences with a commercial-level ISP offering:
- shell
- virtual dedicated hosting enviroment including freedom to compile my own
PHP, etc??
- good dns to allow funky domain redirection

cheers,
jaxon




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




Re: [PHP] Hi! Is there any equivalent function with header?

2002-03-19 Thread Joe Webster

I wouldn't say you NEED a full url, it should handle relative URL's as well.
I don't know if it's part of the specification, but it will work.
As far as your problem I hope that line break isn't in the string and it's
just there because of the email.

-Joe

Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 On Tuesday 19 March 2002 22:20, Balaji Ankem wrote:
  Hi friend,
  Is there any equivalent statement to header (Location:
  user.php);
  Because I am getting problem with that line in fresh browser
  context.


 The correct usage is:

 header (Location: http://www.domain.com/user.php;);


 ie you need the full URL.

  How to see the php error log? And how to display an error
  messages in php?

 Read the chapter on Error Handling




 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk

 /*
 A man without a woman is like a statue without pigeons.
 */



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




Re: [PHP] Making a simple borderless pop up window with a Close button

2002-03-19 Thread Erik Price


On Tuesday, March 19, 2002, at 07:12  AM, Denis L. Menezes wrote:

 I am making a database website where I need to add a small help button 
 for
 every field on the form. Whenever the user clicks the small help 
 button, I
 wish to show a titleless popup window containing the help text and a 
 close
 button. Can someone  help me with the php script for this.

This kind of trick isn't done in PHP but rather in JavaScript.  Search 
google for javascript tutorial and if you want to narrow that down 
some add window open resize.  As has been mentioned on this list five 
times over the past 24 hours, JavaScript is code that is executed by the 
user's browser (as opposed to PHP which is code executed by the server), 
which provides the ability to manipulate browser objects like windows.

I don't know much JavaScript so I can't answer your question directly, 
sorry.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Making a simple borderless pop up window with a Close button

2002-03-19 Thread Joe Webster

It only works in IE -- it makes use of the 'Full Screen' (F11) option and
tricks IE into doing so... hope you don't want it to work in NS, Opera... or
anything else

=)

-Joe

Erik Price [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On Tuesday, March 19, 2002, at 07:12  AM, Denis L. Menezes wrote:

  I am making a database website where I need to add a small help button
  for
  every field on the form. Whenever the user clicks the small help
  button, I
  wish to show a titleless popup window containing the help text and a
  close
  button. Can someone  help me with the php script for this.

 This kind of trick isn't done in PHP but rather in JavaScript.  Search
 google for javascript tutorial and if you want to narrow that down
 some add window open resize.  As has been mentioned on this list five
 times over the past 24 hours, JavaScript is code that is executed by the
 user's browser (as opposed to PHP which is code executed by the server),
 which provides the ability to manipulate browser objects like windows.

 I don't know much JavaScript so I can't answer your question directly,
 sorry.


 Erik




 

 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]




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




Re: [PHP] Mac Classic and PHP...

2002-03-19 Thread Geoff Hankerson

I would worry about the hard drive failing on an old Mac. (This just
happened to me on an old 7300/180 and a bondi iMac at work). The older macs
use scsi hard drves that are hard to find and next to impossible to find
new. At least with a 7300 it has 3 pci slots and you can put an IDE
controller in one of the slots which will let you pick up a cheap IDE drive
as a replacement. That might be tough to do on a 5400.
- Original Message -
From: Erik Price [EMAIL PROTECTED]
To: Chuck PUP Payne [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, March 19, 2002 8:21 AM
Subject: Re: [PHP] Mac Classic and PHP...



 On Monday, March 18, 2002, at 06:01  PM, Chuck PUP Payne wrote:

  The guy paid $6000 for this Mac, and the guy doesn't want to even
  hear new hardware. So it doesn't matter I am talk to a wall.

 ...

  I am dealing with just cheap people. So again thanks for all the
  comments
  and info.

 Good luck, then.  The fact of the matter is that computers sometimes do
 eventually need to be replaced, and yes this means more money.  Like
 cars.  If they don't want to put Linux on the computer they already
 have, which is like recycling a Ford Festiva into a Land Rover Defender,
 then the $150 offer you made them seems like the best thing they could
 do.

 Erik

 

 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]

 --
 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] Mac Classic and PHP...

2002-03-19 Thread Geoff Hankerson

Also remember you can pick up a brand new Dell 1.6 ghz P4 w/ 17 inch monitor
for under $700. Then you can run php/apache on Windows if you want (check
out the easy installer at www.nusphere.com) or any number of Linux or BSD
variants.

If your set on a Mac you can pick up a new previous generation iMac (G3) for
about $700 as well and run all this on MacOSX.  iMacs can make a decent
server in the right situation because of the integrated monitor.
- Original Message -
From: Erik Price [EMAIL PROTECTED]
To: Chuck PUP Payne [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, March 19, 2002 8:21 AM
Subject: Re: [PHP] Mac Classic and PHP...



 On Monday, March 18, 2002, at 06:01  PM, Chuck PUP Payne wrote:

  The guy paid $6000 for this Mac, and the guy doesn't want to even
  hear new hardware. So it doesn't matter I am talk to a wall.

 ...

  I am dealing with just cheap people. So again thanks for all the
  comments
  and info.

 Good luck, then.  The fact of the matter is that computers sometimes do
 eventually need to be replaced, and yes this means more money.  Like
 cars.  If they don't want to put Linux on the computer they already
 have, which is like recycling a Ford Festiva into a Land Rover Defender,
 then the $150 offer you made them seems like the best thing they could
 do.

 Erik

 

 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]

 --
 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] Making a simple borderless pop up window with a Close button

2002-03-19 Thread Erik Price


On Tuesday, March 19, 2002, at 09:47  AM, Joe Webster wrote:

 It only works in IE -- it makes use of the 'Full Screen' (F11) option 
 and
 tricks IE into doing so... hope you don't want it to work in NS, 
 Opera... or
 anything else

I never realized that!  But, (not that I didn't believe you but I like 
to see for myself) I just tested it in Mozilla 0.9.9 for OS X, and it 
-sort- of works.  The Favorites bar appears, but the navigation bar 
(with forward/backward buttons) doesn't appear.

BUT... with a bit of fudging, I can get it to appear (playing with the 
menu settings and clicking the Toolbar button that appears in every 
Aqua window).  Also, the window is resizeable.  So it looks like you can 
suggest to Mozilla that it not display the nav bar, but you can't 
force it like you do in Explorer.


Erik

PS: some testing with MSIE5.1 in OS X shows that by clicking the 
toolbar button mentioned above, you can actually bring back scroll 
bars, nav bar, and window-resizeability.  But I'm glad to know that this 
isn't a true JavaScript feature, rather an MSIE extension of sorts...





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] Session Data Not Saving

2002-03-19 Thread Jesse Warden

I am getting errors when I try to start a session.

I get a permission denied (13) for trying to open the session data.
I also get Failed to write session data (files).  Please verify that the
current setting of session.save_path is correct.

I got a few others, but they didn't look to pertinent.  I am running this on
my personal web server using win2k, IIS 5 (or so), and PHP4.

Any suggestions?

J


** Scanned for Viruses **

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




[PHP] console scripts reading php.ini

2002-03-19 Thread annazaraah

Hi - sorry if i was not clear..


 i'm running a mailout script from the console (not via apache).  the
problem
 is that the mail function is using the default (sendmail MTA).  i want the
 script to use qmail instead.

 I put sendmail_path = /var/qmail/bin/qmail-inject into php.ini  but my mail
 script is still using sendmail to send.

 I was under the impression that scripts run from the console to not read
 php.ini - which is what sendmail is still be used.  Is there a way that i
 can tell my mailout.php script to use qmail instead of sendmail?

 Many Thanks!
 anna


 - Original Message -
 From: Cirstoiu Aurel Sorin [EMAIL PROTECTED]
 To: DigitalKoala [EMAIL PROTECTED]
 Sent: Monday, March 18, 2002 2:33 PM
 Subject: Re: [PHP] console scripts reading php.ini


  What do you really want to do?
  You want to configure your php for sending mails
  by editing the php.ini from a script ?
  Why?You can do that with any text editor.
  If you don't want that than I'm wrong and you'll
  have to tell me want do you want more explicit.
 
  - Original Message -
  From: DigitalKoala [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, March 18, 2002 2:51 PM
  Subject: [PHP] console scripts reading php.ini
 
 
   Hi folks,
  
   How do i get my script (run from the console and not from the browser)
 to
   set sendmail_path = /var/qmail/bin/qmail-inject ?
  
   Thanks!
  
   DK
  
  
  
   --
   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] Anybody have a function to encode a string?

2002-03-19 Thread Drew Lopucki

Lots of people will tell you to use PGP.  However since PGP is not *free*,
in that you cannot use it for commercial purposes without a license, I avoid
it.  Also it has to be downloaded and installed as most systems do not
include it because of it's non-free open source status.

The best alternative I found is OpenSSL.  Yes it does key management,
creation, encryption, decryption and even SMIME EMAIL!  That's right you can
even send encrypted emails with it.  Try  'man smime' on a linux system for
the email portion.  Also, 'man rsautl' for just encryption and decryption of
an arbitrary string.


Hope I've been helpful,

Drew Lopucki
Mrdrew.com
[EMAIL PROTECTED]

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 2:19 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Anybody have a function to encode a string?


I need a function that encodes stuff, with a key.  It, of course, needs to
be decodable too.  Does anbody know/have a function like this?

--
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] Mac Classic and PHP...

2002-03-19 Thread Alnisa Allgood

At 8:48 AM -0600 3/19/02, Geoff Hankerson wrote:
I would worry about the hard drive failing on an old Mac. (This just
happened to me on an old 7300/180 and a bondi iMac at work). The older macs
use scsi hard drves that are hard to find and next to impossible to find
new. At least with a 7300 it has 3 pci slots and you can put an IDE
controller in one of the slots which will let you pick up a cheap IDE drive
as a replacement. That might be tough to do on a 5400.


Wow, you find SCSI hard to find? I find it as easy as IDE to find, 
it's just more expensive.

A


-- 
   .
Alnisa  Allgood
Executive Director
Nonprofit Tech
(ph) 415.337.7412  (fx) 415.337.7927
(url)  http://www.nonprofit-techworld.org
(url)  http://www.nonprofit-tech.org
(url)  http://www.tech-library.org
   .
Nonprofit Tech E-Update
mailto:[EMAIL PROTECTED]
   .
transforming nonprofits through technology
   .

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




RE: [PHP] Session and SID

2002-03-19 Thread Johnson, Kirk


SID is set on the first request. It is only set on subsequent requests if
cookies are disabled on the client. So, disable cookies in your browser, and
then see what happens.

Kirk

 -Original Message-
 From: Chris Kay [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, March 19, 2002 6:16 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Session and SID
 
 
 
 Its 12am and I probly did something wrong but anyways...
 
 I have php compiled with --enable-trans-id
 
 Running on RH7.2
 PHP 4.1.2
 Apache
 
 Question is that when I first view the page the SID is not in URL
 As it should not be :)
 
 All my links have the SID attached to it as should be...
 
 After I click on a link and goto the page the SID is no 
 longer attached
 to further links...
 
 Am I doing something wrong.. If so could some one shed some light for
 me..
 
 ---
 Chris Kay, Eleet Internet Services
 [EMAIL PROTECTED]
 ---

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




Re: [PHP] Mac Classic and PHP...

2002-03-19 Thread Geoff Hankerson

Well would you be so kind as to share your knowledge of where to pick up
scsi drives. Remember these are old Mac compatible scsi drives 50 pin or
something like that.
- Original Message -
From: Alnisa Allgood [EMAIL PROTECTED]
To: Geoff Hankerson [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, March 19, 2002 9:22 AM
Subject: Re: [PHP] Mac Classic and PHP...


 At 8:48 AM -0600 3/19/02, Geoff Hankerson wrote:
 I would worry about the hard drive failing on an old Mac. (This just
 happened to me on an old 7300/180 and a bondi iMac at work). The older
macs
 use scsi hard drves that are hard to find and next to impossible to find
 new. At least with a 7300 it has 3 pci slots and you can put an IDE
 controller in one of the slots which will let you pick up a cheap IDE
drive
 as a replacement. That might be tough to do on a 5400.

 Wow, you find SCSI hard to find? I find it as easy as IDE to find,
 it's just more expensive.

 A

 --
.
 Alnisa  Allgood
 Executive Director
 Nonprofit Tech
 (ph) 415.337.7412  (fx) 415.337.7927
 (url)  http://www.nonprofit-techworld.org
 (url)  http://www.nonprofit-tech.org
 (url)  http://www.tech-library.org
.
 Nonprofit Tech E-Update
 mailto:[EMAIL PROTECTED]
.
 transforming nonprofits through technology
.


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




RE: [PHP] sessions not so secure..solution?

2002-03-19 Thread Drew Lopucki

I can't answer your overall question but I can tell you that a 'resourceful'
hacker can also easily spoof an IP address, or so I'm told ;)

Why not just have the entire session encrypted.  The user could browse
around the catalog sessionless and as soon as a cart was necessary (wants to
put something in it) the https starts. (?)

Drew Lopucki
[EMAIL PROTECTED]

-Original Message-
From: Steve Clay [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 7:13 AM
To: PHP-GENERAL
Subject: [PHP] sessions not so secure..solution?


Hello,
  I'm building an e-commerce site which uses sessions to
hold my $cart object.  This works great but I've two worries:

1) When the user connects through our secure hostname, can I ensure
the browser will send the server the cookie (w/ SESSID)?  The user
will shop through domain.com and checkout via https:secure.domain.com.
(haven't got cert yet)

2) While the user shops the SESSID is thrown around insecurely (no big
deal, just a cart).  But when I move the user to a secure server to
get sensitive info a resourceful hacker could also go to the checkout
script using this SESSID and 'confirm' the real user's personal
details (kept in another registered session object).

If I can't keep the user's details in the old session, can I delete
the old session and copy the cart to a new session?  Should I do this
anytime the user goes back to the insecure site and returns to finish
checking out?

As an alternative, would there be any problems with keeping the IP of
the user in a session variable for further authentication?  I assume
I'd record the IP immediately upon checking in at the secure server
then enforcing this per request.  That way, worst case scenario the
hackers gets a SESSID and heads to checkout first, server restricts
real user from accessing (because of different IP).

This is my first time coding for a secure server and my first post
here as well..

Steve
--
[EMAIL PROTECTED] ** http://mrclay.org


--
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] mysql - php help

2002-03-19 Thread Denis L. Menezes

Hello firends,

I have three fields(input boxes) in a php form as follows :
$name
$rank
$age

My MySQL table is called tblAddress. I know how to connect, but I do not
know the Insert statement. Can someone please advise me how I can insert
the above values in the tables tblAdddress in columns name, Rank,
age respectively?

Thanks
Denis


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




[PHP] how to seek and convert an email address to mailto link

2002-03-19 Thread Pekka Saarinen

Hi,

I need to search text for @ and replace the mail address around it (i.e. 
text between previous and following spaces) so that if I have text

Foobar foobar [EMAIL PROTECTED] foobar foobar.

It'll convert it to

Foobar foobar a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a foobar foobar.

Anyone?

Thanks,

Pekka


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




Re: [PHP] mysql - php help

2002-03-19 Thread Erik Price


On Tuesday, March 19, 2002, at 10:57  AM, Denis L. Menezes wrote:

 I have three fields(input boxes) in a php form as follows :
 $name
 $rank
 $age

 My MySQL table is called tblAddress. I know how to connect, but I do 
 not
 know the Insert statement. Can someone please advise me how I can 
 insert
 the above values in the tables tblAdddress in columns name, Rank,
 age respectively?

There are a couple of ways to do it.

$sql = INSERT INTO tblAddress
 VALUES ( . $_POST['name'] . ,  . $_POST['rank'] . ,  . 
$_POST['age'] . );
mysql_query($sql, $db);  // $db is your database connection pointer

That one only works if the first three columns in the table are the ones 
you want to insert the values into.  The next version is like this:

$sql = INSERT INTO tblAddress (name, rank, age)
 VALUES (' . $_POST['name'] . ', ' . $_POST['rank'] . ', ' . 
$_POST['age'] . ');
mysql_query($sql, $db);  // $db is your database connection pointer

That one works if you don't know the layout of the table, but know the 
names of the columns you want -- it's specific, and more portable than 
the first way (in case you ever alter your table structure).  The last 
way to do it is like this:

$sql = INSERT INTO tblAddress
 SET name=' . $_POST['name'] . '
 rank=' . $_POST['rank'] . '
 age=' . $_POST['age'] . ';
mysql_query($sql, $db);  // $db is your database connection pointer


In the above examples, I've made the assumption that the form is being 
sent via POST and that you are using PHP 4.1.x with register_globals 
off, adjust accordingly if this is not the case.  Also note that the 
singlequotes used to surround each database entry value aren't always 
necessary, I think that with INT columns they can be omitted (but are 
required for string columns since spaces are tokens in this case [I 
think]).

HTH,

Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Mac Classic and PHP...

2002-03-19 Thread Alnisa Allgood

At 9:55 AM -0600 3/19/02, Geoff Hankerson wrote:
Well would you be so kind as to share your knowledge of where to pick up
scsi drives. Remember these are old Mac compatible scsi drives 50 pin or
something like that.

Ahh. 50-pin haven't dealt with one of those in a while. I typically 
purchase through MicroWarehouse, but they have the 68-pin. You can 
purchase converters for 50-pin to 68-pin. But you can also try 
http://www.softwareandstuff.com  a pretty good Surplus Computer place 
in Santa Clara. You can still purchase 9GB, 50-pin, SCSI through them.

Alnisa
-- 
   .
Alnisa  Allgood
Executive Director
Nonprofit Tech
(ph) 415.337.7412  (fx) 415.337.7927
(url)  http://www.nonprofit-techworld.org
(url)  http://www.nonprofit-tech.org
(url)  http://www.tech-library.org
   .
Nonprofit Tech E-Update
mailto:[EMAIL PROTECTED]
   .
transforming nonprofits through technology
   .

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




Re: [PHP] how to seek and convert an email address to mailto link

2002-03-19 Thread RIVES Sergio

Hi,
I think the following lines could help you :

$line = Foobar foobar [EMAIL PROTECTED] foobar foobar;
list($var1,$var2,$var3,$var4,$var5) = explode( ,$line);
echo $var1 $var2 a href=mailto:$var3;$var3/a. .$var4. .$var5;
more or less... i am a newbie in this stuff...
hope it helps you

SR



Pekka Saarinen a écrit :

 Hi,

 I need to search text for @ and replace the mail address around it (i.e.
 text between previous and following spaces) so that if I have text

 Foobar foobar [EMAIL PROTECTED] foobar foobar.

 It'll convert it to

 Foobar foobar a href=mailto:[EMAIL PROTECTED];[EMAIL PROTECTED]/a foobar foobar.

 Anyone?

 Thanks,

 Pekka

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



Re: [PHP] sessions not so secure..solution?

2002-03-19 Thread PHP freak

I came to the PHP list today with the same question/problem.

My cart doesn't require cookies.  If the user doesn't have them it just puts the 
SESSID in the URL.  (Good ol PHP!)

BUT - it's actually happening often that someone linking to our store
from their own website is including the long SESSID in the URL
that links to us, to that everyone who follows that link from
that website is getting the same shopping cart!

What to do?  Not sure yet.  

I've seen that Amazon does this:

Here's a shopping cart I just made in a browser with no cookies:
http://www.amazon.com/exec/obidos/shopping-basket/ref=top_nav_sb_music/102-7862797-5184911

You can cut-n-paste that into a DIFFERENT browser with no cookies, and my cart items 
come up.
(I think the 102-7862797-5184911 is my SESSID in this case.)

I can go SSH into a remote server on the other side of the world, and type:
lynx 
http://www.amazon.com/exec/obidos/shopping-basket/ref=top_nav_sb_music/102-7862797-5184911

Tell it to never allow cookies, and yes my cart STILL comes up.

... so they're not doing it by IP address.

BUT - if I now take that URL that I've pasted in many cookie-less browsers, and put it 
in 
a browser WITH cookies, it says my cart is empty.

IDEA:
Maybe it's comparing the SESSID in the URL with the cookie, and if they match
(rather - if they don't conflict) - then it's OK.

I just was able to log all the way into my existing account at Amazon
AND complete an order all without cookies.

It did ask for my password 2 different times, though.

Ah - i dunno.  IF I WERE YOU, I'd approach it like http://my.yahoo.com

At Yahoo, they have one level of authentication that lets you just see
your basic my.yahoo page.  Even if I haven't been there in months,
it knows it's me.  Let's assume it's a 1-year cookie.

THEN - if I actually want to check my email, I need to enter the password
every few hours.

So make one cookie/SESSID last forever that only shows cart items.
(As you say - no big deal, just a cart.)

Then make another cookie/SESSID that only lasts a few hours, for that login stuff.

That 2nd one could perhaps be concerned with IP address  whatnot.

I dunno... keep me in the loop.  Let me know what you decide.
And vice-versa.  


On Tue, Mar 19, 2002 at 07:13:00AM -0500, Steve Clay wrote:
 Hello,
   I'm building an e-commerce site which uses sessions to
 hold my $cart object.  This works great but I've two worries:
 
 1) When the user connects through our secure hostname, can I ensure
 the browser will send the server the cookie (w/ SESSID)?  The user
 will shop through domain.com and checkout via https:secure.domain.com.
 (haven't got cert yet)
 
 2) While the user shops the SESSID is thrown around insecurely (no big
 deal, just a cart).  But when I move the user to a secure server to
 get sensitive info a resourceful hacker could also go to the checkout
 script using this SESSID and 'confirm' the real user's personal
 details (kept in another registered session object).
 
 If I can't keep the user's details in the old session, can I delete
 the old session and copy the cart to a new session?  Should I do this
 anytime the user goes back to the insecure site and returns to finish
 checking out?
 
 As an alternative, would there be any problems with keeping the IP of
 the user in a session variable for further authentication?  I assume
 I'd record the IP immediately upon checking in at the secure server
 then enforcing this per request.  That way, worst case scenario the
 hackers gets a SESSID and heads to checkout first, server restricts
 real user from accessing (because of different IP).
 
 This is my first time coding for a secure server and my first post
 here as well..
 
 Steve
 -- 
 [EMAIL PROTECTED] ** http://mrclay.org

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




[PHP] PHP Compile: IMAP enabled?

2002-03-19 Thread Mike At Spy


If IMAP is entered under Loaded Modules in the apache section of a phpinfo
file, does that mean IMAP has been enabled?

Thanks,

-Mike



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




[PHP] include_once()

2002-03-19 Thread Mauricio Cuenca

Hello,

I have a very long script with several functions in it. I wanted to split
the script into several files, so I created two sub-scripts and one main
script. This is the code from the main script:

?php

include_once(sub_script_1.php);
incude_once(sub_script_2.php);

$temp = MyFunction();

?

MyFunction() is contained in the file sub_script_1.php which is properly
enclosed with valid PHP start and end tags.

But When I try to run the main script, I get this error:
Fatal error: Call to undefined function: MyFunction()in /main_script.php on
line 4.

How can I properly divide my script into several ones ???

TIA,

__
Mauricio Cuenca



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




Re: [PHP] sessions not so secure..solution?

2002-03-19 Thread Analysis Solutions

On Tue, Mar 19, 2002 at 08:37:43AM -0800, PHP freak wrote:

 BUT - it's actually happening often that someone linking to our store
 from their own website is including the long SESSID in the URL
 that links to us, to that everyone who follows that link from
 that website is getting the same shopping cart!

Two things.  First, tell the person linking to you to take the session 
id out of the link.  Second, rework your system to more precisely track 
things.  Here's what I track in my system:

  User Agent
  Time
  Referer = Last Page Viewed

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

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




[PHP] Re: Retrieving Windows 98/NT/XP Login with PHP - Possible?

2002-03-19 Thread Mahmoud

Hi Shaun,

 I would
 like to be able to tailor the main webpage to whichever person visits it -
 but by using their windows login ID instead of having to get them to enter
a
 username when the page is visited... Is this possible?

Yes it is, if the user is logging on to the machine running apache.

When running under m$ windows, the environment variable USERNAME contains
the username of the user logged on to the machine running Apache/PHP.

Not sure if this is true for '98.

Create a file called, say, info.php which contains the following 3 lines:

?php
phpinfo();
?

and have a look at its output.

Regards,

Mahmoud



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




Re: [PHP] include_once()

2002-03-19 Thread Neil Freeman

Have you remembered to set up PHP's include_path to point to the area where
your scripts are located?

Neil

Mauricio Cuenca wrote:

 Hello,

 I have a very long script with several functions in it. I wanted to split
 the script into several files, so I created two sub-scripts and one main
 script. This is the code from the main script:

 ?php

 include_once(sub_script_1.php);
 incude_once(sub_script_2.php);

 $temp = MyFunction();

 ?

 MyFunction() is contained in the file sub_script_1.php which is properly
 enclosed with valid PHP start and end tags.

 But When I try to run the main script, I get this error:
 Fatal error: Call to undefined function: MyFunction()in /main_script.php on
 line 4.

 How can I properly divide my script into several ones ???

 TIA,

 __
 Mauricio Cuenca

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

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




RE: [PHP] sessions not so secure..solution?

2002-03-19 Thread SHEETS,JASON (Non-HP-Boise,ex1)

Looking through the php.ini file brought me to the following setting:

; Check HTTP Referer to invalidate externally stored URLs containing ids.
;session.referer_check

I looked in the manual and found this explanation:

session.referer_check contains the substring you want to check each HTTP
Referer for. If the Referer was sent by the client and the substring was not
found, the embedded session id will be marked as invalid. Defaults to the
empty string.

This sounds like it will do what you are trying to do.

Jason

-Original Message-
From: Analysis  Solutions [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 10:03 AM
To: PHP List
Subject: Re: [PHP] sessions not so secure..solution?


On Tue, Mar 19, 2002 at 08:37:43AM -0800, PHP freak wrote:

 BUT - it's actually happening often that someone linking to our store
 from their own website is including the long SESSID in the URL
 that links to us, to that everyone who follows that link from
 that website is getting the same shopping cart!

Two things.  First, tell the person linking to you to take the session 
id out of the link.  Second, rework your system to more precisely track 
things.  Here's what I track in my system:

  User Agent
  Time
  Referer = Last Page Viewed

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

-- 
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] regular expression

2002-03-19 Thread Kris Vose

How would you write a regular expression that defines a phone number:  ex. 
(123)123-1234.
 
In other words how would you check to see if there were three numerics surrounded by 
(), then three numerics with a -, then four numerics.
 
 
This is what I have so far as a regular expression.
 
^[(000-999)]+[000-999\-]+[-]+$
 
I am using this in an if statement like this:
 
If (!eregi(^[(000-999)]+[000-999\-]+[-]+$, $PHONENUMBER)
{
echo This phone number is not valid;
}
 
 
Any help is appreciated.
 
Kris Vose



Re: [PHP] PHP Compile: IMAP enabled?

2002-03-19 Thread Jason Wong

On Wednesday 20 March 2002 00:46, Mike At Spy wrote:
 If IMAP is entered under Loaded Modules in the apache section of a
 phpinfo file, does that mean IMAP has been enabled?

Use php_info() to find out.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
High heels are a device invented by a woman who was tired of being kissed
on the forehead.
*/

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




Re: [PHP] regular expression

2002-03-19 Thread Thalis A. Kalfigopoulos

I guess you can do it also as:

([1-9]{3})[1-9]{3}-[1-9]{4}

cheers,
--t.


On Tue, 19 Mar 2002, Kris Vose wrote:

 How would you write a regular expression that defines a phone number:  ex. 
(123)123-1234.
  
 In other words how would you check to see if there were three numerics surrounded by 
(), then three numerics with a -, then four numerics.
  
  
 This is what I have so far as a regular expression.
  
 ^[(000-999)]+[000-999\-]+[-]+$
  
 I am using this in an if statement like this:
  
 If (!eregi(^[(000-999)]+[000-999\-]+[-]+$, $PHONENUMBER)
 {
 echo This phone number is not valid;
 }
  
  
 Any help is appreciated.
  
 Kris Vose
 


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




Re: [PHP] regular expression

2002-03-19 Thread Jason Wong

On Wednesday 20 March 2002 01:53, Thalis A. Kalfigopoulos wrote:
 I guess you can do it also as:

 ([1-9]{3})[1-9]{3}-[1-9]{4}

But wouldn't this excludes zeros?


Try:

preg_match(/^\(\d{3}\)\s\d{3}-\d{4}$/, $number)

which matches

(123) 345-6789



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Your good nature will bring you unbounded happiness.
*/

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




Re: [PHP] regular expression

2002-03-19 Thread mnc

On Tue, 19 Mar 2002, Kris Vose wrote:
 How would you write a regular expression that defines a phone number:  ex. 
(123)123-1234.
  
 In other words how would you check to see if there were three numerics surrounded by 
(), then three numerics with a -, then four numerics.
  
  
 This is what I have so far as a regular expression.
  
 ^[(000-999)]+[000-999\-]+[-]+$
  
 I am using this in an if statement like this:
  
 If (!eregi(^[(000-999)]+[000-999\-]+[-]+$, $PHONENUMBER)
 {
 echo This phone number is not valid;
 }

Aside from the fact that your regexp isn't valid (look for a little 'n' in
the documentation), you might want to consider just stripping the number
down to digits (ereg_replace('[^0-9]', '', $number)) and then testing to
make sure that has 10 digits (11 if the first figit is a 1) and doesn't
begin with 0.

Why force people to use your particular punctuation scheme?

Some people write:

   1.202.555.1212
   (202) 555-1212
   202/555-1212
   202-555-1212
   2025551212

There's no point in making them jump through hoops just to save 2 lines of 
code. Sites that enforce silly things like that really turn me off.

You can always impose your preferred formatting after verifying the raw 
number's validity.

miguel


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




Re: [PHP] Session Data Not Saving

2002-03-19 Thread Jason Wong

On Tuesday 19 March 2002 23:29, you wrote:

 Should I change session.save_path?  I have no idea of the ramifications of
 doing that, therefore I am not touching it unless someone says so.

The error message is quite explicit.

As a quick fix and to confirm whether that is the problem:

Check what session.save_path is set to and set whatever directory that is 
to be world read/writeable.

 As for permission denied, I am barely wet around the ears (or something)
 when it comes to permission setting.  I am not sure what to set to allow
 who to access what.

I'm not sure how W2K (that's what you're using?) runs the webserver. In Linux 
one would set the directory to be accessible by the user running the 
webserver.



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
When the going gets tough, the tough get empirical.
-- Jon Carroll
*/

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




[PHP] Whats wrong with getimagesize ??

2002-03-19 Thread andy

Hi guys,

I am really stuck with this prob. Anyhow php can't read imagefiles after
password protecting the site with htaccess. The file exists, the application
works (after deleting the htaccess function), the path is ok. copy and
pasting the url into the browserwindow returns the image. So whats wrong??

I am getting following erromsg:

Warning: getimagesize: Unable to open
'http://testserver/subapp_gallery/app_data/ca/pictures/www.globosapiens.net-
-canada--northwest-territories--id=239.jpg' for reading

does anybody have any idea? I would really apreciate it, this gives me a
real headache.

Thanx for any help,

Andy



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




[PHP] Re: Whats wrong with getimagesize ??

2002-03-19 Thread andy

hi.. foud the error. For everybody who might cope with the same error:

the prob was that getimagesize requires a path name without protocol like:
/pictures/12.gif

http://server.com/pictures/12.gif does not work with htaccess and imagesize

Thats it. easy hah :-)

Andy

Andy [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi guys,

 I am really stuck with this prob. Anyhow php can't read imagefiles after
 password protecting the site with htaccess. The file exists, the
application
 works (after deleting the htaccess function), the path is ok. copy and
 pasting the url into the browserwindow returns the image. So whats wrong??

 I am getting following erromsg:

 Warning: getimagesize: Unable to open

'http://testserver/subapp_gallery/app_data/ca/pictures/www.globosapiens.net-
 -canada--northwest-territories--id=239.jpg' for reading

 does anybody have any idea? I would really apreciate it, this gives me a
 real headache.

 Thanx for any help,

 Andy





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




[PHP] Cannot Find php binary

2002-03-19 Thread N. Pari Purna Chand

Hi all
I have compiled php on a slack box
./configure --with-apxs=/usr/local/apache/bin/apxs ..
make  make install

everything Fine
and .php pages are being parsed with php when called thru webserver(apache).

But I can not find any binary named php
which I need to run php scripts from shell.

?
/Chandu




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




Re: [PHP] Cannot Find php binary

2002-03-19 Thread R'twick Niceorgaw

I believe when you compile php with apxs, it does not create the php binary.
You will have to compile php again without the --with-apxs option and then
copy the php binary to the place where you want ot put it.

HTH
R'twick Nicerogaw


- Original Message -
From: N. Pari Purna Chand [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 19, 2002 1:56 PM
Subject: [PHP] Cannot Find php binary


 Hi all
 I have compiled php on a slack box
 ./configure --with-apxs=/usr/local/apache/bin/apxs ..
 make  make install

 everything Fine
 and .php pages are being parsed with php when called thru
webserver(apache).

 But I can not find any binary named php
 which I need to run php scripts from shell.

 ?
 /Chandu




 --
 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] Cannot Find php binary

2002-03-19 Thread Brian Drexler

You need to reconfigure PHP without the --with-apxs line in your configure script.  
Hope this helps.

Brian

-Original Message-
From: N. Pari Purna Chand [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 1:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Cannot Find php binary


Hi all
I have compiled php on a slack box
./configure --with-apxs=/usr/local/apache/bin/apxs ..
make  make install

everything Fine
and .php pages are being parsed with php when called thru webserver(apache).

But I can not find any binary named php
which I need to run php scripts from shell.

?
/Chandu




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


[PHP] eregi()

2002-03-19 Thread Vlad Kulchitski

Hi,

Can any1 send a small script of how to valiade a username using eregi().

I want username to consist only a-zA-Z1-0, _, and -

I can't get it to work correctly

Vlad

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




[PHP] Mac Classic and PHP...Part 2 The Wintel Nightmare.

2002-03-19 Thread Chuck PUP Payne

Ok, I am back. My client has gone bought Wintel box, running XP. I have
downloaded and install Apache, Mysql, and PHP 4. But because 4 is a zip, I
have read the install.txt and have set up the httpd.conf but when I got to
check if php is working, I can see the inside of the file

? PHPINFO(); ? 

I have look on a couple site I have everything set. Is there an easy way, my
God Linux and Mac is simpler than this.

Chuck Payne
Magi Design and Support.


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




Re: [PHP] Mac Classic and PHP...Part 2 The Wintel Nightmare.

2002-03-19 Thread Geoff Hankerson

Here is an easy one click install you can download for free

http://www.nusphere.com/ (click download -- you have to register first)

It puts Apache, MySQL, php and perl all in the right places for you.


- Original Message -
From: Chuck PUP Payne [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 19, 2002 1:12 PM
Subject: [PHP] Mac Classic and PHP...Part 2 The Wintel Nightmare.


 Ok, I am back. My client has gone bought Wintel box, running XP. I have
 downloaded and install Apache, Mysql, and PHP 4. But because 4 is a zip, I
 have read the install.txt and have set up the httpd.conf but when I got to
 check if php is working, I can see the inside of the file

 ? PHPINFO(); ?

 I have look on a couple site I have everything set. Is there an easy way,
my
 God Linux and Mac is simpler than this.

 Chuck Payne
 Magi Design and Support.

 --
 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] Mac Classic and PHP...Part 2 The Wintel Nightmare.

2002-03-19 Thread Chuck PUP Payne

Thanks I will try it.  -- Chuck

On 3/19/02 2:15 PM, Geoff Hankerson [EMAIL PROTECTED] wrote:

 Here is an easy one click install you can download for free
 
 http://www.nusphere.com/ (click download -- you have to register first)
 
 It puts Apache, MySQL, php and perl all in the right places for you.
 
 
 - Original Message -
 From: Chuck PUP Payne [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, March 19, 2002 1:12 PM
 Subject: [PHP] Mac Classic and PHP...Part 2 The Wintel Nightmare.
 
 
 Ok, I am back. My client has gone bought Wintel box, running XP. I have
 downloaded and install Apache, Mysql, and PHP 4. But because 4 is a zip, I
 have read the install.txt and have set up the httpd.conf but when I got to
 check if php is working, I can see the inside of the file
 
 ? PHPINFO(); ?
 
 I have look on a couple site I have everything set. Is there an easy way,
 my
 God Linux and Mac is simpler than this.
 
 Chuck Payne
 Magi Design and Support.
 
 --
 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] include_once()

2002-03-19 Thread anders nawroth

Have you put ?php   tags in your include-files?

Anders

- Ursprungligt meddelande - 
Från: Mauricio Cuenca [EMAIL PROTECTED]
Till: [EMAIL PROTECTED]
Skickat: den 19 mars 2002 17:43
Ämne: [PHP] include_once()


 Hello,
 
 I have a very long script with several functions in it. I wanted to split
 the script into several files, so I created two sub-scripts and one main
 script. This is the code from the main script:
 
 ?php
 
 include_once(sub_script_1.php);
 incude_once(sub_script_2.php);
 
 $temp = MyFunction();
 
 ?
 
 MyFunction() is contained in the file sub_script_1.php which is properly
 enclosed with valid PHP start and end tags.
 
 But When I try to run the main script, I get this error:
 Fatal error: Call to undefined function: MyFunction()in /main_script.php on
 line 4.
 
 How can I properly divide my script into several ones ???
 
 TIA,
 
 __
 Mauricio Cuenca
 
 
 
 -- 
 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




  1   2   3   >