RE: [PHP] php graphics generation

2001-10-01 Thread Maxim Maletsky \(PHPBeginner.com\)


Check out netcratf.com
Their graphs are auto generated by (I think) PHP.

Also you can use them a lot for many other kind of charts and stats
graphs.


Maxim Maletsky
www.PHPBeginner.com




-Original Message-
From: Chip [mailto:[EMAIL PROTECTED]] 
Sent: lunedì 1 ottobre 2001 6.43
To: [EMAIL PROTECTED]
Subject: [PHP] php graphics generation


I have been using php for simple things so far, and am just starting to
look 
into the image generation functions of php. I am wondering just what
people 
use these for in real-life applications, some real references. I know
what 
the books say can be done, I am interested in what is being done with
it. Just out of curiosity,

--
Chip W.

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



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




RE: [PHP] php graphics generation

2001-10-01 Thread Maxim Maletsky \(PHPBeginner.com\)


netcraFT.com, sorry

Maxim Maletsky
www.PHPBeginner.com



-Original Message-
From: Maxim Maletsky (PHPBeginner.com)
[mailto:[EMAIL PROTECTED]] 
Sent: lunedì 1 ottobre 2001 8.54
To: 'Chip'; [EMAIL PROTECTED]
Subject: RE: [PHP] php graphics generation



Check out netcratf.com
Their graphs are auto generated by (I think) PHP.

Also you can use them a lot for many other kind of charts and stats
graphs.


Maxim Maletsky
www.PHPBeginner.com




-Original Message-
From: Chip [mailto:[EMAIL PROTECTED]] 
Sent: lunedì 1 ottobre 2001 6.43
To: [EMAIL PROTECTED]
Subject: [PHP] php graphics generation


I have been using php for simple things so far, and am just starting to
look 
into the image generation functions of php. I am wondering just what
people 
use these for in real-life applications, some real references. I know
what 
the books say can be done, I am interested in what is being done with
it. Just out of curiosity,

--
Chip W.

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



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



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




Re: [PHP] Re: Making variable global / accessing variable

2001-10-01 Thread Jason G.

You can see the below code in action at:
http://www.ionzoft.com/code/testing/globals.php

?
function CreateGlobals($td)
{
 $td = foo;

 $td_error = $td . _error;
 $td_ok = $td . _ok;

 global $$td_error;
 global $$td_ok;

 $$td_error = 'Error Message';
 $$td_ok = 'Ok Message';
}

//Just testing

echo 'Before Call to CreateGlobals()br';
echo '$foo_error = ', $foo_error, 'br';
echo '$foo_ok = ', $foo_ok, 'br';

echo 'br';
CreateGlobals(foo);
echo 'br';

echo 'After Call to CreateGlobals()br';
echo '$foo_error = ', $foo_error, 'br';
echo '$foo_ok = ', $foo_ok, 'br';

?



There is probably a better way to do this.
Check the docs on Variable Variables and the {} syntax.



At 10:01 PM 9/30/2001 -0700, Justin Garrett wrote:
But how would you use this to create new global variables with $td as the
prefix?

$td = foo;

then we want new global variables

$foo_error and $foo_ok created.

--
Justin Garrett

