Re: [PHP] require_once adds a "1"

2003-03-07 Thread James Holden
The '1' is received simply because your requirement clause echoed the result to the page. include, require and include_once all return boolean results of 1 or 0 which indicates a successful loading of said include. If you want to suppress the output of an include use ob_ methods which prevent

[Fwd: Re: [PHP] error while reading google-search-results]

2003-03-07 Thread James Holden
Welcome to a mine field of problems :-) 1. The url you have entered is invalid. Thats a good first check to make usually. Try /search?q=test to get that bit sorted. 2. Google prevents known useragents from accessing it's content as it believes you are acting as a spider or a search engine s

[Fwd: Re: [PHP] Checking for Null Variables]

2003-03-07 Thread James Holden
quick way: if (!$field["name"]){ } else {} elegant ways (there will be many): if (empty($field["name"])){ // null or 0 } else {} if (is_null($field["name"])){ // null } else {} is_scalar() // string is_integer() // integer is_float() // float etc etc etc Christopher J. Crane wrote: How do I

Re: [PHP] dynamic/multidimensional arrays in classes

2003-03-10 Thread James Holden
$this->$arr[] should be $this->arr[] You are using a variable defined within the class - since it is a class variable you can reference it as you would anything else within the class, using '$this->' Patrick Teague wrote: I'm having problems figuring this out. This first way gives me a

Re: [PHP] timestamp to english

2003-03-10 Thread James Holden
In mysql use DATE_FORMAT(FROM_UNIXTIME(time),"%H ... etc") In PHP use echo date("", time()); Read the manuals at mysql.com and php.net. jim Lord Loh. wrote: How do I convert the unix time stamp (the one I get by the time()) to a readable English language time I am getting data from mySQL

Re: [PHP] imagejpeg and downloading images

2003-03-11 Thread James Holden
READ the manual. The snippet is correct but if you want to take advantage of the saving features of this function follow the function information at the top of the page. Jumping straight to the user snippets is a mistake as they are user contributed and may not document the whole function. in

RE: [PHP] mail() function

2002-05-29 Thread James Holden
RTFM! mail($email_address,$subject,$message,$header); You can use @mail to supress any errors produced. Example: @mail("[EMAIL PROTECTED]","This is a Test","My Message","From: James <[EMAIL PROTECTED]>"); Look at: http://uk.php.net/manual/en/ref.mail.php - James www.LondonTown.com -Ori

RE: [PHP] mail() function

2002-05-29 Thread James Holden
knowledge -Original Message- From: Ed Gorski [mailto:[EMAIL PROTECTED]] Sent: 29 May 2002 16:26 To: r; [EMAIL PROTECTED] Subject: Re: [PHP] mail() function lol.what does that return? At 09:08 PM 5/29/2002 -0700, r wrote: >That may and may not work, I would suggest you add the RTFM(

RE: [PHP] Global variables

2002-05-30 Thread James Holden
Look at the auto-prepend or auto-append feature. -Original Message- From: serge gedeon [mailto:[EMAIL PROTECTED]] Sent: 29 May 2002 14:35 To: [EMAIL PROTECTED] Subject: [PHP] Global variables Dear sir, I would like to know if I could create using PHP, global variables that I could use

RE: [PHP] How can I remove the last character from a one line file?

2002-05-30 Thread James Holden
Function StripLastChar( $file ){ $fp = fopen("$file","r"); if ($fp){ $contents = fread($fp,10); fclose($fp); } $contents = eregi_replace("o$","",$contents);

RE: [PHP] user auth.. with mysql and cookies.. help

2002-05-30 Thread James Holden
It's basically saying that you are outputing stuff to the browser before you are setting the cookies which is a no go. All header requests (header() & setcookie()) must be run before any text is outputted. Thus, the most common error is that after or before your php tags is empty space, which t

RE: [PHP] Design Problem

2002-05-30 Thread James Holden
Does it matter? The search engine doesnt know your producing dynamic content, its just requesting a page to scan, regardless of the way your producing it. - James -- W: www.londontown.com @: [EMAIL PROTECTED] -- -Original Message- From:

RE: [PHP] Design Problem

2002-05-30 Thread James Holden
] Sent: 30 May 2002 15:18 To: James Holden Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Design Problem Importance: High Thanks very much for the advice! Was that actually the way to do it? If it is,where can I get list of the IPs, please... thanks again... Dani James Holden wrote: > Does it mat

RE: [PHP] Design Problem

2002-05-30 Thread James Holden
13:05 To: [EMAIL PROTECTED] Subject: Re: [PHP] Design Problem On Thursday 30 May 2002 19:42, James Holden wrote: > I do it a different way - using IP's can be a bit of a bummer since they > might change but often as not the hostnames dont. > > I detect spiders using the HTTP

RE: [PHP] MORE Design Problem

2002-05-30 Thread James Holden
]; [EMAIL PROTECTED] Subject: Re: [PHP] MORE Design Problem Importance: High Thank you...everyone! I really appriciated it. Where can I learn about all of this? Is there a tutorial website about this? thanks again. Dani [EMAIL PROTECTED] wrote: > > James Holden wrote: > > > &g

RE: [PHP] nested if parse error

2002-05-30 Thread James Holden
I think coding without the use of brackets and line seperation will drive you mad! A working copy of your code: This in my humble op is so much neater and you can debug this in a second. if (1){ if (1) { echo "Hello"; } } else { } - James -

RE: [PHP] Re: PHP can not connect to mysql

2002-05-31 Thread James Holden
@mysql_connect("localhost:/tmp/mysql","user","pass"); - James -- W: www.londontown.com @: [EMAIL PROTECTED] -- -Original Message- From: andy [mailto:[EMAIL PROTECTED]] Sent: 31 May 2002 15:19 To: Michael Davey; [EMAIL PROTECTED] Subject: [