Re: [PHP] strstr

2004-02-27 Thread Burhan Khalid
Jakes wrote: I got this out the manual: how do I get the "user" ranther than "@example.com"Thanks $bits = explode('@',$email); echo $bits[0]; http://www.php.net/explode -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] strstr

2004-02-27 Thread Richard Davey
Hello Jakes, Friday, February 27, 2004, 1:55:40 PM, you wrote: J> I got this out the manual: J> $email = '[EMAIL PROTECTED]'; J> $domain = strstr($email, '@'); J> print $domain; // prints @example.com ?>> J> how do I get the "user" ranther than "@example.com"Thanks Use strpos() to locate the c

[PHP] strstr

2004-02-27 Thread Jakes
I got this out the manual: how do I get the "user" ranther than "@example.com"Thanks

Re: [PHP] strstr() question

2003-03-18 Thread Kevin Stone
- Original Message - From: "Charles Kline" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 18, 2003 12:50 PM Subject: [PHP] strstr() question > What is the expected return when using strtr() to compare a string to > an empty string? > >

[PHP] strstr() question

2003-03-18 Thread Charles Kline
What is the expected return when using strtr() to compare a string to an empty string? example: $myval = strstr('bob', ''); Thanks, Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] strstr-pls help

2002-12-11 Thread Mekrand
yes you are right, im very pensive today, :) thanks chris and mako "Chris Wesley" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Wed, 11 Dec 2002, Mekrand wrote: > > > i solved problem, -not a good solution- > > i changed only > > $adam=fread($ip,filesize($ip

Re: [PHP] strstr-pls help

2002-12-11 Thread Chris Wesley
On Wed, 11 Dec 2002, Mekrand wrote: > i solved problem, -not a good solution- > i changed only > $adam=fread($ip,filesize($ip)); You have: $string = fread( $fileHandle, filesize( $fileHandle ) ); The example at php.net you looked at has: $string = fread( $fileHandle, filesize( $fileName ) ); Ju

Re: [PHP] strstr-pls help

2002-12-11 Thread Mekrand
i solved problem, -not a good solution- i changed only $adam=fread($ip,filesize($ip)); to $adam=fread($ip,1024); i dont understand what is wrong with filesize($ip) . i got this from php.net and i thought it was valid. link: http://www.php.net/manual/en/function.fread.php quote: -- PHP Ge

Re: [PHP] strstr-pls help

2002-12-11 Thread Mako Shark
>but it doesnt work, You sure? It should be that you were trying to get the sizeof() $adam, which was thus far 0 bytes. So, of course, it would return 0 bytes to $adam, and your strstr() of looking for the IP address wouldn't work, since $adam would contain nothing. Try print()ing $adam to see wha

Re: [PHP] strstr-pls help

2002-12-11 Thread Mekrand
sorry the code was that doesnt work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] strstr-pls help

2002-12-11 Thread Mekrand
thanks, it was very silly mistake, but it doesnt work, there in nothing wrong with if statement, moreover, i think there is something wrong with fread, is there another way to reading a file, and return it as a string? doesnt work too -- PHP General Mailing List (http://www.php.net/) To unsub

Re: [PHP] strstr-pls help

2002-12-11 Thread Mako Shark
Your problem is with this line: $adam=fread($ip,filesize($adam)); Remember that $adam is not a file pointer, but text read from a file. The file pointer is $ip, so the line should read: $adam=fread($ip,filesize($ip)); (and should probably be contained within an if statement for error handling).

[PHP] strstr-pls help

2002-12-11 Thread Mekrand
i couldnt find out what is wrong with this script , can anbody explain $ip=fopen("ip.txt", 'r+'); $adam=fread($ip,filesize($adam)); fclose($ip); if(stristr($adam,$_SERVER[REMOTE_ADDR])) echo "an entry submitted from this ip already"; else { .. //block 1 .. } the ip.txt 10.8.0.21 10.8.5.21 10.8.7.

Re: [PHP] strstr Question

2001-08-12 Thread Mark Maggelet
On Sun, 12 Aug 2001 18:42:48 -0500, Erich Zigler ([EMAIL PROTECTED]) wrote: >I am currently writing a piece of code that when a user enters in >their >email address it will check it for validity. > >In this instance they are supposed to type in [EMAIL PROTECTED] But if >they >just type in user I w

[PHP] strstr Question

2001-08-12 Thread Erich Zigler
I am currently writing a piece of code that when a user enters in their email address it will check it for validity. In this instance they are supposed to type in [EMAIL PROTECTED] But if they just type in user I want it to add @domain.com at the end by default. This is the piece of code I have