Jason G. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  function MyFunction($td)
  {
   global $$td;
   echo $$td; // echos 3
   $$td = 5;
  }
 
  $billybob = 3;
  MyFunction(billybob);
  file://Now $billybob = 5
 
  -Jason Garber
  IonZoft.com
 
  At 10:25 PM 9/30/2001 -0400, you wrote:
 
  I have used:
  
  global $$td;
  
  in the past with success...
  
  -Jason Garber
  IonZoft.com
  
  
  At 07:38 PM 9/30/2001 -0700, Justin Garrett wrote:
  Maybe something similar to this?
  
  function test($td){
  
   $global = global \$$td._error, \$$td._ok;;
   eval($global);
  
   $set = \$$td._error = \ERROR\; \$$td._ok = \OK\;;
   eval($set);
  }
  
  test(foo);
  echo $foo_error $foo_ok;
  
  --
  Justin Garrett
  
  Martin [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello!
   
How can I make a variable, which name I give to a function, global in
this function?
   
I want to make something like:
   
function MyFunc($sVarName)
{GLOBAL [$sVarName]_error, $sVarName_ok;

}
   
So if $sVarName = sHello, I want to access $sHello_error and
$sHello_ok in this function.
   
Any idea how I can make this variable gloabl and whats the easyst way
to
access this var then?
   
Martin
   
   
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
 
  At 10:25 PM 9/30/2001 -0400, Jason G. wrote:
 
  I have used:
  
  global $$td;
  
  in the past with success...
  
  -Jason Garber
  IonZoft.com
  
  
  At 07:38 PM 9/30/2001 -0700, Justin Garrett wrote:
  Maybe something similar to this?
  
  function test($td){
  
   $global = global \$$td._error, \$$td._ok;;
   eval($global);
  
   $set = \$$td._error = \ERROR\; \$$td._ok = \OK\;;
   eval($set);
  }
  
  test(foo);
  echo $foo_error $foo_ok;
  
  --
  Justin Garrett
  
  Martin [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello!
   
How can I make a variable, which name I give to a function, global in
this function?
   
I want to make something like:
   
function MyFunc($sVarName)
{GLOBAL [$sVarName]_error, $sVarName_ok;

}
   
So if $sVarName = sHello, I want to access $sHello_error and
$sHello_ok in this function.
   
Any idea how I can make this variable gloabl and whats the easyst way
to
access this var then?
   
Martin
   
   
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
 



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


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




[PHP] Warning: Sybase message: Incorrect syntax near 't'.

2001-10-01 Thread Caleb Carvalho

Hi am trying to add data from html form,  and it seems like the line 14 in 
my script,

$sybase_query=INSERT into problem 
VALUES('$product','$pro_title','$description','$solution');
$sybase_result=sybase_query($sybase_query);


Warning: Sybase message: Incorrect syntax near 't'. (severity 15) in 
/var/www/html/process.php on line 14

Warning: Sybase message: Unclosed quote before the character string ')'. 
(severity 15) in /var/www/html/process.php on line 14

when trying to insert the following data


Product :Test Director

Problem Title : Doesn\'t work

Description: I dont knw why

Solution : dondd





Caleb Carvalho
Application Engineer
LoadRunner/APM
-
Enterprise Testing and Performance Management Solutions
-
Mercury Interactive
410 Frimley Business Park
Frimley, Surrey.  GU16 7ST
United Kingdom
Telephone :  +44 (0)1276 808300


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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




Re: [PHP] socket_get_status()

2001-10-01 Thread Mukul Sabharwal

Hi,

Well I'm not totally sure, why socket_get_status would
not give you the correct value, other than a bug, as
the manual does indicate the socket functions are
experimental.

There are altenative ways to get the number of bytes
in the buffer, like using ioctl with FIONREAD,
ofcourse that is a C function, and I can't really
locate a PHP counterpart for it, other than what may
be a counterpart (socket_get_status). However yet
another solution is using the recv() counterpart,
socket_recv() with the MSG_PEEK flag.

Now you'd probably open up a local copy of the php
manpages, hunting for socket_recv()! Well it's not
there, it's an undocumented function (yet), and to my
knowlegde exists in PHP 4.0.7, atleast in the CVS.

function prototype:
mixed socket_recv(resource socket, int len, int flags)

and example usage:
$data = socket_recv($sockfd, $nbytes, MSG_PEEK);
$len = sizeof($data);

Now you would have to loop through the the complete
buffer, and let me remind you, that MSG_PEEK means
peeking into the buffer, it does not actually remove
the data from the recv() queue but only gives you a
copy, if you call the function without MSG_PEEK you
will get the same data, and then the data will be
discarded.

This is one way of finding out the no. of bytes in the
buffer, ofcourse socket_get_status() is surely much
better.

Incase I interpreted you incorrectly and you wanted to
know the no. of bytes the recieve buffer can hold then
here's the function, and this is also 4.0.7+ :

function prototype:
mixed socket_getopt(resource socket, int level, int
optname)

example usage:

$info = socket_getopt($sockfd, SOL_SOCKET, SO_RCVBUF);

and it remains pretty much the same for the send
buffer :

$info = socket_getopt($sockfd, SOL_SOCKET, SO_SNDBUF);

Hope that helps.

P.S - phpguru.org, nice domain name.

=
*
Know more about me:
http://www.geocities.com/mimodit
*

__
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com

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




[PHP] Sybase Result Paging

2001-10-01 Thread Veniamin Goldin

Hi all !
Does anybody has a solution of paging result for Sybase + PHP ?

Like Prev 1 2 3 4 5 Next

Thanks.


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




[PHP] php and java problem

2001-10-01 Thread Nikola Veber

Hi !

I was able to determine the user's screen resolution, but I'd like to let php know 
that(the next page loaded should be in 
the right resolution, I'd like to pass a value to php, but I don't know how).

Thanx
Nikola




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




Re: [PHP] php and java problem

2001-10-01 Thread George Pitcher

Nikola,

I'm not a javascript user and new to php too.

Is it possible to form your javascript result into a 'hidden' form value.
That could then be read by the next php page.

HTH

George
- Original Message -
From: Nikola Veber [EMAIL PROTECTED]
To: php forum [EMAIL PROTECTED]
Sent: Sunday, September 30, 2001 10:36 PM
Subject: [PHP] php and java problem


 Hi !

 I was able to determine the user's screen resolution, but I'd like to let
php know
 that(the next page loaded should be in
 the right resolution, I'd like to pass a value to php, but I don't know
how).

 Thanx
 Nikola




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


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


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




[PHP] Re: newbie: extracting lines from a text file w/ php

2001-10-01 Thread user

Hi.
You should go on the forum php.db.



Sc wrote:

 Hi;
 
 I am new to php and i need to extract specific lines of data from a plain
 text file and insert it into a sql db Can anyone give me some details
 on howto do this? or an example to read the specific line that i need?
 
 Thanks.
 
 
 -sc
 


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




[PHP] php_admin_flag safe_mode off

2001-10-01 Thread Richard Kurth


 Way will this Command not work in the httpd.conf file
 I have safe mode turned on in the php.ini file but I what it off in
 one of my sites so I added  php_admin_flag safe_mode off to the virtualhost
 that I want it off in like below
 VirtualHost
other stuff
  php_admin_flag safe_mode off
/VirtualHost

 According to the manual you can turn any variable that is in the php.ini
 file on or off in the https.conf file by adding










-- 
Best regards,
 Richard  
mailto:[EMAIL PROTECTED]


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




[PHP] PHP Chat

2001-10-01 Thread Jordan Elver

Hi,
Can anyone recommend a good, configurable php chat?
I've tried phpMyChat which seems pretty good.

Any ideas?

Cheers,

Jord
-- 
Jordan Elver
Web Developer
The InternetOne UK Ltd

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




[PHP] Assistance Wanted Time:11:58:28 AM

2001-10-01 Thread php-general

FROM:  MARIAM ABACHA 

Dear friend, 
 
Following the sudden death of my husband, Late General 
Sanni Abacha, the former head of state of the federal 
Republic of Nigeria in June 1998, I have been thrown 
into a state of utter confusion, frustration and 
hopelessness by the present civilian administration. 
Security agents in Nigeria have subjected me to 
physical and psychological tortures. One of my sons is 
still under detention as well as arraigned before a 
Federal High Court of Nigeria for an offence he did 
not commit. As a widow, that is so traumatized, I have 
lost hope and confidence in anybody within the country. 
 
You must have heard over the media and the Internet on 
the recovery of various huge sums of money deposited 
by my late husband in different security firms abroad. 
Some willingly gave up their secrets and disclosed our 
money confidently lodged with them and many 
out-rightly declined lodgment. In fact the total sum 
discovered by the Government so far is to the tune of 
$700 million dollars. And the government has not 
relented in its efforts to completely bring my 
children and I back to square one. This is why I 
deemed it necessary to act fast by contacting anybody 
abroad for assistance. Furthermore, due to the 
security network placed on my daily activities I 
cannot afford to visit any embassy for a possible 
solution, hence I have decided to contact you and I do 
hope you will be the person God is going to use 
torescue my family and I. 
 
I have deposited the sum of $35 million dollars in a 
security firm abroad as whose name is with held for 
now for security reasons until we fully commence 
communication. I shall be grateful if you could 
receive this fund on my behalf for safekeeping. 
Adequate arrangement has been made for receiving the 
fund. It is totally risk free. This arrangement is 
known to you, my brother (who is contacting you and I 
only. This means that my brother will deal directly 
with you as surveillance is on me. My brother’ name is 
JIMOH ABU. 
 
You are entitled to 15% of the total sum. I hope to 
invest a proportion of the balance in your country. 
Please forward your private Telephone and Fax numbers 
so that we can fully commence communication 
immediately. 
 
I will quite appreciate, if you accept my 
proposal in good faith. I look forward to receiving 
your urgent reply to my plea. 
 
Yours truly, 
 
Hajia Mariam Abacha 

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




RE: [PHP] word filter

2001-10-01 Thread Richard Heyes

 There's a better way to do this:

 ?
  $naughty_words = array(
 'poop',
 'bum',
 'religion'
   );

  echo in_array($text, $naughty_words) ? found bad words! : text is
 clean!;
 ?

This won't work, since you're trying to find the whole of $text in the array
$naughty_words.

--
Richard Heyes
I know not with what weapons World War III will be fought, but World War IV
will be fought with sticks and stones. - Albert Einstein



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




Re: [PHP] Assistance Wanted Time:11:58:28 AM

2001-10-01 Thread Duncan Hill

On Mon, 1 Oct 2001 [EMAIL PROTECTED] wrote:

 FROM:  MARIAM ABACHA

 Dear friend,

*snicker*  They aren't content with good old postal mail (my parents'
company used to get these ALL the time!) - they've gone electronic!
Wonder if I can create a killfile for that kind of mail.  Wonder how
many people use nigeria and money in the same email...

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.



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




[PHP] still learning php

2001-10-01 Thread Caleb Carvalho

I posted a msg earlier on regarding error when adding text with quotes '
..
I have just found out thar I need to use addslash() function,

my q's is

where do i put this function?



Caleb Carvalho
Application Engineer
LoadRunner/APM
-
Enterprise Testing and Performance Management Solutions
-
Mercury Interactive
410 Frimley Business Park
Frimley, Surrey.  GU16 7ST
United Kingdom
Telephone :  +44 (0)1276 808300


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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




Re: [PHP] php and java problem

2001-10-01 Thread Alexander Deruwe

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sunday 30 September 2001 21:36, Nikola Veber wrote:
 Hi !

 I was able to determine the user's screen resolution, but I'd like to let
 php know that(the next page loaded should be in
 the right resolution, I'd like to pass a value to php, but I don't know
 how).

pagethatdeterminesresolution.php determines the resolution, and has a link 
such as this one:

a href=correctpage.php?Xres=640Yres=480Link/a
(The numbers are pure fiction ofcourse, you need to get them.)

This means that in correctpage.php you will have two variables, $Xres and 
$Yres that will represent the resolution.

Alexander
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7uG1AySJLuRUx8aQRAkf0AJwMutj7TZ3HCqFGEEyv0Gn8souqdACdFToE
20D9LSWxEYKAwOYvHD8psMU=
=Ghac
-END PGP SIGNATURE-

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




Re: [PHP] still learning php

2001-10-01 Thread Dimitris Kossikidis

$field_value = "I 'm bla bla";
$field_value  = addslashes($field_value);

$sql = "Insert into TABLE values('$field_value');


- Original Message -
From: "Caleb Carvalho" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 01, 2001 2:05 PM
Subject: [PHP] still learning php


 I posted a msg earlier on regarding error when adding text with quotes '
 ..
 I have just found out thar I need to use addslash() function,

 my q's is

 where do i put this function?



 Caleb Carvalho
 Application Engineer
 LoadRunner/APM
 --
---
 Enterprise Testing and Performance Management Solutions
 --
---
 Mercury Interactive
 410 Frimley Business Park
 Frimley, Surrey.  GU16 7ST
 United Kingdom
 Telephone :  +44 (0)1276 808300


 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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




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




[PHP] Array Elements While Loops

2001-10-01 Thread Tom Churm

hi,

my problem is this:  i'm using a while loop to check elements in an
Array for valid email syntax.  if $User[0] is a valid email address but
$User[1] is not, the code for $User[0] is still executed before the die
statement.  i need my loop to finish checking ALL array elements for
validity, and to then die BEFORE any further code is executed.  here's
what i have now (it doesn't work):

//loop to check for bad email addresses:
$j = 0;
$flag = 0;
while ($j  count($User)){
if
(($User[$j]!=)!eregi(^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$,
$User[$j])) 
{ 
$flag = 1;
$errorNo = $j + 1;
}
//die if flag is 1
if ($flag = 1) {
die (p align='center'bEmail #$errorNo is not a valid e-mail
address!/bbrbrbra
href='javascript:window.history.back();'Please return and correct
this./a/p); 
} 
else {
continue...
}

any suggestions would be great!

thanks much,

tom

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




RE: [PHP] Copying file to a network drive (in WinNT4)

2001-10-01 Thread joakim . andersson

Yes, but when you run it from command line it is run with your account that
has H:\ mapped.
The scheduler is run as the account 'System' and that doesn't know anything
about H:\.

/Joakim

 -Original Message-
 From: Warren Vail [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, September 29, 2001 7:27 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] Copying file to a network drive (in WinNT4)
 
 
 I'll give this a try and let you know.  PHP seems to be able 
 to get to my H
 drive when I execute via the command line;
 
 c:/apache/php/php.exe backup.php
 
 but seems to not be able to find the H drive when run as a 
 timed process;
 
 at 7:00pm each(M,T,W,T,F) c:/apache/php/php.exe backup.php 
(not sure
 about the exact syntax here)
 
 perhaps the UNC path will do it.
 
 Thanks,
 
 Warren Vail
 
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED]]
 Sent: Friday, September 28, 2001 1:14 AM
 To:   [EMAIL PROTECTED]
 Subject:  SV: [PHP] Copying file to a network drive (in WinNT4)
 
 My best bet is that PHP doesn't know that h:\ exists. I have 
 seen similar
 things before,
 though not in PHP. Have you tried using the UNC path instead
 (\\COMPUTER\SHARE)?
 
 I also tried to execute a direct copy command via command prompt:
 $cmd = cmd /c copy $src $dest;
 passthru($cmd);
 
 Try mounting the network drive in PHP then copy the file:
 
 $cmd = cmd /c net use h: \\COMPUTER\SHARE; //Mount drive
 passthru($cmd);
 
 //Copy the file here
 
 $cmd = cmd /c net use h: /delete; //Unmount the drive
 passthru($cmd);
 
 
 /Joakim
 
  -Ursprungligt meddelande-
  Från: Warren Vail [mailto:[EMAIL PROTECTED]]
  Skickat: fredag den 28 september 2001 03:37
  Till: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Kopia: [EMAIL PROTECTED]
  Ämne: RE: [PHP] Copying file to a network drive (in WinNT4)
 
 
  Let me know what you find, if anything.  Seems I may be 
 encountering a
  similar problem executing mysqldump from a php script as a
  scheduled command
  on nt4.  I can execute the command writing to a local drive
  and a remote
  drive when I execute from the DOS command line, but when 
 running as a
  scheduled (the AT command), the copy to the local drive 
 works, but the
  remote mounted drive fails.  Does this sound similar?
 
  Good Luck,
 
  Warren Vail
 
  -Original Message-
  From:   Joe Kaiping [mailto:[EMAIL PROTECTED]]
  Sent:   Thursday, September 27, 2001 12:30 PM
  To: [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Subject:RE: [PHP] Copying file to a network drive (in WinNT4)
 
 
 
   -Original Message-
   From: Ville Mattila [mailto:[EMAIL PROTECTED]]
   Sent: Thursday, September 27, 2001 11:10 AM
   To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Subject: Re: [PHP] Copying file to a network drive (in WinNT4)
  
Also, make sure that you have permission to create/modify
   the $dest file.
  
   Should be, because I can copy the file via normal way in
  Windows
  
  
 
  Hi again,
 
  Not sure what you're up against.  I searched
  http://www.php.net to confirm
  h:\file is the correct Windows file system syntax to use.
  Seems to be.
  Also there is no mention of copy() not working on windows,
  (except for when
  using a sharename instead of a mapped drive name. (But you're
  using a mapped
  drive name, h))
 
  The apache daemon on unix runs under the permissions of a
  certain system
  user, usually nobody.  Not sure how NT does it, but if it
  also runs under
  a specific user, maybe that user doesn't have permission to
  write to the
  file?
 
  However, the version of PHP I'm running gives a Permissions
  error message
  when it doesn't have permission to write to the file.  You
  got the following
  error instead, but I'm not sure about the behavior of PHP on
  windows, maybe
  a different error message is output when you don't have permission.
 
  Warning: Unable to create 'h:\redhouse.jpg': Invalid argument in
  c:\apache\htdocs\copypic.php on line 14
 
  Anyway, I was unable to reproduce the Invalid argument
  error on Unix. I
  would doubt that there in a bug with copy() for Windows
  without it already
  appearing on the PHP site.  So I'd guess that it is caused 
 because PHP
  doesn't like the format of the contents of either $src or
  $dest. I'd suggest
  going over those again with a magnifying glass.  It sounds
  like you already
  have, though, so I'm out of thoughts for right now.
 
  Sorry for not being able to help any more.  Best of luck!
 
  -Joe
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
 
 

--
PHP General Mailing List 

[PHP] Re: Array Elements While Loops

2001-10-01 Thread _lallous

 if ($flag = 1) {
 die (p align='center'bEmail #$errorNo is not a valid e-mail

should be:

if ($flag == 1) // notice the double-equal signs

Tom Churm [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi,

 my problem is this:  i'm using a while loop to check elements in an
 Array for valid email syntax.  if $User[0] is a valid email address but
 $User[1] is not, the code for $User[0] is still executed before the die
 statement.  i need my loop to finish checking ALL array elements for
 validity, and to then die BEFORE any further code is executed.  here's
 what i have now (it doesn't work):

 //loop to check for bad email addresses:
 $j = 0;
 $flag = 0;
 while ($j  count($User)){
 if

(($User[$j]!=)!eregi(^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-
]+)*$,
 $User[$j]))
 {
 $flag = 1;
 $errorNo = $j + 1;
 }
 //die if flag is 1
 if ($flag = 1) {
 die (p align='center'bEmail #$errorNo is not a valid e-mail
 address!/bbrbrbra
 href='javascript:window.history.back();'Please return and correct
 this./a/p);
 }
 else {
 continue...
 }

 any suggestions would be great!

 thanks much,

 tom



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




[PHP] PersonalDB.net .

2001-10-01 Thread



PersonalDB´Â »õ·Î¿î °³ÀÎ Áö½Ä ¹× Á¤º¸°ü¸® ½Ã½ºÅÛÀÔ´Ï´Ù.
PersonalDB¿Í ÇÔ²² »õ·Î¿î Á¤º¸È­ ¼¼°è·Î ³ª¾Æ°¡Áö ¾ÊÀ¸½Ã°Ú½À´Ï±î? 



To. php-general ´Ô²²
PersonalDB.net ȸ¿øÀ¸·Î ÃÊ´ë¹ÞÀ¸¼Ì½À´Ï´Ù.

From. À¥°ü¸®ÀÚ ( mailmaster )  
  _  



¾È³çÇϼ¼¿ä. ¸¸³ª ºË°Ô µÇ¾î ¹Ý°©½À´Ï´Ù.

º» »çÀÌÆ®´Â È¿À²ÀûÀ¸·Î ÀÚ½ÅÀÇ Áö½Ä°ú Á¤º¸, ÀÚ·áµéÀ» °ü¸®Çϸç ÀÌ·¯ÇÑ ÀڷḦ 
Ä£±¸µé°ú °øÀ¯Çϰųª ȨÆäÀÌÁö¿¡ °Ô½Ã,
¶Ç´Â Áö½Äâ°í¿¡¼­ ÆǸÅÇÒ ¼ö ÀÖ´Â »õ·Î¿î ½Ã½ºÅÛÀÔ´Ï´Ù.

±ÍÇϲ²¼­ ¿©·¯ Àڷᳪ Áö½ÄÀ» °®°í °è½Ã´Ù¸é ÀúÈñ¿Í ÇÔ²² ÇϽñ⸦ ¹Ù¶ø´Ï´Ù.
±ÍÇϲ²¼­ ƯÁ¤ºÐ¾ßÀÇ Àü¹®°¡³ª ¸Å´Ï¾Æ½Ã¶ó¸é ÀúÈñ¿Í ÇÔ²² ÇϽñ⸦ ¹Ù¶ø´Ï´Ù.
±ÍÇϲ²¼­ ¿©·¯ Á¤º¸¸¦ ã°í °è½Å´Ù¸é ÀúÈñ¿Í ÇÔ²² ÇϽñ⸦ ¹Ù¶ø´Ï´Ù.
±ÍÇϲ²¼­ ¿©·¯ ÀÚ·áµé¸¦ Ä£±¸³ª µ¿·áµé°ú °øÀ¯ÇÏ°í ½ÍÀ¸½Ã¸é ÀúÈñ¿Í ÇÔ²² ÇϽñ⸦ 
¹Ù¶ø´Ï´Ù.
±ÍÇϲ²¼­ ±ÍÇÏ¿Í ±ÍÇÏÀÇ Ä£¿ìµé¸¸ÀÇ ¿Â¶óÀÎ ¸ðÀÓÀ» °®°í ½ÍÀ¸½Ã´Ù¸é ÀúÈñ¿Í ÇÔ²² 
ÇϽñ⸦ ¹Ù¶ø´Ï´Ù.
±ÍÇϲ²¼­ ±ÍÇÏÀÇ Áö½ÄÀ¸·Î ¸Å¿ù ÀÏÁ¤ÇÑ ¼öÀÔÀ» ¾ò°í ½ÍÀ¸½Ã¸é ÀúÈñ¿Í ÇÔ²² ÇϽñ⸦ 
¹Ù¶ø´Ï´Ù.
±ÍÇϲ²¼­ ȨÆäÀÌÁö¸¦ °®°í °è½Ã°Å³ª ȨÆäÀÌÁö¸¦ ¸¸µå½Ç ¿¹Á¤À̸é ÀúÈñ¿Í ÇÔ²² 
ÇϽñ⸦ ¹Ù¶ø´Ï´Ù.
±ÍÇϲ²¼­ ȸ»ç¿Í Áý, PC¹æµî ¿©·¯ Àå¼Ò¿¡¼­ ÄÄÇ»Å͸¦ »ç¿ëÇϽŴٸé ÀúÈñ¿Í ÇÔ²² 
ÇϽñ⸦ ¹Ù¶ø´Ï´Ù.

À§ÀÇ Áö½Ä°ü¸® ÀÌ¿Ü¿¡µµ ¸¹Àº ¼­ºñ½º°¡ Á¦°øµÇ¸ç ¼­ºñ½º´Â °è¼Ó È®´ëµÇ°í ÀÖ½À´Ï´Ù.

°¡ÀÔÀº ¹«·áÀÔ´Ï´Ù.

ÆíÁö°¡ ±ÍÇÏ¿Í ÇÔ²² »õ·Î¿î Áö½Ä,Á¤º¸È°µ¿À» ÇÒ ¼ö ÀÖ´Â ÀÛÀº Àο¬ÀÌ µÉ ¼ö ÀÖ±æ 
Áø½ÉÀ¸·Î ¹Ù¶ó¸ç, Çã¶ô¾øÀÌ º»
¸ÞÀÏÀ» º¸³½µ¥ ´ëÇÏ¿© Á˼۽º·± ¸¶À½À» ±ÝÇÒ ¼ö ¾ø½À´Ï´Ù.
¾ÕÀ¸·Î Ãß°¡µÇ´Â ¼­ºñ½º¿Í µî·ÏµÇ´Â ¿©·¯ ¿ì¼öÇÑ ÀÚ·áµé¿¡ °üÇÑ Á¤º¸¸¦ Á¦°øÇØ µå¸± 
¿¹Á¤ÀÔ´Ï´Ù¸¸ ¸¸ÀÏ ÀúÈñ »çÀÌÆ®·ÎºÎÅÍ
¸ÞÀÏÀ» ¹ÞÁö ¾Ê±â¸¦ ¿øÇϽô °æ¿ì ¾Æ·¡ÀÇ ¼ö½Å°ÅºÎ¸¦ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.

°¨»çÇÕ´Ï´Ù.

 http://www.PersonalDB.net



 PersonalDB´Â?  




 °³Àεðºñ   - ÀÚ·áÀÇ º¸°ü, °øÀ¯, ¸Å¸Å¸¦ À§ÇÑ °³ÀÎDB Á¦°ø
- °³ÀÎÀÚ·á½Ç, °³Àξٹü, °³Àκϸ¶Å©·Î ±¸¼º
- º¸°ü¿ë,ȨÆäÀÌÁö °Ô½Ã,ÀÚ·á°øÀ¯,Áö½Äâ°í¿¡¼­ÀÇ ÆǸſëÀ¸·Î È°¿ë  

 °³Àεðºñ   - ½ºÄÉÁÙ·¯, ÀϱâÀå, ¸Þ¸ðÀå, To Do List, °³ÀÎÁÖ¼Ò·Ï...
- °³ÀÎÁ¤º¸°ü¸®¿¡ ÇÊ¿äÇÑ ¸ðµç °³Àμ­ºñ½º Á¦°ø
- ¸ðµç ¼­ºñ½ºÀÚ·á´Â ´Ù¾çÇÏ°Ô È°¿ëµÊ 

 °³Àεðºñ   - ¾Æ¿ô·èÀÇ ±â´ÉÀ» ¸ðµÎ À¥À¸·Î
- °­·ÂÇÏ°í Æí¸®ÇÑ ÁøÁ¤ÇÑ À¥¸ÞÀÏ
- µð·ºÅ丮°ü¸®,¼ö½Å°ÅºÎÁ¶°Ç,ºÎÀçÁßÀÀ´ä,POPÁö¿øµî °­·ÂÇÑ ±â´É

 °³Àεðºñ   - ¸ðµç ȸ¿øDBÀÇ ºÐ·ùº° ¸ðÀ½
- Àü¹®°¡ÄÚ³Ê, QA µîÀÇ ´Ù¾çÇÑ Áö½Ä½Àµæ¹æ¹ý
- ȸ¿ø °³ÀÎÁö½Ä, ÀÚ·áÀÇ ÆǸŰ¡ °¡´É
- °¢ ȸ¿øµéÀÇ Àü¹®°Ô½ÃÆǸðÀ½À¸·Î ´Ù¾çÇÑ ÀÚ·á ½Àµæ°¡´É   

 °³Àεðºñ   - ȨÆäÀÌÁö ¸¶¹ý»ç·Î °£´ÜÇÑ ±¸¼º °¡´É
- ÆÄÀϸŴÏÀú·Î À¥»ó¿¡¼­ »èÁ¦, ¾÷/´Ù¿î·Îµå, ¼öÁ¤ °¡´É
- °³ÀÎDBÀÚ·áÀÇ ÀÚµ¿¾÷µ¥ÀÌÆ® ±â´ÉÀ¸·Î °ü¸® °£Æí
- °øÁö»çÇ×, °Ô½ÃÆÇ, ¹æ¸í·Ï, Ä«¿îÅÍµî ´Ù¾çÇÑ ºÎ°¡¼­ºñ½º  

 °³Àεðºñ   - Æó¼â¼Ò¸ðÀÓ°ú °ø°³¼Ò¸ðÀÓÀ¸·Î ±¸ºÐ
- °³ÀÎDBÀÇ °øÀ¯ °¡´É
- °øÁö»çÇ×, °Ô½ÃÆÇ, ÀÚ·á½Ç, ȸ¿øÁÖ¼Ò·Ïµî ´Ù¾çÇÑ ¼­ºñ½º Á¦°ø 

 ¾î¶²ºÐ¿¡°Ô ÇÊ¿äÇÒ±î¿ä? 


*   Áý, Çб³, ȸ»ç, PC¹æµî ¿©·¯ Àå¼Ò¿¡¼­ PC¸¦ »ç¿ëÇÏ´Â ºÐ 
*   ¾î¶² ºÐ¾ßÀÇ ÀڷḦ ¸ðÀ¸½Ã°Å³ª ¸¹ÀÌ º¸À¯ÇÏ°í °è½Å ºÐ 
*   ÇÑ ºÐ¾ßÀÇ Àü¹®°¡À̰ųª ¸Å´Ï¾ÆÀ̽ŠºÐ 
*   Áß¿äÇÑ ÀڷḦ º¸°üÇØ¾ß ÇÏ´Â ºÐ 
*   ÀÚ½ÅÀÇ Áö½ÄÀ̳ª Á¤º¸, ÀÚ·á·Î ¸Å¿ù ¼öÀÍÀ» ¿Ã¸®°í ½ÍÀ¸½Å ºÐ 
*   ÇÊ¿äÇÑ Áö½ÄÀ̳ª Á¤º¸¸¦ ã¾Æ À¥¼­ÇÎÀ» ÀÚÁÖ ÇϽô ºÐ 
*   ƯÁ¤ÇÑ ºÐ¾ß¿¡ ´ëÇÏ¿© Àü¹®°¡ÀÇ µµ¿òÀÌ ÇÊ¿äÇϽŠºÐ 
*   Ä£±¸³ª µ¿·áµé°ú ÀڷḦ ±³È¯,°øÀ¯ÇÒ ÇÊ¿ä°¡ ÀÖÀ¸½Å ºÐ 
*   ȨÆäÀÌÁö¸¦ °®°í Àְųª ¸¸µé·Á°í ÇϽô ºÐ 
*   ȨÆäÀÌÁö¸¦ °®°í ÀÖÁö¸¸ °ü¸®ÇÏ´Â µ¥¿¡ ¾î·Á¿òÀ» ´À³¢°Å³ª ±ÍÂúÀ¸½Å ºÐ 
*   Ä£±¸, µ¿Ã¢, µ¿·áµî°ú ¿ì¸®¸¸ÀÇ ¸ðÀÓÀ» ¸¸µé°í ½ÍÀ¸½Å ºÐµé 
*   ¾î¶² ÁÖÁ¦¿¡ ´ëÇÏ¿© ¿©·¯ »ç¶÷µé°úÀÇ ¸ðÀÓÀÌ ÇÊ¿äÇϽŠºÐµé 
*   Àϱâ,¸Þ¸ðÀå,½ºÄÉÁÙ·¯µî ¿©·¯ °³Àμ­ºñ½º¸¦ ÀÌ¿ëÇÏ°í ½ÍÀ¸½Å ºÐ 
*   Æí¸®ÇÏ°í °­·ÂÇÑ ÀüÀÚ¿ìÆíÀÌ ÇÊ¿äÇϽŠºÐ 
*   °¡Á·,Ä£±¸,µ¿·á¿ÍÀÇ »çÁøÀ» ÀüÀÚ¾Ù¹üÀ¸·Î Á¦ÀÛÇÏ°í ½ÍÀ¸½Å ºÐ 
*   ¹«¾ùº¸´Ùµµ ü°èÀûÀ̸ç È¿°úÀûÀÎ Áö½Ä°æÀï·ÂÀ» °®Ãß°í ½ÍÀ¸½Å ºÐ



ÀÌ·± ºÐµéÀº ¾î¼­ °¡ÀÔÇϼ¼¿ä. »õ·Î¿î ¼­ºñ½º¸¦ ´À³¢½Ç ¼ö ÀÖ½À´Ï´Ù.

 °¡ÀÔºñ¿ë ¹× ÀÌ¿ë·á´Â?  


¹°·Ð °¡ÀÔ°ú ÀÌ¿ë·á´Â ¹«·áÀÔ´Ï´Ù.
´ÜÁö °¡ÀÔÇϽñ⸸ Çϸé À§ÀÇ ¸ðµç ¼­ºñ½º¸¦ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.
ÇÏÁö¸¸ ¸¹Àº ¿ë·®°ú Ưº°ÇÑ ÇýÅÃÀ» ¿øÇϽô ºÐµéÀ» À§ÇÏ¿© ÇÁ¸®¹Ì¾öȸ¿øÁ¦µµ¸¦ ¿î¿µÇÏ°í 
ÀÖ½À´Ï´Ù.
ÇÁ¸®¹Ì¾öȸ¿øÀ¸·Î °¡ÀÔÇϽøé Àú·ÅÇÑ °¡°ÝÀ¸·Î ÃæºÐÇÑ ¿ë·®°ú ÇÔ²² Áö½Äâ°í¿¡¼­ÀÇ ¸Å¸Å³ª 
ÄÁÅÙÃ÷±¸ÀԽà Ưº°ÇÑ ÇýÅÃÀ» µå¸³´Ï´Ù.
ÇÁ¸®¹Ì¾öȸ¿øÀ¸·Î °¡ÀÔ... ÁöºÒµÇ´Â ºñ¿ëº¸´Ù ¸¹Àº ÀÌÀÍÀÌ È¸¿ø¿©·¯ºÐ²² µ¹¾Æ°©´Ï´Ù.
Áö±Ý °¡ÀÔÇϼ¼¿ä 

 PersonaDB ¿ÀDZâ³äÀ̺¥Æ®   


Áö±Ý ¿ÀDZâ³ä À̺¥Æ®Çà»ç°¡ ¿­¸®°í ÀÖ½À´Ï´Ù.
´Ü 1°³¿ù°£¸¸ÀÇ ±âȸ ( 2001.9.1 ~ 2001.9.30 )
Áö±Ý ÇÁ¸®¹Ì¾öȸ¿øÀ¸·Î °¡ÀÔÇϽøé 1°³¿ù ¹«·áÀÌ¿ëÀÇ ±âȸ¸¦ µå¸³´Ï´Ù.
³õÄ¡Áö ¸¶¼¼¿ä.  

 http://www.PersonalDB.net
Copyright ¨Ï2001 PersonalDB.net All rights reserved. With Questions,
please E-mail us 

Re: [PHP] word filter

2001-10-01 Thread _lallous

and btw Maxim...I didn't write the $naught_words array in the first place...

Maxim Maletsky ) [EMAIL PROTECTED] wrote in message
news:014a01c14a54$05530640$4829abd4@tatiana...


Sorry, I meant since PHP 4 only, as it is when function in_array() was
introduced

Maxim Maletsky
www.PHPBeginner.com


-Original Message-
From: Maxim Maletsky (PHPBeginner.com)
[mailto:[EMAIL PROTECTED]]
Sent: lunedì 1 ottobre 2001 10.33
To: '_lallous'; [EMAIL PROTECTED]
Cc: 'Kristjan Kanarik'; 'Richard Heyes'
Subject: RE: [PHP] word filter



There's a better way to do this:

?
 $naughty_words = array(
'poop',
'bum',
'religion'
  );

 echo in_array($text, $naughty_words) ? found bad words! : text is
clean!; ?

Since PHP though...


P.S: are you considering 'region' a naughty word, _lallous? Careful
there...

Maxim Maletsky
www.PHPBeginner.com



-Original Message-
From: _lallous [mailto:[EMAIL PROTECTED]]
Sent: lunedì 1 ottobre 2001 11.15
To: [EMAIL PROTECTED]
Subject: Re: [PHP] word filter


 $naughty_words = array(
 'poop',
 'bum',
 'religion'
 );
if (eregi(join('|', $naughty_words), $text))
  echo found bad words!;
else
  echo text is clean!;

Richard Heyes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...

  Looking for a function which checks the user input for unwanted
  (mostly
  rude) words. Those words should be defined first in array or so of
  course...  should be case insensitive as well.

 $text = 'This text contains a naughty word: Bum'; $naughty_words =
 array( 'poop',
 'bum',
 'religion'
 );

 function naughty_words($text, $naughty_words){
 $text = strtolower($text);
 foreach($naughty_words as $value){
 if(strpos($text, strtolower($value)) !== FALSE)
 return TRUE;
 }

 return FALSE;
 }

 echo naughty_words($text, $naughty_words) ? 'Found naughty words' :
 'Text
is
 clean';

 --
 Richard Heyes
 I know not with what weapons World War III will be fought, but World
 War
IV
 will be fought with sticks and stones. - Albert Einstein





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



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





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




[PHP] Re: Array Elements While Loops

2001-10-01 Thread Tom Churm

hi, _lallous:

i've tried it with == and it still doesn't work: code for the valid
variables is executed before my die() function is called.

thanks, though,

tom

_lallous wrote:
 
  if ($flag = 1) {
  die (p align='center'bEmail #$errorNo is not a valid e-mail
 
 should be:
 
 if ($flag == 1) // notice the double-equal signs
 
 Tom Churm [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  hi,
 
  my problem is this:  i'm using a while loop to check elements in an
  Array for valid email syntax.  if $User[0] is a valid email address but
  $User[1] is not, the code for $User[0] is still executed before the die
  statement.  i need my loop to finish checking ALL array elements for
  validity, and to then die BEFORE any further code is executed.  here's
  what i have now (it doesn't work):
 
  //loop to check for bad email addresses:
  $j = 0;
  $flag = 0;
  while ($j  count($User)){
  if
 
 (($User[$j]!=)!eregi(^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-
 ]+)*$,
  $User[$j]))
  {
  $flag = 1;
  $errorNo = $j + 1;
  }
  //die if flag is 1
  if ($flag = 1) {
  die (p align='center'bEmail #$errorNo is not a valid e-mail
  address!/bbrbrbra
  href='javascript:window.history.back();'Please return and correct
  this./a/p);
  }
  else {
  continue...
  }
 
  any suggestions would be great!
 
  thanks much,
 
  tom

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




Re: [PHP] still learning php

2001-10-01 Thread Caleb Carvalho

Hi Dimitris,

thanks, but what if I have 5 fields to add into ie name,surname,comments?



Caleb Carvalho
Application Engineer
LoadRunner/APM
-
Enterprise Testing and Performance Management Solutions
-
Mercury Interactive
410 Frimley Business Park
Frimley, Surrey.  GU16 7ST
United Kingdom
Telephone :  +44 (0)1276 808300



From: Dimitris Kossikidis [EMAIL PROTECTED]
To: Caleb Carvalho [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] still learning php
Date: Mon, 1 Oct 2001 14:29:14 +0300

$field_value = I 'm bla bla;
$field_value  = addslashes($field_value);

$sql = Insert into TABLE values('$field_value');


- Original Message -
From: Caleb Carvalho [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 01, 2001 2:05 PM
Subject: [PHP] still learning php


  I posted a msg earlier on regarding error when adding text with quotes '
  ..
  I have just found out thar I need to use addslash() function,
 
  my q's is
 
  where do i put this function?
 
 
 
  Caleb Carvalho
  Application Engineer
  LoadRunner/APM
  
--
---
  Enterprise Testing and Performance Management Solutions
  
--
---
  Mercury Interactive
  410 Frimley Business Park
  Frimley, Surrey.  GU16 7ST
  United Kingdom
  Telephone :  +44 (0)1276 808300
 
 
  _
  Get your FREE download of MSN Explorer at 
http://explorer.msn.com/intl.asp
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


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



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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




Re: [PHP] still learning php

2001-10-01 Thread Dimitris Kossikidis

Use addslashes() to escape single quotes or double quotes. It 's in the
manual

// giving some values
$firstname ="Bob";
$lastname = "O' Reily"; // This could cause an error if not use addslashes
$address = "Somewhere";
$age= 19;

// adding slashes to quotes
$firstname = addslashes($firstname);
$lastname = addslashes($lastname);
$address = addslashes($address);

$sql =  " insert into TABLE values ( '$firstname', '$lastname', '$address',
$age) ";

- Original Message -
From: "Caleb Carvalho" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, October 01, 2001 3:36 PM
Subject: Re: [PHP] still learning php


 Hi Dimitris,

 thanks, but what if I have 5 fields to add into ie name,surname,comments?



 Caleb Carvalho
 Application Engineer
 LoadRunner/APM
 --
---
 Enterprise Testing and Performance Management Solutions
 --
---
 Mercury Interactive
 410 Frimley Business Park
 Frimley, Surrey.  GU16 7ST
 United Kingdom
 Telephone :  +44 (0)1276 808300



 From: "Dimitris Kossikidis" [EMAIL PROTECTED]
 To: "Caleb Carvalho" [EMAIL PROTECTED]
 CC: [EMAIL PROTECTED]
 Subject: Re: [PHP] still learning php
 Date: Mon, 1 Oct 2001 14:29:14 +0300
 
 $field_value = "I 'm bla bla";
 $field_value  = addslashes($field_value);
 
 $sql = "Insert into TABLE values('$field_value');
 
 
 - Original Message -
 From: "Caleb Carvalho" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, October 01, 2001 2:05 PM
 Subject: [PHP] still learning php
 
 
   I posted a msg earlier on regarding error when adding text with quotes
'
   ..
   I have just found out thar I need to use addslash() function,
  
   my q's is
  
   where do i put this function?
  
  
  
   Caleb Carvalho
   Application Engineer
   LoadRunner/APM
  

--
 ---
   Enterprise Testing and Performance Management Solutions
  

--
 ---
   Mercury Interactive
   410 Frimley Business Park
   Frimley, Surrey.  GU16 7ST
   United Kingdom
   Telephone :  +44 (0)1276 808300
  
  
   _
   Get your FREE download of MSN Explorer at
 http://explorer.msn.com/intl.asp
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
  
  
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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




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




Re: [PHP] still learning php

2001-10-01 Thread Miles Thompson


You just add more fields:
$sql = Insert into TABLE values('$name', $surname, $comments);
that's assuming that the order of the data exactly matches the order of the 
fields in the table.

Take the time to work through a couple of MySQL tutorials(assuming that's 
what you're using), and have a look at the tutorials Julie Meloni has on 
her http://www.thickbook.com site.

Miles

At 12:36 PM 10/1/01 +, Caleb Carvalho wrote:
Hi Dimitris,

thanks, but what if I have 5 fields to add into ie name,surname,comments?



Caleb Carvalho
Application Engineer
LoadRunner/APM
-
Enterprise Testing and Performance Management Solutions
-
Mercury Interactive
410 Frimley Business Park
Frimley, Surrey.  GU16 7ST
United Kingdom
Telephone :  +44 (0)1276 808300



From: Dimitris Kossikidis [EMAIL PROTECTED]
To: Caleb Carvalho [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] still learning php
Date: Mon, 1 Oct 2001 14:29:14 +0300

$field_value = I 'm bla bla;
$field_value  = addslashes($field_value);

$sql = Insert into TABLE values('$field_value');


- Original Message -
From: Caleb Carvalho [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 01, 2001 2:05 PM
Subject: [PHP] still learning php


  I posted a msg earlier on regarding error when adding text with quotes '
  ..
  I have just found out thar I need to use addslash() function,
 
  my q's is
 
  where do i put this function?
 
 
 
  Caleb Carvalho
  Application Engineer
  LoadRunner/APM
  --
---
  Enterprise Testing and Performance Management Solutions
  --
---
  Mercury Interactive
  410 Frimley Business Park
  Frimley, Surrey.  GU16 7ST
  United Kingdom
  Telephone :  +44 (0)1276 808300
 
 
  _
  Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


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


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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


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




[PHP] CD-R sur la PROVENCE

2001-10-01 Thread HUGUES



  bonjour , 

Aimeriez-vous survoler pendant 20 mn la Provence en hélicoptère ?
admirer plus de 400 photos et textes inédits ?
tout cela existe maintenant sur un simple CD expédiable au tarif lettre.
pour plus de détails visitez la rubrique CATALOGUE du site :

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

notre Société propose également des CD sur Paris , Londres , Amsterdam , Barcelone , 
etc. cordialement
Alain HUGUES
Sté Lou Prouvenco
91,rue de Bucarest
13300 Salon-de-Provence
33 04 90 45 05 69

pour ne plus recevoir notre e-mail
retournez ce message avec en objet : REMOVE


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




Re: [PHP] still learning php

2001-10-01 Thread Dimitris Kossikidis

$sql = " select firstname, lastname, address etc from TABLE";

execute sql statement;

while fetching records {
$firstname = stripslashes( $firstname);
$lastname = stripslashes ( $lastname); //  "O\' Reily" now becomes "O'
Reily"
  }
that's all

- Original Message -
From: "Caleb Carvalho" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, October 01, 2001 4:32 PM
Subject: Re: [PHP] still learning php


 thank you s much that was much much better indeed :),

 i am assuming that i need to use the same for sql_quey sql_display
 is that correct?


 Caleb Carvalho
 Application Engineer
 LoadRunner/APM
 --
---
 Enterprise Testing and Performance Management Solutions
 --
---
 Mercury Interactive
 410 Frimley Business Park
 Frimley, Surrey.  GU16 7ST
 United Kingdom
 Telephone :  +44 (0)1276 808300



 From: "Dimitris Kossikidis" [EMAIL PROTECTED]
 To: "Caleb Carvalho" [EMAIL PROTECTED]
 CC: [EMAIL PROTECTED]
 Subject: Re: [PHP] still learning php
 Date: Mon, 1 Oct 2001 15:52:23 +0300
 
 Use addslashes() to escape single quotes or double quotes. It 's in the
 manual
 
 // giving some values
 $firstname ="Bob";
 $lastname = "O' Reily"; // This could cause an error if not use
addslashes
 $address = "Somewhere";
 $age= 19;
 
 // adding slashes to quotes
 $firstname = addslashes($firstname);
 $lastname = addslashes($lastname);
 $address = addslashes($address);
 
 $sql =  " insert into TABLE values ( '$firstname', '$lastname',
'$address',
 $age) ";
 
 - Original Message -
 From: "Caleb Carvalho" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Monday, October 01, 2001 3:36 PM
 Subject: Re: [PHP] still learning php
 
 
   Hi Dimitris,
  
   thanks, but what if I have 5 fields to add into ie
 name,surname,comments?
  
  
  
   Caleb Carvalho
   Application Engineer
   LoadRunner/APM
  

--
 ---
   Enterprise Testing and Performance Management Solutions
  

--
 ---
   Mercury Interactive
   410 Frimley Business Park
   Frimley, Surrey.  GU16 7ST
   United Kingdom
   Telephone :  +44 (0)1276 808300
  
  
  
   From: "Dimitris Kossikidis" [EMAIL PROTECTED]
   To: "Caleb Carvalho" [EMAIL PROTECTED]
   CC: [EMAIL PROTECTED]
   Subject: Re: [PHP] still learning php
   Date: Mon, 1 Oct 2001 14:29:14 +0300
   
   $field_value = "I 'm bla bla";
   $field_value  = addslashes($field_value);
   
   $sql = "Insert into TABLE values('$field_value');
   
   
   - Original Message -
   From: "Caleb Carvalho" [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Monday, October 01, 2001 2:05 PM
   Subject: [PHP] still learning php
   
   
 I posted a msg earlier on regarding error when adding text with
 quotes
 '
 ..
 I have just found out thar I need to use addslash() function,

 my q's is

 where do i put this function?



 Caleb Carvalho
 Application Engineer
 LoadRunner/APM

  
 
--
   ---
 Enterprise Testing and Performance Management Solutions

  
 
--
   ---
 Mercury Interactive
 410 Frimley Business Park
 Frimley, Surrey.  GU16 7ST
 United Kingdom
 Telephone :  +44 (0)1276 808300


 _
 Get your FREE download of MSN Explorer at
   http://explorer.msn.com/intl.asp


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


   
   
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
   
  
  
   _
   Get your FREE download of MSN Explorer at
 http://explorer.msn.com/intl.asp
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
  
  
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


 

[PHP] Re: session var being lost between pages

2001-10-01 Thread Chris Lee

echo $PHPSESSID on every page, is it the same on every page ?

I usually recommend that you create the register variables too.

else {
  $userid = '';
  $userpassword = '';
  session_register('userid');
  session_register('userpassword');
}

if $PHPSESSID is set then session_start() will find it and use it, if your
trying to override HTTP_COOKIE_VARS['PHPSESSID'] with
HTTP_GET_VARS['PHPSESSID'] I would also check if it is not thedefault
allready, change the code to relect that then

if (isset($HTTP_GET_VARS['PHPSESSID']) AND $PHPSESSID !=
$HTTP_GET_VARS['PHPSESSID'])

all small things, nothing big looks wrong. try it and see.

--

  Chris Lee
  [EMAIL PROTECTED]


Jean-Christian Imbeault [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 Ok, newbie I am but ... I seem to be losing my session vars when I load up
a
 different php page.

 My set-up:

 1- main page starts session and logs user in

 if (isset($PHPSESSID))
   session_start($PHPSESSID);
 else
   session_start();

 $PHPSESSID = session_id();
 $SID   = PHPSESSID=$PHPSESSID;

 if(!isset($userid)) {
login_form();
exit;
 }
 else {
session_register(userid, userpassword);
 }

 Once the user is logged in I have no problem accessin the vars $userid and
 $userpassword.

 On the page I even have an A HREF link to second php page and the vars
are
 accessible there also.

 However this other page has a form. When the user submits the form, a
third
 php page is loaded. On this third page the vars no longer have any values.

 Why is this? How can I access the vars from this third page?

 Thanks!

 Jc



 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




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




Re: [PHP] Recursion

2001-10-01 Thread Sheridan Saint-Michel

Recursion means you call a function which calls itself to get the job done.
Recursive functions have two parts, the base case and the recursive method.
The base case is the goal which signals that your function stops calling
itself...
sort of like the condition in a while loop... but for a function rather than
a loop.

Here is a simple recursive script I posted to this list a while back.

function Get_Tree($directory)
{
  global $dirs;

  if (substr($directory,-1) != /)
$directory = $directory . /;

  $fh = opendir($directory);
  while ($file = readdir($fh))
  {
if (is_dir($directory . $file)  $file != ..  $file != .)
{
  $dirs[count($dirs)] = $directory . $file;
  Get_Tree($directory.$file);
}
  }
  closedir($fh);
}


When you are done $dirs will be an array of all the directory names
below $directory (the initial value of $directory).  Here the base case
is when you reach a directory without any subdirectories (every $file
fails the if statement).

Anyway, I hope this helps.  If you have any specific questions about
recursion feel free to drop me a line  =P

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com

- Original Message -
From: Andres Montiel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 30, 2001 12:23 PM
Subject: [PHP] Recursion


 One of my classes next semester needs me to program using a language
 that does recurison. I don't really know what this means, though. Can
 PHP do this?

 Thanks!


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




Re: [PHP] Re: Recursion

2001-10-01 Thread Andres Montiel

Thank you so much! This eases my worries for next semester.

Would happen to have an example script showing PHP using recursion?

Thanks again!

Martin wrote:

Hi Andres,

Yes, PHP support recoursion. That means, that you are calling a function
again and again, but with new start-parameters. For example, if you want to
search a harddisc for a file, you will call your
function SearchFolder($path)
with C:\. If the function itself detects subfolder, it will call itself,
but with the parameters C:\Subfolder1, C:\Subfolder2 and so on. You
have to watch out then, the the function terminated correctly, if the
searched file is found.

Martin







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




[PHP] SOAP Tool Kit for PHP

2001-10-01 Thread Dahnke, Eric


My god does PHP need one. Or a library of functions to use.

Yes, I have built in CURL support and am reading the $HTTP_RAW_DATA_POST
variable and rolling my own as they say, but it sure would be nice. I've
seen Manual Lemos' soap classes, and they are cool, but aren't really what I
need. 

PHP is fast, has beautiful syntax and I love it, but I think it needs to
grow up a bit. I don't mean to start a war, but it is true, php needs to
evolve into something beyond a newbie language great for producing db driven
web-sites.

I wish I could help, and after a few more C classes I will be able to, but
until then, I can only hope some C wizard is producing something like this.
Web-services are going to be big. Independent of .net (*uck MS), but the
messaging (SOAP) paradigm over http is going to be big. How does php fit in
there?

It looks as though we're headed over to tomcat, and I'm probably going to
bring a bunch of php developers with me. And that sucks, because tomcat is
slow, and it takes twice as long to produce an application w/ non masters
level or big time CS people.

The first thing I'm going to try though is running php as a servlet under
tomcat, but it's only to get at the apache soap tools. See what I mean.

Thanks to all the php developers. 'gards - Eric

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




RE: [PHP] Warning: Sybase message: Incorrect syntax near 't'.

2001-10-01 Thread Mark Roedel

 -Original Message-
 From: Caleb Carvalho [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, October 01, 2001 4:04 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Warning: Sybase message: Incorrect syntax near 't'. 
 
 
 Hi am trying to add data from html form,  and it seems like 
 the line 14 in my script,
 
 $sybase_query=INSERT into problem 
 VALUES('$product','$pro_title','$description','$solution');
 $sybase_result=sybase_query($sybase_query);
 
 Warning: Sybase message: Incorrect syntax near 't'. (severity 15) in 
 /var/www/html/process.php on line 14
 
 Problem Title : Doesn\'t work

If I'm remembering right, Sybase would prefer to see this as
Problem Title : Doesn''t work

(That is, a single-quote within a string that you're passing off to
Sybase should be escaped by another single-quote, not by a slash.)


---
Mark Roedel   | Blessed is he who has learned to laugh
Systems Programmer|  at himself, for he shall never cease
LeTourneau University |  to be entertained.
Longview, Texas, USA  |  -- John Powell 

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




Re: [PHP] Array Elements While Loops

2001-10-01 Thread Steve Cayford

Where is the closing brace for your while loop?

-Steve

On Monday, October 1, 2001, at 07:04  AM, Tom Churm wrote:

 hi,

 my problem is this:  i'm using a while loop to check elements in an
 Array for valid email syntax.  if $User[0] is a valid email address but
 $User[1] is not, the code for $User[0] is still executed before the die
 statement.  i need my loop to finish checking ALL array elements for
 validity, and to then die BEFORE any further code is executed.  here's
 what i have now (it doesn't work):

 //loop to check for bad email addresses:
 $j = 0;
 $flag = 0;
 while ($j  count($User)){
 if
 (($User[$j]!=)!eregi(^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-
 z0-9-]+(\.[a-z0-9-]+)*$,
 $User[$j]))
 {
   $flag = 1;
   $errorNo = $j + 1;
 }
 //die if flag is 1
 if ($flag = 1) {
 die (p align='center'bEmail #$errorNo is not a valid e-mail
 address!/bbrbrbra
 href='javascript:window.history.back();'Please return and correct
 this./a/p);
   }
 else {
 continue...
 }

 any suggestions would be great!

 thanks much,

 tom

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



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




Re: [PHP] instant session expiration problem

2001-10-01 Thread hassan el forkani

hi
don't put an expiry date in the cookie, this way it should expire when the 
browser window is closed, just aguess...

regards


At 22:07 30/09/03, Ryan Mahoney wrote:
When a client date is ahead of my server or incorrect the cookie that php 
uses to maintain the session is expired immediately by the web 
browser.  This is an incredible pain!  I had once come across some 
document by Rasmus describing this problem but can't seem to find it 
now.  Does anyone know how to resolve this problem?

Thanks in advance for any help you can provide!  Please e-mail me directly.

Ryan Mahoney


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.251 / Virus Database: 124 - Release Date: 4/26/01

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



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




[PHP] Thank you all

2001-10-01 Thread Caleb Carvalho


thank you all, you've been a really good help
I must say i've learned a lot, i will now try and get busy

ps. this php mailing list really works :)

many thanks

Caleb Carvalho
Application Engineer
CSO Europe
LoadRunner/APM
-
Enterprise Testing and Performance Management Solutions
-
Mercury Interactive
410 Frimley Business Park
Frimley, Surrey.  GU16 7ST
United Kingdom
Telephone :  +44 (0)1276 808300



From: Dimitris Kossikidis [EMAIL PROTECTED]
To: Caleb Carvalho [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] still learning php
Date: Mon, 1 Oct 2001 17:08:00 +0300

$sql =  select firstname, lastname, address etc from TABLE;

execute sql statement;

while fetching records {
 $firstname = stripslashes( $firstname);
 $lastname = stripslashes ( $lastname); //  O\' Reily now becomes O'
Reily
   }
that's all

- Original Message -
From: Caleb Carvalho [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, October 01, 2001 4:32 PM
Subject: Re: [PHP] still learning php


  thank you s much that was much much better indeed :),
 
  i am assuming that i need to use the same for sql_quey sql_display
  is that correct?
 
 
  Caleb Carvalho
  Application Engineer
  LoadRunner/APM
  
--
---
  Enterprise Testing and Performance Management Solutions
  
--
---
  Mercury Interactive
  410 Frimley Business Park
  Frimley, Surrey.  GU16 7ST
  United Kingdom
  Telephone :  +44 (0)1276 808300
 
 
 
  From: Dimitris Kossikidis [EMAIL PROTECTED]
  To: Caleb Carvalho [EMAIL PROTECTED]
  CC: [EMAIL PROTECTED]
  Subject: Re: [PHP] still learning php
  Date: Mon, 1 Oct 2001 15:52:23 +0300
  
  Use addslashes() to escape single quotes or double quotes. It 's in the
  manual
  
  // giving some values
  $firstname =Bob;
  $lastname = O' Reily; // This could cause an error if not use
addslashes
  $address = Somewhere;
  $age= 19;
  
  // adding slashes to quotes
  $firstname = addslashes($firstname);
  $lastname = addslashes($lastname);
  $address = addslashes($address);
  
  $sql =   insert into TABLE values ( '$firstname', '$lastname',
'$address',
  $age) ;
  
  - Original Message -
  From: Caleb Carvalho [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Monday, October 01, 2001 3:36 PM
  Subject: Re: [PHP] still learning php
  
  
Hi Dimitris,
   
thanks, but what if I have 5 fields to add into ie
  name,surname,comments?
   
   
   
Caleb Carvalho
Application Engineer
LoadRunner/APM
   
 
 --
  ---
Enterprise Testing and Performance Management Solutions
   
 
 --
  ---
Mercury Interactive
410 Frimley Business Park
Frimley, Surrey.  GU16 7ST
United Kingdom
Telephone :  +44 (0)1276 808300
   
   
   
From: Dimitris Kossikidis [EMAIL PROTECTED]
To: Caleb Carvalho [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] still learning php
Date: Mon, 1 Oct 2001 14:29:14 +0300

$field_value = I 'm bla bla;
$field_value  = addslashes($field_value);

$sql = Insert into TABLE values('$field_value');


- Original Message -
From: Caleb Carvalho [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 01, 2001 2:05 PM
Subject: [PHP] still learning php


  I posted a msg earlier on regarding error when adding text with
  quotes
  '
  ..
  I have just found out thar I need to use addslash() function,
 
  my q's is
 
  where do i put this function?
 
 
 
  Caleb Carvalho
  Application Engineer
  LoadRunner/APM
 
   
  
 --
---
  Enterprise Testing and Performance Management Solutions
 
   
  
 --
---
  Mercury Interactive
  410 Frimley Business Park
  Frimley, Surrey.  GU16 7ST
  United Kingdom
  Telephone :  +44 (0)1276 808300
 
 
  
_
  Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
 
 


--
 

RE: [PHP] SOAP Tool Kit for PHP

2001-10-01 Thread Chris Bailey

You could also consider possibly the reverse of what you're doing.  I'm not
sure if it would actually work well, nor can I give you real details on how
to do it, but you can always use Java classes from PHP.  Depending on how
much SOAP is needed/used across your site, you could continue with PHP for
the bulk of your site, and just use Java classes to handle the SOAP stuff
when needed.  The primary issue I don't know about since I haven't looked
into it, is whether it's reasonable to have PHP receive the initial SOAP
request and how you would then hand it off to the Java classes for
processing, etc.  Anyway, just a thought...

-Original Message-
From: Dahnke, Eric [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 8:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] SOAP Tool Kit for PHP



My god does PHP need one. Or a library of functions to use.

Yes, I have built in CURL support and am reading the $HTTP_RAW_DATA_POST
variable and rolling my own as they say, but it sure would be nice. I've
seen Manual Lemos' soap classes, and they are cool, but aren't really what I
need.

PHP is fast, has beautiful syntax and I love it, but I think it needs to
grow up a bit. I don't mean to start a war, but it is true, php needs to
evolve into something beyond a newbie language great for producing db driven
web-sites.

I wish I could help, and after a few more C classes I will be able to, but
until then, I can only hope some C wizard is producing something like this.
Web-services are going to be big. Independent of .net (*uck MS), but the
messaging (SOAP) paradigm over http is going to be big. How does php fit in
there?

It looks as though we're headed over to tomcat, and I'm probably going to
bring a bunch of php developers with me. And that sucks, because tomcat is
slow, and it takes twice as long to produce an application w/ non masters
level or big time CS people.

The first thing I'm going to try though is running php as a servlet under
tomcat, but it's only to get at the apache soap tools. See what I mean.

Thanks to all the php developers. 'gards - Eric

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



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




RE: [PHP] SOAP Tool Kit for PHP

2001-10-01 Thread Dahnke, Eric


Thanks. That's what I'm doing, and it is working, but it doesn't seem like
it will be very robust, and I don't know if my roll your own will be
compliant with MS SOAP messages and Apache SOAP messages.

I'm reading the Soap:Envelope and Body XML via the $HTTP_RAW_DATA_POST
variable. It comes as a string. I parse that XML to determine the method to
invode (create, edit whatever). It works, but just seems sketch. Especially
the ack back to the poster. It says 200 OK, because the host and file I'm
posting to are found, but if there is an error in the method or anywhere
else, I'm supposed build the SOAP:Fault XML and send that back. 

I mean all the IP functions in PHP are so nice, and SOAP is an IP service as
well. Why no love for SOAP?



-Original Message-
From: Chris Bailey [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 1:30 PM
To: Dahnke, Eric; [EMAIL PROTECTED]
Subject: RE: [PHP] SOAP Tool Kit for PHP


You could also consider possibly the reverse of what you're doing.  I'm not
sure if it would actually work well, nor can I give you real details on how
to do it, but you can always use Java classes from PHP.  Depending on how
much SOAP is needed/used across your site, you could continue with PHP for
the bulk of your site, and just use Java classes to handle the SOAP stuff
when needed.  The primary issue I don't know about since I haven't looked
into it, is whether it's reasonable to have PHP receive the initial SOAP
request and how you would then hand it off to the Java classes for
processing, etc.  Anyway, just a thought...

-Original Message-
From: Dahnke, Eric [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 8:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] SOAP Tool Kit for PHP



My god does PHP need one. Or a library of functions to use.

Yes, I have built in CURL support and am reading the $HTTP_RAW_DATA_POST
variable and rolling my own as they say, but it sure would be nice. I've
seen Manual Lemos' soap classes, and they are cool, but aren't really what I
need.

PHP is fast, has beautiful syntax and I love it, but I think it needs to
grow up a bit. I don't mean to start a war, but it is true, php needs to
evolve into something beyond a newbie language great for producing db driven
web-sites.

I wish I could help, and after a few more C classes I will be able to, but
until then, I can only hope some C wizard is producing something like this.
Web-services are going to be big. Independent of .net (*uck MS), but the
messaging (SOAP) paradigm over http is going to be big. How does php fit in
there?

It looks as though we're headed over to tomcat, and I'm probably going to
bring a bunch of php developers with me. And that sucks, because tomcat is
slow, and it takes twice as long to produce an application w/ non masters
level or big time CS people.

The first thing I'm going to try though is running php as a servlet under
tomcat, but it's only to get at the apache soap tools. See what I mean.

Thanks to all the php developers. 'gards - Eric

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


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




RE: [PHP] SOAP Tool Kit for PHP

2001-10-01 Thread Chris Bailey

Check out this page of SOAP implementations:

http://www.soapware.org/directory/4/implementations

It lists several for PHP, so those may give you a solution.

This is an interesting issue though, especially in light of you bringing up
Tomcat.  I don't mean to start a big flame war over languages, but this is
one thing I struggle with in PHP land too.  I've been doing Java stuff for
years, and am just starting to develop a few things in PHP.  PHP is fast and
easy to use, and a lot easier to setup than Tomcat (or worse, Apache+Tomcat,
and further, if you have a non-standard directory structure).  But, what
I've found so far, is that if I need to do pretty much anything beyond a
simple web app that is mostly a database client, Java just has so many more
libraries and resources available, from SOAP, to XML, XSL, and more.  While
it's not true that PHP doesn't have any of this, it just seems there is more
momentum and solidity behind these types of things for Java.

For example, I'm working on a web app that does a lot of XSL processing, and
immediately I can just grab the various Apache XML and XSL toolkits and get
rolling.  On PHP I can look into Sablotron and some stuff, but I don't get a
feeling that I'd have near the level of functionality, and quality (or
solidity/maturity of code) as I would with the various Java based tools.


-Original Message-
From: Dahnke, Eric [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 10:46 AM
To: 'Chris Bailey'
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP] SOAP Tool Kit for PHP



Thanks. That's what I'm doing, and it is working, but it doesn't seem like
it will be very robust, and I don't know if my roll your own will be
compliant with MS SOAP messages and Apache SOAP messages.

I'm reading the Soap:Envelope and Body XML via the $HTTP_RAW_DATA_POST
variable. It comes as a string. I parse that XML to determine the method to
invode (create, edit whatever). It works, but just seems sketch. Especially
the ack back to the poster. It says 200 OK, because the host and file I'm
posting to are found, but if there is an error in the method or anywhere
else, I'm supposed build the SOAP:Fault XML and send that back.

I mean all the IP functions in PHP are so nice, and SOAP is an IP service as
well. Why no love for SOAP?



-Original Message-
From: Chris Bailey [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 1:30 PM
To: Dahnke, Eric; [EMAIL PROTECTED]
Subject: RE: [PHP] SOAP Tool Kit for PHP


You could also consider possibly the reverse of what you're doing.  I'm not
sure if it would actually work well, nor can I give you real details on how
to do it, but you can always use Java classes from PHP.  Depending on how
much SOAP is needed/used across your site, you could continue with PHP for
the bulk of your site, and just use Java classes to handle the SOAP stuff
when needed.  The primary issue I don't know about since I haven't looked
into it, is whether it's reasonable to have PHP receive the initial SOAP
request and how you would then hand it off to the Java classes for
processing, etc.  Anyway, just a thought...

-Original Message-
From: Dahnke, Eric [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 8:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] SOAP Tool Kit for PHP



My god does PHP need one. Or a library of functions to use.

Yes, I have built in CURL support and am reading the $HTTP_RAW_DATA_POST
variable and rolling my own as they say, but it sure would be nice. I've
seen Manual Lemos' soap classes, and they are cool, but aren't really what I
need.

PHP is fast, has beautiful syntax and I love it, but I think it needs to
grow up a bit. I don't mean to start a war, but it is true, php needs to
evolve into something beyond a newbie language great for producing db driven
web-sites.

I wish I could help, and after a few more C classes I will be able to, but
until then, I can only hope some C wizard is producing something like this.
Web-services are going to be big. Independent of .net (*uck MS), but the
messaging (SOAP) paradigm over http is going to be big. How does php fit in
there?

It looks as though we're headed over to tomcat, and I'm probably going to
bring a bunch of php developers with me. And that sucks, because tomcat is
slow, and it takes twice as long to produce an application w/ non masters
level or big time CS people.

The first thing I'm going to try though is running php as a servlet under
tomcat, but it's only to get at the apache soap tools. See what I mean.

Thanks to all the php developers. 'gards - Eric

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


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




[PHP] Apache, FreeBSD PHP

2001-10-01 Thread Kees Hoekzema

Lectori Salutem,

I have apache 1.3.20 running with php 4.0.6 on an freebsd 4.3 server. It is
a busy server, serving more than 400k PHP-pages daily.
I have a few troubles with it; first Apache is generating large errorlog
files filled with httpd in free(): warning: recursive call. and httpd in
free(): warning: chunk is already free.. (more than 25M errors per week)

I searched the internet and several mailinglist archives but didn't find an
useable solution. Does anyone know what is causing this, or does anyone has
a solution to it, because the server is at the moment a bit unstable.

Tia,
Kees Hoekzema


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




RE: [PHP] SOAP Tool Kit for PHP

2001-10-01 Thread Rasmus Lerdorf

When doing XML/XSL stuff that applies to just about any scripting language
as Java has always been the reference implementation for this.  When
leaving the XML space the same is not true.  But yes, we have a bit of
catching up to do when it comes to XML/XSL/XSLT.

-Rasmus

On Mon, 1 Oct 2001, Chris Bailey wrote:

 Check out this page of SOAP implementations:

 http://www.soapware.org/directory/4/implementations

 It lists several for PHP, so those may give you a solution.

 This is an interesting issue though, especially in light of you bringing up
 Tomcat.  I don't mean to start a big flame war over languages, but this is
 one thing I struggle with in PHP land too.  I've been doing Java stuff for
 years, and am just starting to develop a few things in PHP.  PHP is fast and
 easy to use, and a lot easier to setup than Tomcat (or worse, Apache+Tomcat,
 and further, if you have a non-standard directory structure).  But, what
 I've found so far, is that if I need to do pretty much anything beyond a
 simple web app that is mostly a database client, Java just has so many more
 libraries and resources available, from SOAP, to XML, XSL, and more.  While
 it's not true that PHP doesn't have any of this, it just seems there is more
 momentum and solidity behind these types of things for Java.

 For example, I'm working on a web app that does a lot of XSL processing, and
 immediately I can just grab the various Apache XML and XSL toolkits and get
 rolling.  On PHP I can look into Sablotron and some stuff, but I don't get a
 feeling that I'd have near the level of functionality, and quality (or
 solidity/maturity of code) as I would with the various Java based tools.


 -Original Message-
 From: Dahnke, Eric [mailto:[EMAIL PROTECTED]]
 Sent: Monday, October 01, 2001 10:46 AM
 To: 'Chris Bailey'
 Cc: '[EMAIL PROTECTED]'
 Subject: RE: [PHP] SOAP Tool Kit for PHP



 Thanks. That's what I'm doing, and it is working, but it doesn't seem like
 it will be very robust, and I don't know if my roll your own will be
 compliant with MS SOAP messages and Apache SOAP messages.

 I'm reading the Soap:Envelope and Body XML via the $HTTP_RAW_DATA_POST
 variable. It comes as a string. I parse that XML to determine the method to
 invode (create, edit whatever). It works, but just seems sketch. Especially
 the ack back to the poster. It says 200 OK, because the host and file I'm
 posting to are found, but if there is an error in the method or anywhere
 else, I'm supposed build the SOAP:Fault XML and send that back.

 I mean all the IP functions in PHP are so nice, and SOAP is an IP service as
 well. Why no love for SOAP?



 -Original Message-
 From: Chris Bailey [mailto:[EMAIL PROTECTED]]
 Sent: Monday, October 01, 2001 1:30 PM
 To: Dahnke, Eric; [EMAIL PROTECTED]
 Subject: RE: [PHP] SOAP Tool Kit for PHP


 You could also consider possibly the reverse of what you're doing.  I'm not
 sure if it would actually work well, nor can I give you real details on how
 to do it, but you can always use Java classes from PHP.  Depending on how
 much SOAP is needed/used across your site, you could continue with PHP for
 the bulk of your site, and just use Java classes to handle the SOAP stuff
 when needed.  The primary issue I don't know about since I haven't looked
 into it, is whether it's reasonable to have PHP receive the initial SOAP
 request and how you would then hand it off to the Java classes for
 processing, etc.  Anyway, just a thought...

 -Original Message-
 From: Dahnke, Eric [mailto:[EMAIL PROTECTED]]
 Sent: Monday, October 01, 2001 8:15 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] SOAP Tool Kit for PHP



 My god does PHP need one. Or a library of functions to use.

 Yes, I have built in CURL support and am reading the $HTTP_RAW_DATA_POST
 variable and rolling my own as they say, but it sure would be nice. I've
 seen Manual Lemos' soap classes, and they are cool, but aren't really what I
 need.

 PHP is fast, has beautiful syntax and I love it, but I think it needs to
 grow up a bit. I don't mean to start a war, but it is true, php needs to
 evolve into something beyond a newbie language great for producing db driven
 web-sites.

 I wish I could help, and after a few more C classes I will be able to, but
 until then, I can only hope some C wizard is producing something like this.
 Web-services are going to be big. Independent of .net (*uck MS), but the
 messaging (SOAP) paradigm over http is going to be big. How does php fit in
 there?

 It looks as though we're headed over to tomcat, and I'm probably going to
 bring a bunch of php developers with me. And that sucks, because tomcat is
 slow, and it takes twice as long to produce an application w/ non masters
 level or big time CS people.

 The first thing I'm going to try though is running php as a servlet under
 tomcat, but it's only to get at the apache soap tools. See what I mean.

 Thanks to all the php developers. 'gards - Eric

 --
 PHP General Mailing 

[PHP] fopen

2001-10-01 Thread Kmarada

is it possible to use fopen to open 5000 files differents simultaneous and
edit it simultaneous ?

I have one file. if four user edit it simultaneous what happen? there is
something to lock the file until one finish to edit?
I read at manual something like flock how can i use it?





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




[PHP] fopen !!!

2001-10-01 Thread Kmarada

is it possible to use fopen to open 5000 files differents simultaneous and
edit it simultaneous ?

I have one file. if four user edit it simultaneous what happen? there is
something to lock the file until one finish to edit?
I read at manual something like flock how can i use it?







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




RE: [PHP] fopen

2001-10-01 Thread Nathan


Short answer. http://www.php.net/manual/en/function.flock.php

-Original Message-
From: Kmarada [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, October 02, 2001 11:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP] fopen


is it possible to use fopen to open 5000 files differents simultaneous
and edit it simultaneous ?

I have one file. if four user edit it simultaneous what happen? there is
something to lock the file until one finish to edit? I read at manual
something like flock how can i use it?


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




[PHP] trying to get a list of functions used in a php script

2001-10-01 Thread Howie Oakes

Hello-

I am trying to find a way to scan a php script and list all of the functions
used in that script. Does anyone know if there is anything out there. (In
Perl or PHP) I know that Perl has the C::scan module to do this with C code,
but I have not seen anything for PHP. I am working on a secure
implementation of PHP that will only allow certain functions to be used by
end users. (But I still want to have full functionality for other scripts,
so disable_function is out of the question)

Thanks!
Howie



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




Re: [PHP] trying to get a list of functions used in a php script

2001-10-01 Thread Rasmus Lerdorf

 I am trying to find a way to scan a php script and list all of the functions
 used in that script. Does anyone know if there is anything out there. (In
 Perl or PHP) I know that Perl has the C::scan module to do this with C code,
 but I have not seen anything for PHP. I am working on a secure
 implementation of PHP that will only allow certain functions to be used by
 end users. (But I still want to have full functionality for other scripts,
 so disable_function is out of the question)

But you can use disable_functions in your httpd.conf file and only disable
fnuctions in certain directories or virtual hosts on your server.

And no, I don't know of anything that gets you such a list of used
functions.

-Rasmus


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




[PHP] CRM software

2001-10-01 Thread WebDev

Sorry if this is a little off topic.

I was wondering if anyone knew of a simple yet effective CRM package
written in PHP and MySQL.  If have seen a couple on hotscriptsw.com
but they are a little outside what I need.

All I need is a package that you can install on a webserver which
would allow various people at different locatioons access to the data
data.  This data would be tracking information on customers, similar
to a sales activity manager.  I have tried a few which  come close to
what I want, but they do not allow all users access to the the same
data.  Each users data is kept separately.

We basically just need a tool to store event and activities so that
everyone is on the same page.

Thanks

merle



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




RE: [PHP] trying to get a list of functions used in a php script

2001-10-01 Thread Howie Oakes

Hi Ramsus,

Thanks for the reply. I am trying to implement PHP in a very secure
environment. My security department wants our developers to only be able to
use functions from an approved list. My plan was to scan any PHP files when
they get saved, get a list of the functions used and compare those to the
approved list. The problem is that many of the functions that would not be
available for general use need to be used by some master scripts in the
same directory, so I can't use disable_function...








-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 01, 2001 3:16 PM
To: Howie Oakes
Cc: '[EMAIL PROTECTED]'
Subject: Re: [PHP] trying to get a list of functions used in a php
script


 I am trying to find a way to scan a php script and list all of the
functions
 used in that script. Does anyone know if there is anything out there. (In
 Perl or PHP) I know that Perl has the C::scan module to do this with C
code,
 but I have not seen anything for PHP. I am working on a secure
 implementation of PHP that will only allow certain functions to be used by
 end users. (But I still want to have full functionality for other scripts,
 so disable_function is out of the question)

But you can use disable_functions in your httpd.conf file and only disable
fnuctions in certain directories or virtual hosts on your server.

And no, I don't know of anything that gets you such a list of used
functions.

-Rasmus

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




[PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file

2001-10-01 Thread Joseph Koenig

I've got a script on an NT (IIS 4.0) server that uploads a file. When
the user attempts to replace the uploaded file with a new one via the
form, the script is generating errors.

Warning: Unable to create
'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif':
Permission denied in
D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on
line 41

Warning: Unable to move 'C:/PHP/uploadtemp\php4F6.tmp' to
'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif' in
D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on
line 41

Is there anything I should have their IT guy check as to why this script
can upload, but not replace a file? Thanks,

Joe

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




RE: [PHP] trying to get a list of functions used in a php script

2001-10-01 Thread Rasmus Lerdorf

 Thanks for the reply. I am trying to implement PHP in a very secure
 environment. My security department wants our developers to only be able to
 use functions from an approved list. My plan was to scan any PHP files when
 they get saved, get a list of the functions used and compare those to the
 approved list. The problem is that many of the functions that would not be
 available for general use need to be used by some master scripts in the
 same directory, so I can't use disable_function...

But you can disable_functions with a granularity right down to the file
level using the standard httpd.conf semantics.

-Rasmus


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




[PHP] Looking for a PHP/MySQL Developer for short project

2001-10-01 Thread Doug Daulton

Folks,

I am relatively new to PHP  MySQL.  I took on a side project some months
ago which I now realize is over my head.  The project is a real estate
catalog.  I adapted the catalog system from Welling and Thomson's PHP 
MySQL Web Development from SAMS.

I really need to wrap this project up.  So, I am looking for someone whose
skills are strong and has time to connect all of the dots in the
modifications I've made.  The Database is built and I've not strayed to far
from the original PHP, so I think this should be relatively simple for
someone with lots of dev experience in this environment.

If you are interested in working on this, please email me at
[EMAIL PROTECTED]  Please include your number of years experience in
this environment, hourly rate, current availability, links to some sample
sites and two professional references.

Regards,

Doug Daulton
Ursa Studios





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




RE: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file

2001-10-01 Thread Joe Kaiping

Sounds like their upload script isn't setting the correct file permissions
when creating the file.  Directory permissions don't seem to be a problem
for you.

-Joe2

 -Original Message-
 From: Joseph Koenig [mailto:[EMAIL PROTECTED]]
 Sent: Monday, October 01, 2001 12:38 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file


 I've got a script on an NT (IIS 4.0) server that uploads a file. When
 the user attempts to replace the uploaded file with a new one via the
 form, the script is generating errors.

 Warning: Unable to create
 'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif':
 Permission denied in
 D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on
 line 41

 Warning: Unable to move 'C:/PHP/uploadtemp\php4F6.tmp' to
 'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif' in
 D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on
 line 41

 Is there anything I should have their IT guy check as to why
 this script
 can upload, but not replace a file? Thanks,

 Joe




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




[PHP] Submit of a Form needs reload the page to display results

2001-10-01 Thread Karina Gómez Salgado

Hi all,

I have a problem with form submits.

I have an access control form that my users fill to enter to a private
web page, this access page saves 2 session variables and shows the
result page that it's an php page with several queries to several
tables. Well, when i submit my access control form, i get a blank page,
if i check the source code in the browser, it shows Data missing...
form post operation.. bla bla, so i need to reload the web page for
showing the correct  query results.

This is very inconvenient for my users, Any help will be greatly
appreciated.

Thanks..

Karina Gomez




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




[PHP] session_start() or session_register() AND cookies

2001-10-01 Thread Augusto Cesar Castoldi

Hi...

If I use the session_start or session_register I'll
never be able to open two sessions in the same
computer in the same time?

regards,

Augusto

___
Yahoo! GeoCities
Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil 
e grátis!
http://br.geocities.yahoo.com/

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




[PHP] Re: trying to get a list of functions used in a php script

2001-10-01 Thread CC Zona

In article 584FAB68EB77D511BEF500508BB9191217695D@ATLEXC01,
 [EMAIL PROTECTED] (Howie Oakes) wrote:

  I am working on a secure
 implementation of PHP that will only allow certain functions to be used by
 end users. (But I still want to have full functionality for other scripts,
 so disable_function is out of the question)

Before you count out disable_funtions entirely, have you looked into 
dynamically setting it at the user,directory, or script level with 
ini_set()? http://www.php.net/manual/en/function.ini-set.php.

-- 
CC

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




Re: [PHP] session_start() or session_register() AND cookies

2001-10-01 Thread Rasmus Lerdorf

Change the session_name and you can.

On Mon, 1 Oct 2001, [iso-8859-1] Augusto Cesar Castoldi wrote:

 Hi...

 If I use the session_start or session_register I'll
 never be able to open two sessions in the same
 computer in the same time?

 regards,

 Augusto

 
___
 Yahoo! GeoCities
 Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É 
fácil e grátis!
 http://br.geocities.yahoo.com/




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




[PHP] session_start() or session_register() AND cookies

2001-10-01 Thread Augusto Cesar Castoldi

Hi...

If I use the session_start or session_register I'll
never be able to open two sessions in the same
computer in the same time?

regards,

Augusto

___
Yahoo! GeoCities
Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil 
e grátis!
http://br.geocities.yahoo.com/

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




[PHP] Crazy problem with PDFLIB 4.0.1 and PHP 4.0.6

2001-10-01 Thread Alain DESEINE

Hi, 

Got a big problem with PHP 4.0.6 and PDFLIB 4.0.1.

I got a script which is part of an application i wrote on a linux server
(2.4 kernel) under php 4.0.5, mysql and PDFLIB 3.0.3. This script work
very fine in this configuration.

Today, i need to port the intranet application that use this script on
an hp9000 box (hp-ux 11.00 64 bits OS), with SYBASE ASE 12 as Database
server. Thirst, i got problem compiling PDFLIB 3.0.3 and PHP 4.0.5, so i
decide upgrading both and i compile with success PDFLIB 4.0.1 and PHP
4.0.6 (DSO) together.

When i began to test the application i got problems with one of the
script that use PDF_* functions. After investigations, here is what i've
found :

this work well :

 $funame = toto;
 pdf_show_xy($pdf, tutu $funame, 30, $y);

but this cause the httpd process to die with this error child pid 24308
exit signal Segmentation fault (11) in the apache error log.

 $funame  = $row[username];
 pdf_show_xy($pdf, tutu $funame, 30, $y);


the $row[username] is extracted from the sybase database, retrieving
the value of the username field. 

There is no problem with the SYBASE record because the script print
$row[username] in the html returned page too.

It seems to me like a memory allocation problem ...

Does anybody experience the same problem ?

If anybody have an idea ...

Many thanks for help.

Alain DESEINE.

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




[PHP] socket_get_status()

2001-10-01 Thread Richard Heyes

Hi,

Exactly what does the unread_bytes parameter of the return of
socket_get_status() mean? I thought it would be the amount of data waiting
to be gotten via fgets() or fread(), but not according to my lil' test
(interactive mode):

?php
$fp = fsockopen('10.1.1.2', 25);
var_dump(socket_get_status($fp));
array(4) {
  [timed_out]=
  bool(false)
  [blocked]=
  bool(true)
  [eof]=
  bool(false)
  [unread_bytes]=
  int(0)
}
echo fgets($fp, 512);
220 heyes-computing.net Ready for action (Mailtraq 1.1.5.1167/SMTP)

--
Richard Heyes
I know not with what weapons World War III will be fought, but World War IV
will be fought with sticks and stones. - Albert Einstein



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




Re: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file

2001-10-01 Thread Joseph Koenig

The script is moving the file to its final destination and then doing a
chmod(filename, 0777) (the php function, not through exec() or
anything); Even setting the mode to 0777 doesn't help at all. Am I doing
this completely wrong from IIS/NT? Thanks,

joe

Joe Kaiping wrote:
 
 Sounds like their upload script isn't setting the correct file permissions
 when creating the file.  Directory permissions don't seem to be a problem
 for you.
 
 -Joe2
 
  -Original Message-
  From: Joseph Koenig [mailto:[EMAIL PROTECTED]]
  Sent: Monday, October 01, 2001 12:38 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file
 
 
  I've got a script on an NT (IIS 4.0) server that uploads a file. When
  the user attempts to replace the uploaded file with a new one via the
  form, the script is generating errors.
 
  Warning: Unable to create
  'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif':
  Permission denied in
  D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on
  line 41
 
  Warning: Unable to move 'C:/PHP/uploadtemp\php4F6.tmp' to
  'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif' in
  D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on
  line 41
 
  Is there anything I should have their IT guy check as to why
  this script
  can upload, but not replace a file? Thanks,
 
  Joe
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

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




RE: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file

2001-10-01 Thread Joe Kaiping

Hi Joe,

I'm not familiar with PHP on Windows myself, but I just checked out the
manual pages to see if it said anything and it sounds like chmod() doesn't
work on windows:

http://www.php.net/manual/en/function.chmod.php

Note: This function does not work on Windows systems

ditto for chgrp and chown.

I also did a search on http://www.phpbuilder.com for you and it seems other
people have had the same problem uploading files with Apache and IIS, but I
didn't see a solution.  When you update the file, have you tried to first
remove the old version of the file and then write it?

Sorry that I can't be more help.  Maybe someone on the list that uses PHP on
Windows knows a better solution?

Best of luck!
-Joe

 -Original Message-
 From: Joseph Koenig [mailto:[EMAIL PROTECTED]]
 Sent: Monday, October 01, 2001 1:54 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace
 uploaded file


 The script is moving the file to its final destination and
 then doing a
 chmod(filename, 0777) (the php function, not through exec() or
 anything); Even setting the mode to 0777 doesn't help at all.
 Am I doing
 this completely wrong from IIS/NT? Thanks,

 joe

 Joe Kaiping wrote:
 
  Sounds like their upload script isn't setting the correct
 file permissions
  when creating the file.  Directory permissions don't seem
 to be a problem
  for you.
 
  -Joe2
 
   -Original Message-
   From: Joseph Koenig [mailto:[EMAIL PROTECTED]]
   Sent: Monday, October 01, 2001 12:38 PM
   To: [EMAIL PROTECTED]
   Subject: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace
 uploaded file
  
  
   I've got a script on an NT (IIS 4.0) server that uploads
 a file. When
   the user attempts to replace the uploaded file with a new
 one via the
   form, the script is generating errors.
  
   Warning: Unable to create
   'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif':
   Permission denied in
  
 D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on
   line 41
  
   Warning: Unable to move 'C:/PHP/uploadtemp\php4F6.tmp' to
  
 'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif' in
  
 D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on
   line 41
  
   Is there anything I should have their IT guy check as to why
   this script
   can upload, but not replace a file? Thanks,
  
   Joe
  
  
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
 [EMAIL PROTECTED]



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




[PHP] Crazy problem with PDFLIB 4.0.1 and PHP 4.0.6

2001-10-01 Thread Alain DESEINE

Hi, 

Got a big problem with PHP 4.0.6 and PDFLIB 4.0.1.

I got a script which is part of an application i wrote on a linux server
(2.4 kernel) under php 4.0.5, mysql and PDFLIB 3.0.3. This script work
very fine in this configuration.

Today, i need to port the intranet application that use this script on
an hp9000 box (hp-ux 11.00 64 bits OS), with SYBASE ASE 12 as Database
server. Thirst, i got problem compiling PDFLIB 3.0.3 and PHP 4.0.5, so i
decide upgrading both and i compile with success PDFLIB 4.0.1 and PHP
4.0.6 (DSO) together.

When i began to test the application i got problems with one of the
script that use PDF_* functions. After investigations, here is what i've
found :

this work well :

 $funame = toto;
 pdf_show_xy($pdf, tutu $funame, 30, $y);

but this cause the httpd process to die with this error child pid 24308
exit signal Segmentation fault (11) in the apache error log.

 $funame  = $row[username];
 pdf_show_xy($pdf, tutu $funame, 30, $y);


the $row[username] is extracted from the sybase database, retrieving
the value of the username field. 

There is no problem with the SYBASE record because the script print
$row[username] in the html returned page too.

It seems to me like a memory allocation problem ...

Does anybody experience the same problem ?

If anybody have an idea ...

Many thanks for help.

Alain DESEINE.

[EMAIL PROTECTED]

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




[PHP] How to do a dynamic UPDATE SET

2001-10-01 Thread René Fournier

I'm having a REALLY hard time with something that's probably easy to do (for
someone :-)...

Normally, to perform an update on a table with data from a submitted form, I
would use something like:

  $sql = UPDATE $table SET pet='$pet', name='$name' WHERE id=$id;
  $result = mysql_query($sql);

And it would work.  Of course, if I wanted to update a different table (with
different columns/fields), I would need to only change the SET part of the
SQL (since the value for $table is dynamically generated). For example,

  $sql = UPDATE $table SET car='$car', year='$year' WHERE id=$id;
  $result = mysql_query($sql);

But here's what I want to do now:  I want to use the same two lines of code
for any possible form data that might be submitted--in other words, I don't
want to have to create unique $sql/$result lines for each and every table in
my database.  I want this .php code to accept whatever number and type of
form elements/data submitted, and make the appropropriate SET values.
Anyone know how I can do that?  I actually have tried several things to pass
the form data strcuture (number and names of columns) over to this php code,
but haven't been able to get anything working.  Can anyone help??  Much
thanks if you can..

...Rene

---
Rene Fournier


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




RE: [PHP] How to do a dynamic UPDATE SET

2001-10-01 Thread Vincent

| But here's what I want to do now:  I want to use the same two 
| lines of code for any possible form data that might be submitted

mysql_list_fields retrieves all field names of $table;
with that you can build your SET-clause for the query.
something like:

$fields = mysql_list_fields($db, $tbl);
$columns = mysql_num_fields($fields);
for ($i = 0; $i  $columns; $i++) {
  $fld = mysql_field_name($fields, $i);
  $set .= $fld='$.$fld.', ;
}

btw: mysql_query(UPDATE ...); works and saves a line of code.

Vincent


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




RE: [PHP] How to do a dynamic UPDATE SET

2001-10-01 Thread Joe Kaiping

Something like this might work for you.  (Just typed in the code and didn't
test it, so take with a grain of salt.  It doesn't really take into account
all types of data, but maybe it will help with an idea.)

Have groups of the following in your form:

TR
 TD
  SELECT NAME=column[]
   OPTION VALUE=column_name1column_name1
   OPTION VALUE=column_name2column_name2
  /SELECT
 /TD
 TDINPUT NAME=col_value[] TYPE=text VALUE= SIZE=20/TD
/TR

and process it like:

$set_clause = SET ;
$comma = ;
for ($i=0; $icount($column); $i++) {
  $set_clause .= $comma . $column[$i] . = . $col_value[$i];
  $comma = ,;
}

$sql = UPDATE $table $set_clause WHERE id=$id;

-Joe

 -Original Message-
 From: René Fournier [mailto:[EMAIL PROTECTED]]
 Sent: Monday, October 01, 2001 2:33 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] How to do a dynamic UPDATE SET


 I'm having a REALLY hard time with something that's probably
 easy to do (for
 someone :-)...

 Normally, to perform an update on a table with data from a
 submitted form, I
 would use something like:

   $sql = UPDATE $table SET pet='$pet', name='$name' WHERE id=$id;
   $result = mysql_query($sql);

 And it would work.  Of course, if I wanted to update a
 different table (with
 different columns/fields), I would need to only change the
 SET part of the
 SQL (since the value for $table is dynamically generated).
 For example,

   $sql = UPDATE $table SET car='$car', year='$year' WHERE id=$id;
   $result = mysql_query($sql);

 But here's what I want to do now:  I want to use the same two
 lines of code
 for any possible form data that might be submitted--in other
 words, I don't
 want to have to create unique $sql/$result lines for each and
 every table in
 my database.  I want this .php code to accept whatever number
 and type of
 form elements/data submitted, and make the appropropriate SET values.
 Anyone know how I can do that?  I actually have tried several
 things to pass
 the form data strcuture (number and names of columns) over to
 this php code,
 but haven't been able to get anything working.  Can anyone
 help??  Much
 thanks if you can..

 ...Rene

 ---
 Rene Fournier


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



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




[PHP] eregi

2001-10-01 Thread Tim Ballantine

Hello,

Could anyone tell me how to eregi a word, to see if it only contains either
numbers, letters, the _ and the -, so that any other symbol with call it
invalid. For example, theres the word expressio_n that will be valid, but
the word express%^$-n will be invalid.

Thankyou,

Tim



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




Re: [PHP] eregi

2001-10-01 Thread Rasmus Lerdorf

See php.net/strcspn

On Mon, 1 Oct 2001, Tim Ballantine wrote:

 Hello,

 Could anyone tell me how to eregi a word, to see if it only contains either
 numbers, letters, the _ and the -, so that any other symbol with call it
 invalid. For example, theres the word expressio_n that will be valid, but
 the word express%^$-n will be invalid.

 Thankyou,

 Tim






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




Re: [PHP] eregi

2001-10-01 Thread Tim Ballantine

Is there anything which doesnt use length? And something like eregi, because
it would be infeasible to list all of the symbols that a user could use, to
compare a string by.

Tim

Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 See php.net/strcspn

 On Mon, 1 Oct 2001, Tim Ballantine wrote:

  Hello,
 
  Could anyone tell me how to eregi a word, to see if it only contains
either
  numbers, letters, the _ and the -, so that any other symbol with
call it
  invalid. For example, theres the word expressio_n that will be valid,
but
  the word express%^$-n will be invalid.
 
  Thankyou,
 
  Tim
 
 
 
 




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




[PHP] HTTP Authentication / Logging Out

2001-10-01 Thread Eric J Schwinder

I used a pretty basic system to check HTTP authentication values against
database values, but I can't seem to find a way to allow the user to log
out.  I tried:

unset($PHP_AUTH_USER)

but Internet Explorer hangs on to that value until all browser windows are
closed.  Is there any way around that?

Thanks,

Eric J Schwinder
eric.AT.bergencomputing.DOT.com



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




[PHP] Submit Form needs reload the page to display results the first time

2001-10-01 Thread Karina Gómez Salgado


Hi all,

I have a problem with form submits.

I have an access control form that my users fill to enter to a private
web page, this access page saves 2 session variables and shows the
result page that it's an php page with several queries to several
tables. Well, when i submit my access control form, i get a blank page,
if i check the source code in the browser, it shows Data missing...
form post operation.. bla bla, so i need to reload the web page for
showing the correct  query results.

This is very inconvenient for my users, Any help will be greatly
appreciated.

Thanks..

Please Help.

Karina Gomez




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

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




Re: [PHP] eregi

2001-10-01 Thread Rasmus Lerdorf

Huh?  You better read that documentation page again.  You only need to
list the illegal symbols.  And what do you mean by length?

-Rasmus

On Mon, 1 Oct 2001, Tim Ballantine wrote:

 Is there anything which doesnt use length? And something like eregi, because
 it would be infeasible to list all of the symbols that a user could use, to
 compare a string by.

 Tim

 Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  See php.net/strcspn
 
  On Mon, 1 Oct 2001, Tim Ballantine wrote:
 
   Hello,
  
   Could anyone tell me how to eregi a word, to see if it only contains
 either
   numbers, letters, the _ and the -, so that any other symbol with
 call it
   invalid. For example, theres the word expressio_n that will be valid,
 but
   the word express%^$-n will be invalid.
  
   Thankyou,
  
   Tim
  
  
  
  
 






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




Re: [PHP] HTTP Authentication / Logging Out

2001-10-01 Thread Rasmus Lerdorf

$PHP_AUTH_USER is filled in based on the value coming from the browser.
unsetting it in PHP makes no sense as the browser is simply going to set
it again on the next request.  There is no way to clear this from the
client-side short of changing the realm or denying the authentication with
a 403.

-Rasmus

On Mon, 1 Oct 2001, Eric J Schwinder wrote:

 I used a pretty basic system to check HTTP authentication values against
 database values, but I can't seem to find a way to allow the user to log
 out.  I tried:

 unset($PHP_AUTH_USER)

 but Internet Explorer hangs on to that value until all browser windows are
 closed.  Is there any way around that?

 Thanks,

 Eric J Schwinder
 eric.AT.bergencomputing.DOT.com






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




Re: [PHP] eregi

2001-10-01 Thread Tim Ballantine

Returns the length of the initial segment of str1 which does not contain
any of the characters in str2.

I realise that i could see if this matches with the length of the entire
word, and is there a way to get it to compare the word by the legal
characters, because the amount of illegal symbols, including different
language symbols (french for example) will be too high for me to list.

Tim

Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Huh?  You better read that documentation page again.  You only need to
 list the illegal symbols.  And what do you mean by length?

 -Rasmus

 On Mon, 1 Oct 2001, Tim Ballantine wrote:

  Is there anything which doesnt use length? And something like eregi,
because
  it would be infeasible to list all of the symbols that a user could use,
to
  compare a string by.
 
  Tim
 
  Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   See php.net/strcspn
  
   On Mon, 1 Oct 2001, Tim Ballantine wrote:
  
Hello,
   
Could anyone tell me how to eregi a word, to see if it only contains
  either
numbers, letters, the _ and the -, so that any other symbol with
  call it
invalid. For example, theres the word expressio_n that will be
valid,
  but
the word express%^$-n will be invalid.
   
Thankyou,
   
Tim
   
   
   
   
  
 
 
 
 




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




Re: [PHP] eregi

2001-10-01 Thread Rasmus Lerdorf

Well, either you need to know the valid chars or the invalid ones.  Make
up your mind and use strspn() or strcspn() appropriately.

-Rasmus

On Mon, 1 Oct 2001, Tim Ballantine wrote:

 Returns the length of the initial segment of str1 which does not contain
 any of the characters in str2.

 I realise that i could see if this matches with the length of the entire
 word, and is there a way to get it to compare the word by the legal
 characters, because the amount of illegal symbols, including different
 language symbols (french for example) will be too high for me to list.

 Tim

 Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Huh?  You better read that documentation page again.  You only need to
  list the illegal symbols.  And what do you mean by length?
 
  -Rasmus
 
  On Mon, 1 Oct 2001, Tim Ballantine wrote:
 
   Is there anything which doesnt use length? And something like eregi,
 because
   it would be infeasible to list all of the symbols that a user could use,
 to
   compare a string by.
  
   Tim
  
   Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
See php.net/strcspn
   
On Mon, 1 Oct 2001, Tim Ballantine wrote:
   
 Hello,

 Could anyone tell me how to eregi a word, to see if it only contains
   either
 numbers, letters, the _ and the -, so that any other symbol with
   call it
 invalid. For example, theres the word expressio_n that will be
 valid,
   but
 the word express%^$-n will be invalid.

 Thankyou,

 Tim




   
  
  
  
  
 






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




[PHP] Newbie! Submit Form needs reload the page to show results the first time]

2001-10-01 Thread Karina Gómez Salgado


Hi all, please help me with this problem i'm desperate...

I have a problem with form submits.

I have an access control form that my users fill to enter to a private
web page, this access page saves 2 session variables and shows the
result page that it's an php page with several queries to several
tables. Well, when i submit my access control form, i get a blank page,
if i check the source code in the browser, it shows Data missing...
form post operation.. bla bla, so i need to reload the web page for
showing the correct  query results.

This is very inconvenient for my users, Any help will be greatly
appreciated.

Thanks..

Please Help.

Karina Gomez




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

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

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




[PHP] Re: HTTP Authentication / Logging Out

2001-10-01 Thread Chris Lee

php is serverside, PHP_AUTH_USER is set by the client, therfore when you
unset() the serverside instance of PHP_AUTH_USER the client doesnt know
about this and keeps sending the username/pass. the only way I know of is to
re-send the http auth headers and change the domain. this works for me.

Header(WWW-Authenticate: Basic realm='someother-domain' );
Header(HTTP/1.0 401 Unauthorized);

--

  Chris Lee
  [EMAIL PROTECTED]


Eric J Schwinder [EMAIL PROTECTED] wrote in
message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I used a pretty basic system to check HTTP authentication values against
 database values, but I can't seem to find a way to allow the user to log
 out.  I tried:

 unset($PHP_AUTH_USER)

 but Internet Explorer hangs on to that value until all browser windows are
 closed.  Is there any way around that?

 Thanks,

 Eric J Schwinder
 eric.AT.bergencomputing.DOT.com





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




Re: [PHP] eregi

2001-10-01 Thread Tim Ballantine

Thankyou...

I should have made it clearer that I did want to use only the legal
characters to compare the string by.

Tim

Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Well, either you need to know the valid chars or the invalid ones.  Make
 up your mind and use strspn() or strcspn() appropriately.

 -Rasmus

 On Mon, 1 Oct 2001, Tim Ballantine wrote:

  Returns the length of the initial segment of str1 which does not
contain
  any of the characters in str2.
 
  I realise that i could see if this matches with the length of the entire
  word, and is there a way to get it to compare the word by the legal
  characters, because the amount of illegal symbols, including different
  language symbols (french for example) will be too high for me to list.
 
  Tim
 
  Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Huh?  You better read that documentation page again.  You only need to
   list the illegal symbols.  And what do you mean by length?
  
   -Rasmus
  
   On Mon, 1 Oct 2001, Tim Ballantine wrote:
  
Is there anything which doesnt use length? And something like eregi,
  because
it would be infeasible to list all of the symbols that a user could
use,
  to
compare a string by.
   
Tim
   
Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 See php.net/strcspn

 On Mon, 1 Oct 2001, Tim Ballantine wrote:

  Hello,
 
  Could anyone tell me how to eregi a word, to see if it only
contains
either
  numbers, letters, the _ and the -, so that any other symbol
with
call it
  invalid. For example, theres the word expressio_n that will be
  valid,
but
  the word express%^$-n will be invalid.
 
  Thankyou,
 
  Tim
 
 
 
 

   
   
   
   
  
 
 
 
 





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




RE: [PHP] How to do a dynamic UPDATE SET

2001-10-01 Thread Vincent

| The result:  PHP updates the values of lang, record, date, what (etc.) to
| [LITERALLY] $lang, $record, $date, etc--NOT the values of those fields
| submitted by the form.  I'm kinda lost as to what to do...  Any
| suggestions??

Ow yea, little mistake of mine, sorry.
I think removing the single quotes should do the trick.

Vincent


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




RE: [PHP] How to do a dynamic UPDATE SET

2001-10-01 Thread René Fournier

Nope, still no go.  Removing the single quotes stops PHP from updating the
fields with $set's literal $fieldname, but still doesn't update the record
with the value (or anything).

===
CODE
===
if ($submit) {
// if there is an ID, then it's an update
  if ($id) {
  $comma = ;
for ($i = 1; $i  $columns; $i++) {
  $fld = mysql_field_name($fields, $i);
  $set .= $comma.$fld=$.$fld;
  $comma = , ;
  }
  $set .=  ;

  echo $set, p;

  // run SQL against the DB
  $sql = UPDATE events SET what=$what WHERE id=$id;
  echo $sql, p;
  $result = mysql_query($sql);
   }
   echo span class=adminnormalRecord updated;
}
===
OUTPUT
===
lang=$lang, record=$record, date=$date, what=$what, link=$link,
location=$location, details=$details

UPDATE events SET lang=$lang, record=$record, date=$date, what=$what,
link=$link, location=$location, details=$details WHERE id=1

Record updated
===


...Rene

---
Rene Fournier
[EMAIL PROTECTED]

 -Original Message-
 From: Vincent [mailto:[EMAIL PROTECTED]]
 Sent: Monday, October 01, 2001 5:49 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] How to do a dynamic UPDATE SET


 | The result:  PHP updates the values of lang, record, date, what
 (etc.) to
 | [LITERALLY] $lang, $record, $date, etc--NOT the values of those fields
 | submitted by the form.  I'm kinda lost as to what to do...  Any
 | suggestions??

 Ow yea, little mistake of mine, sorry.
 I think removing the single quotes should do the trick.

 Vincent


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




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




[PHP] A powerful editor!

2001-10-01 Thread Alex Shi

Hello folks,

Today, I found a very powerful editor, called TextPad. I said it is
'powerful'
because it can recognize syntax of php, html, java, css and also many
many more great featuresmuch better that Windows Notepad. You can
download and try. You need to take a few minutes to explore it and maximize
its functionality for you.

Here is the link:
http://www.textpad.com/

Alex




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




[PHP] Sessions, sessions, sessions...

2001-10-01 Thread Bradley Goldsmith

Hi,

I am using php4 (great) under win32 apache (not so great) ...

I am trying to regsiter two session variables. When the page is
first displayed, the variables are registered thus:

session_register(Sheet);
$HTTP_SESSION_VARS[Sheet]=serialize($Sheet);

//store time offset session
session_register(offset);
$HTTP_SESSION_VARS[offset]=$offset;

I had some checking code in there before and the registers returned
true.

The problem is that on the first time around the variables do not
seem to register. However, if the page loads and then I do a refresh by
clicking on the toolbar - it all seems to work ok.

Any ideas on how I can get the vars to stick first time around?

Cheers,
Brad



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




Re: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file

2001-10-01 Thread Christian Dechery

I had the same problem... chmod doesn't work in Windows...

I'm using win2000 server... to make uploads possible you have to set 
permissions to the users: IUSR_COMPUTERNAME and IWAM_COMPUTERNAME, set them 
both to FULL and test...

At 15:54 1/10/2001 -0500, Joseph Koenig wrote:
The script is moving the file to its final destination and then doing a
chmod(filename, 0777) (the php function, not through exec() or
anything); Even setting the mode to 0777 doesn't help at all. Am I doing
this completely wrong from IIS/NT? Thanks,

joe

Joe Kaiping wrote:
 
  Sounds like their upload script isn't setting the correct file permissions
  when creating the file.  Directory permissions don't seem to be a problem
  for you.
 
  -Joe2
 
   -Original Message-
   From: Joseph Koenig [mailto:[EMAIL PROTECTED]]
   Sent: Monday, October 01, 2001 12:38 PM
   To: [EMAIL PROTECTED]
   Subject: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file
  
  
   I've got a script on an NT (IIS 4.0) server that uploads a file. When
   the user attempts to replace the uploaded file with a new one via the
   form, the script is generating errors.
  
   Warning: Unable to create
   'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif':
   Permission denied in
   D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on
   line 41
  
   Warning: Unable to move 'C:/PHP/uploadtemp\php4F6.tmp' to
   'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif' in
   D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on
   line 41
  
   Is there anything I should have their IT guy check as to why
   this script
   can upload, but not replace a file? Thanks,
  
   Joe
  
  
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]

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


_
. Christian Dechery
. . Gaita-L Owner / Web Developer
. . http://www.webstyle.com.br
. . http://www.tanamesa.com.br


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




Re: [PHP] session var being lost between pages

2001-10-01 Thread Christian Dechery

are you sure you have session_start() on all three pages and you have 
enabled 'track_vars'???
cuz if you don't you'll have to manually pass the session id trought the 
form...

At 07:50 1/10/2001 +, Jean-Christian Imbeault wrote:
Ok, newbie I am but ... I seem to be losing my session vars when I load up 
a different php page.

My set-up:

1- main page starts session and logs user in

if (isset($PHPSESSID))
  session_start($PHPSESSID);
else
  session_start();

$PHPSESSID = session_id();
$SID   = PHPSESSID=$PHPSESSID;

if(!isset($userid)) {
   login_form();
   exit;
}
else {
   session_register(userid, userpassword);
}

Once the user is logged in I have no problem accessin the vars $userid and 
$userpassword.

On the page I even have an A HREF link to second php page and the vars 
are accessible there also.

However this other page has a form. When the user submits the form, a 
third php page is loaded. On this third page the vars no longer have any 
values.

Why is this? How can I access the vars from this third page?

Thanks!

Jc



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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


_
. Christian Dechery
. . Gaita-L Owner / Web Developer
. . http://www.webstyle.com.br
. . http://www.tanamesa.com.br


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




[PHP] Namo Web Editor

2001-10-01 Thread Petras Virzintas

Hi, apparently the Namo Web Editor has a PHP generator together with a MySQL 
interface. Is this truly an alternative to products such as PhpEd? Has anyone used it 
for production applications? Any other useful comments?

Petras



[PHP] sessions in php4

2001-10-01 Thread sagar N Chand

hi all,

i'm using a php4.0.6 with apache on win2k. when i register a session and immediately 
if i redirect to another
page the session seems not to be registered. eg.
?
session_start();
$value = 908;
session_register(value);
header(location : new location);
?

when i go to the new page i c that the session has not been reigstered.

but in case if i dont redirect from php rather use a html redirection code like click 
here to redirect then
it worked. why ?
?
session_start();
$value = 908;
session_register(value);
?
a href=newlocationclick here to redirect/a(this worked out )

any suggestions ?

/sagar




[PHP] Simple Question, I think

2001-10-01 Thread Ratfish

All I want to do is what an ASP page I have is doing.

I just want to host multiple sites with one page like the one in the article
below until I can get my head around the real way of doing it.

http://www.zdnet.com/devhead/stories/articles/0,4413,2418330,00.html

Surely there is a PHP equivalent?

Thanks
Andrew 

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




[PHP] RE: Sessions, sessions, sessions...

2001-10-01 Thread Bradley Goldsmith

Nope.

Still doesn't work.

I still have to do a refresh on the page manually...

Any other ideas?

Thanks,
Brad


-Original Message-
From: Wayne K [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 2 October 2001 11:38 AM
To: Bradley Goldsmith
Subject: Re: Sessions, sessions, sessions...


register your sessions then reload the page with a
header(location:stuff.here) if session is registered then omit the
header()

- Original Message -
From: Bradley Goldsmith [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Sent: Monday, October 01, 2001 9:13 PM
Subject: Sessions, sessions, sessions...


| Hi,
|
| I am using php4 (great) under win32 apache (not so great) ...
|
| I am trying to regsiter two session variables. When the page is
| first displayed, the variables are registered thus:
|
| session_register(Sheet);
| $HTTP_SESSION_VARS[Sheet]=serialize($Sheet);
|
| //store time offset session
| session_register(offset);
| $HTTP_SESSION_VARS[offset]=$offset;
|
| I had some checking code in there before and the registers returned
| true.
|
| The problem is that on the first time around the variables do not
| seem to register. However, if the page loads and then I do a refresh by
| clicking on the toolbar - it all seems to work ok.
|
| Any ideas on how I can get the vars to stick first time around?
|
| Cheers,
| Brad
|
|

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




[PHP] Newbie But Urgent

2001-10-01 Thread Radith

HELLO,

I am finished working with the html and css levels and want to take my
design to the next level. I realize that JS is getting outdated and many new
technologies have started popping up. I do want a database driven site. I am
running Windows and have both the 98 and 2000 versions. There's one main
thing i want to accomplish w/ either php or asp:

I want a system where users can join our site by means of filling out a form
and submitting it, which generates the username and password to be placed
into a databse (mayb other info.). Then the next time they visit the site
they can login via the database.

Now i know this is possible with both php and asp, but which is easier. Also
i have a plan of using php and mysql, and learning these by means of this
book: PHP and MySQL Web Development. (ISBN: 0672317842)
Although 1 book may cover both technologies, i am simply looking for
simplicity, which technology will be easier to accomplish this task.

Thanx for all ur help.





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




Re: [PHP] Simple Question, I think

2001-10-01 Thread Kath

Perhaps check the URL and direct as such using header();.  Use phpinfo(); to
find what var holds the current URL.

- k



- Original Message -
From: Ratfish [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 01, 2001 10:25 PM
Subject: [PHP] Simple Question, I think


 All I want to do is what an ASP page I have is doing.

 I just want to host multiple sites with one page like the one in the
article
 below until I can get my head around the real way of doing it.

 http://www.zdnet.com/devhead/stories/articles/0,4413,2418330,00.html

 Surely there is a PHP equivalent?

 Thanks
 Andrew

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



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




Re: [PHP] session var being lost between pages

2001-10-01 Thread Jean-Christian Imbeault

Can someone explain this to me? I am not very confused after reading this 
post ...

are you sure you have session_start() on all three pages and you have 
enabled 'track_vars'???

I have done no such thing. The PHP book I have doesn't mention any of this. 
It simply says that using session_start() and session_register() will cause 
the vars to be kept between pages. Are you sure what you are sayign is true?

If so please help me understand because I never saw any methion of what you 
say must be done in any book or on PHP ML etc ...

Thanks!

Jc

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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




Re: [PHP] loosing session variables: work still in progress

2001-10-01 Thread Jean-Christian Imbeault

Still not working ...

Here is some output that shows the session is being registered and the ID is 
the same between pages ... but the var $user gets lost.

LOGIN PAGE
---
userid h:
session_name(): PHPSESSID
Session ID: f227e539d7b9b8db2c2a2b63dc79c6e2
Session name: PHPSESSID

after succesful LOGIN

userid h: jc
session_name(): PHPSESSID
Session ID: f227e539d7b9b8db2c2a2b63dc79c6e2
Session name: PHPSESSID
You are logged in as: jc

click on HREF linking to same page:

userid h: jc
session_name(): PHPSESSID
Session ID: f227e539d7b9b8db2c2a2b63dc79c6e2
Session name: PHPSESSID
You are logged in as: jc

click on FORM SUBMIT with action loading another page

userid h:
session_name(): PHPSESSID
Session ID: f227e539d7b9b8db2c2a2b63dc79c6e2
Session name: PHPSESSID
You are logged in as:

CONCLUSION

So as you can see the session ID is registered and the same throughout the 
two pages. BUT the var $userid loses it value ...

Any suggestions?

Here is some of my code in case it helps. Sorry for the length.

AUTH.php

(all functions are include files)

if (isset($PHPSESSID))
  session_start($PHPSESSID);
else
  session_start();

$PHPSESSID = session_id();
$SID   = PHPSESSID=$PHPSESSID;

html_header();

if(!isset($userid)) {
   login_form();
   exit;
}
else {
   session_register('userid', 'userpassword');
   $username = auth_user($userid, $userpassword);
   if(!$username) {
session_unregister(userid);
session_unregister(userpassword);
echo Authorization failed.  .
 Click on the following link to try again.BR\n;
echo A HREF=\$PHP_SELF\Login/ABR;
echo If you're not a member yet  .
 ask JC to add you to the user database.BR\n;
exit;
   }
   else {
menubar();
switch ($option) {
  case(create):
create_project();
break;
  case(show_all):
show_all_projects();
break;
  case(show_mine):
show_projects($userid);
break;
  case(edit):
edit_project($projectid);
break;
  default:
break;
}
   }
}

function auth_user($userid, $userpassword) {
   global $default_dbname, $user_tablename;

   $link_id = db_connect($default_dbname);
   $query = SELECT username FROM $user_tablename
 WHERE userid = '$userid'
 AND userpassword = password('$userpassword');
   $result = mysql_query($query);
   if(!mysql_num_rows($result)) return 0;
   else {
  $query_data = mysql_fetch_row($result);
  return $query_data[0];
   }
}

function login_form() {

   global $PHP_SELF, $option, $userid;

?
HTML
HEAD
TITLELogin/TITLE
/HEAD
BODY
FORM METHOD=POST ACTION=?php echo $PHP_SELF ?
   DIV ALIGN=CENTERCENTER
  H3Please log in to access the page you requested./H3
   TABLE BORDER=1 WIDTH=200 CELLPADDING=2
  TR
 TH WIDTH=18% ALIGN=RIGHT NOWRAPID/TH
 TD WIDTH=82% NOWRAP
INPUT TYPE=TEXT NAME=userid SIZE=8
 /TD
  /TR
  TR
 TH WIDTH=18% ALIGN=RIGHT NOWRAPPassword/TH
 TD WIDTH=82% NOWRAP
INPUT TYPE=PASSWORD NAME=userpassword SIZE=8
 /TD
  /TR
  TR
 TD WIDTH=100% COLSPAN=2 ALIGN=CENTER NOWRAP
INPUT TYPE=SUBMIT VALUE=LOGIN NAME=Submit
 /TD
  /TR
   /TABLE
   /CENTER/DIV
/FORM
/BODY
/HTML
?
}


clicking on a project link (HREF) brings up auth.php but with this:


function edit_project($projectid) {

  $link_id = db_connect();
  $query   = SELECT * from main_project WHERE projectid='$projectid';
  $result  = mysql_query($query, $link_id);

  while($data = mysql_fetch_object($result)) {
$title = $data-title;
$desc  = $data-description;
$est   = $data-est;
$act   = $data-act;
$man   = $data-manager;
$comp  = $data-completion;
$type  = $data-type;
  }

?

CENTER
FORM METHOD=POST ACTION=create_sub_project.php
INPUT TYPE=HIDDEN NAME=projectid VALUE=?php echo $projectid ?
INPUT TYPE=SUBMIT VALUE=Create a Sub-Project
/CENTER
CENTER
FORM METHOD=POST ACTION=create_project.php
INPUT TYPE=HIDDEN NAME=action VALUE=edit_main_project
INPUT TYPE=HIDDEN NAME=projectid VALUE=?php echo $projectid ?
FORM METHOD=POST ACTION=create_project.php
INPUT TYPE=HIDDEN NAME=action VALUE=edit_main_project
INPUT TYPE=HIDDEN NAME=projectid VALUE=?php echo $projectid ?
TABLE BORDER=1
  CAPTIONBEdit Project/B/CAPTION
  TR
TDTitle/TD
TD NOWRAPINPUT TYPE=TEXT VALUE=?php echo $title ? NAME=title 
SIZE=30/TD
  /TR
  TR
TDEstimated Hours/TD
TD NOWRAPINPUT TYPE=TEXT VALUE=?php echo $est ? NAME=est 
SIZE=8/TD
  /TR
  TR
TDResponsible/TD
TDSELECT NAME=manager
?php

  $link_id = db_connect();
  $query   = SELECT username from user;
  $result  = mysql_query($query, $link_id);

  $query   = SELECT username from user WHERE usernumber='$man';
  $res2= mysql_query($query, $link_id);

  $data2   = mysql_fetch_object($res2);
  $select  = 

Re: [PHP] socket_get_status()

2001-10-01 Thread Mukul Sabharwal

Hi,

Well I'm not totally sure, why socket_get_status would
not give you the correct value, other than a bug, as
the manual does indicate the socket functions are
experimental.

There are altenative ways to get the number of bytes
in the buffer, like using ioctl with FIONREAD,
ofcourse that is a C function, and I can't really
locate a PHP counterpart for it, other than what may
be a counterpart (socket_get_status). However yet
another solution is using the recv() counterpart,
socket_recv() with the MSG_PEEK flag.

Now you'd probably open up a local copy of the php
manpages, hunting for socket_recv()! Well it's not
there, it's an undocumented function (yet), and to my
knowlegde exists in PHP 4.0.7, atleast in the CVS.

function prototype:
mixed socket_recv(resource socket, int len, int flags)

and example usage:
$data = socket_recv($sockfd, $nbytes, MSG_PEEK);
$len = sizeof($data);

Now you would have to loop through the the complete
buffer, and let me remind you, that MSG_PEEK means
peeking into the buffer, it does not actually remove
the data from the recv() queue but only gives you a
copy, if you call the function without MSG_PEEK you
will get the same data, and then the data will be
discarded.

This is one way of finding out the no. of bytes in the
buffer, ofcourse socket_get_status() is surely much
better.

Incase I interpreted you incorrectly and you wanted to
know the no. of bytes the recieve buffer can hold then
here's the function, and this is also 4.0.7+ :

function prototype:
mixed socket_getopt(resource socket, int level, int
optname)

example usage:

$info = socket_getopt($sockfd, SOL_SOCKET, SO_RCVBUF);

and it remains pretty much the same for the send
buffer :

$info = socket_getopt($sockfd, SOL_SOCKET, SO_SNDBUF);

Hope that helps.

P.S - phpguru.org, nice domain name.

=
*
Know more about me:
http://www.geocities.com/mimodit
*

__
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com

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




[PHP] Having trouble using get_browser() function

2001-10-01 Thread Iván Milanez Castellanos

Hi, does anyone here know how to correctly configure php.ini to be able to
use browscap.ini in linux so that I can get the get_browser() function to
work properly, I need it because I'm building a statlog from scratch for my
web site.

Any help will be apreciated.

Iván

P.S. Sorry about my spelling but english is not my native language.



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




Re: [PHP] Namo Web Editor

2001-10-01 Thread Justin Rodino

Where does one find this Namo Web Editor?

===
Justin
Network Engineer/Systems Analyst
Interlink Companies

On Tue, 2 Oct 2001, Petras Virzintas wrote:

 Date: Tue, 2 Oct 2001 11:35:51 +1000
 From: Petras Virzintas [EMAIL PROTECTED]
 To: PHP General List [EMAIL PROTECTED]
 Subject: [PHP] Namo Web Editor
 
 Hi, apparently the Namo Web Editor has a PHP generator together with a MySQL 
interface. Is this truly an alternative to products such as PhpEd? Has anyone used it 
for production applications? Any other useful comments?
 
 Petras
 


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




Re: [PHP] Simple Question, I think

2001-10-01 Thread Ratfish

Thanks guys, that's just what I wanted to hear.and so quick too!

 From: [EMAIL PROTECTED] (Lawrence Sheed)
 Newsgroups: php.general
 Date: Mon, 1 Oct 2001 22:40:29 -0400
 To: [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: RE: [PHP] Simple Question, I think
 
 Simple to do it in php, but i would think its better done in apache using
 virtual host configuration.
 
 do a google search for virtual host apache
 
 
 
 
 -Original Message-
 From: Ratfish [mailto:[EMAIL PROTECTED]]
 Sent: October 2, 2001 10:25 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Simple Question, I think
 
 
 All I want to do is what an ASP page I have is doing.
 
 I just want to host multiple sites with one page like the one in the article
 below until I can get my head around the real way of doing it.
 
 http://www.zdnet.com/devhead/stories/articles/0,4413,2418330,00.html
 
 Surely there is a PHP equivalent?
 
 Thanks
 Andrew 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP] MySQL Ability

2001-10-01 Thread Devin Pittman

I would like to begin coding a online website creation tool for clients of
my small web design firm, and I'd like to use MySQL for the backend. I only
have one question - is MySQL fast enough and robust enough to handle large
amounts of data?  For example entire pages of text, etc.

Thanks for any help,
Devin



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




Re: [PHP] MySQL Ability

2001-10-01 Thread Rasmus Lerdorf

sure

On Tue, 2 Oct 2001, Devin Pittman wrote:

 I would like to begin coding a online website creation tool for clients of
 my small web design firm, and I'd like to use MySQL for the backend. I only
 have one question - is MySQL fast enough and robust enough to handle large
 amounts of data?  For example entire pages of text, etc.

 Thanks for any help,
 Devin






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




RE: [PHP] Namo Web Editor

2001-10-01 Thread Maxim Maletsky \(PHPBeginner.com\)

 by searching google, perhaps

Maxim Maletsky
www.PHPBeginner.com


-Original Message-
From: Justin Rodino [mailto:[EMAIL PROTECTED]] 
Sent: martedi 2 ottobre 2001 5.30
To: Petras Virzintas
Cc: PHP General List
Subject: Re: [PHP] Namo Web Editor


Where does one find this Namo Web Editor?

===
Justin
Network Engineer/Systems Analyst
Interlink Companies

On Tue, 2 Oct 2001, Petras Virzintas wrote:

 Date: Tue, 2 Oct 2001 11:35:51 +1000
 From: Petras Virzintas [EMAIL PROTECTED]
 To: PHP General List [EMAIL PROTECTED]
 Subject: [PHP] Namo Web Editor
 
 Hi, apparently the Namo Web Editor has a PHP generator together with a

 MySQL interface. Is this truly an alternative to products such as 
 PhpEd? Has anyone used it for production applications? Any other 
 useful comments?
 
 Petras
 


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



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




[PHP] mysql query for current id-1

2001-10-01 Thread Jason Dulberg

This is kindof a weird question so bear with me as I try to explain.

I have a session table that gets updated when a user logs in/out. If they
don't logout, some info is left unchanged. I have a cron script that takes
care of the stray sessions so that's all good. In the sessions table,
there's a field self_logout which is Y when they logout properly and N if
the cron script removes their session.

What I'd like to do is when the user logs in next time, a search will be
made to look at that users last login session info. If they didn't log out
properly, a notice will appear.

So theoretically, I need to search for something like:

users current id -1 or their last time of visit.

Here is the sql query that I have so far. But I think that I need to remove
the self_logout='N' because that doesn't show the actual last result;
rather it shows the last result where they didn't properly logout.

$sql=select id,agent,host, DATE_FORMAT(time_in, '%M %d, %Y, %l:%i') AS
unixdate from logged_in WHERE (self_logout='N') AND (userid='$current_user')
ORDER BY id DESC LIMIT 1,1;

Here is my trimmed down table structure:

CREATE TABLE logged_in (
id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
session varchar(100) DEFAULT '0' NOT NULL,
time_in timestamp(14),
time_out varchar(50) DEFAULT '-' NOT NULL,
self_logout char(1) DEFAULT 'N' NOT NULL,
KEY id (id)
);

Did that make any sense? To sum it all up, I just want to remind people to
click logout if they forgot the last time.

Thanks for any suggestions!!

__
Jason Dulberg
Extreme MTB
http://extreme.nas.net


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




Re: [PHP] eregi

2001-10-01 Thread mike cullerton

i realize a solution using strspn/strcspn was offered, but you asked for
eregi :)

anyway, i use ereg, but i think this should work

eregi(^[a-z0-9_\-]+$,$string)

notice that i had to escape the dash with a backslash

the plus sign forces atleast one character. you can use {x,y} in place of
the plus to force atleast x characters but no more than y characters.

mike

on 10/1/01 4:53 PM, Tim Ballantine at [EMAIL PROTECTED] wrote:

 Thankyou...
 
 I should have made it clearer that I did want to use only the legal
 characters to compare the string by.
 
 Tim
 
 Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Well, either you need to know the valid chars or the invalid ones.  Make
 up your mind and use strspn() or strcspn() appropriately.
 
 -Rasmus
 
 On Mon, 1 Oct 2001, Tim Ballantine wrote:
 
 Returns the length of the initial segment of str1 which does not
 contain
 any of the characters in str2.
 
 I realise that i could see if this matches with the length of the entire
 word, and is there a way to get it to compare the word by the legal
 characters, because the amount of illegal symbols, including different
 language symbols (french for example) will be too high for me to list.
 
 Tim
 
 Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Huh?  You better read that documentation page again.  You only need to
 list the illegal symbols.  And what do you mean by length?
 
 -Rasmus
 
 On Mon, 1 Oct 2001, Tim Ballantine wrote:
 
 Is there anything which doesnt use length? And something like eregi,
 because
 it would be infeasible to list all of the symbols that a user could
 use,
 to
 compare a string by.
 
 Tim
 
 Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 See php.net/strcspn
 
 On Mon, 1 Oct 2001, Tim Ballantine wrote:
 
 Hello,
 
 Could anyone tell me how to eregi a word, to see if it only
 contains
 either
 numbers, letters, the _ and the -, so that any other symbol
 with
 call it
 invalid. For example, theres the word expressio_n that will be
 valid,
 but
 the word express%^$-n will be invalid.
 
 Thankyou,
 
 Tim
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


 -- mike cullerton



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




  1   2   >