Re: [PHP] Error while calling a function

2001-12-18 Thread Steve Cayford
I don't know all the details about how PHP compiles a program, but having your function definitions in an if-else statement that may not be executed looks suspicious to me. You've got if(!$Phone) { do something } else { function is_phone() { ...blah, blah...} } is_phone($Phone); If

Re: [PHP] PHP Doesn't Crash but show blank page

2002-01-03 Thread Steve Cayford
Two other lines to look for in your php.ini file: display_errors = On log_errors = Off If display_errors is on the error will be displayed on the web page, if log_errors is on the error will be logged--assuming you're using Linux check /var/log/messages, but you can change this with the

Re: [PHP] Regular Expression

2002-01-03 Thread Steve Cayford
You can do as Jim says here or go back and read the manual section again for eregi and ereg. What you're trying to do should be written more like this: ?php $str = 'body bgcolor=#ff'; $numMatches = eregi('(body)(.*)()',$str,$results); print(numMatches: $numMatches br\n); print(body

Re: [PHP] counting with dates (help!)

2002-01-07 Thread Steve Cayford
Well, I'll chime in as well. I'd recommend doing all your calculations in timestamps in seconds, then convert the results into days, dates, or whatever. If you only have a date to start with then convert to a timestamp, do the calculation, and convert back. You could wrap it in a function

Re: [PHP] Error

2002-01-08 Thread Steve Cayford
On Tuesday, January 8, 2002, at 09:37 AM, Dean Ouellette wrote: Hi I am learning php with Sams leanr php in 24 hours. This is one example ?php function addNums($firstnum, $secondnum) { $result = $firstnum + $secondnum; return $result;11:

Re: [PHP] Is there Any way to call Non-Existent function in PHP

2002-01-17 Thread Steve Cayford
You could wrap your function calls, maybe. Like function my_Draw_Image() { if(function_exists('Draw_Image')) { return Draw_Image(func_get_args()); } else { // do whatever... } } Haven't tested this at all, but it seems plausible. Might be

Re: [PHP] variable variables

2002-01-17 Thread Steve Cayford
On Thursday, January 17, 2002, at 10:11 AM, Mike Krisher wrote: I can not wrap my head around variable variables today, not awake yet or something. For instance I trying something like this: while ($i$loopcounter) { $temp = size; $valueofsize = $$temp$i; try $valueofsize =

Re: [PHP] contents of fetch array into a string

2002-03-06 Thread Steve Cayford
On Wednesday, March 6, 2002, at 12:13 PM, Kris Vose wrote: I have a problem with reading the contents of $r[1] into a string called = $mail. Does anyone have any suggestions? Any help is greatly appreciated. Kris Vose if ($czero != ) { $t = mysql_query(SELECT * FROM

Re: [PHP] Perl and PHP

2002-03-06 Thread Steve Cayford
If you're running a perl script on the command line you would use /path/to/perl/script.pl value1 value2 value3 ... In your perl script $ARGV[1] should hold value1, $ARGV[2] should hold value2, etc. -Steve On Wednesday, March 6, 2002, at 02:48 PM, [EMAIL PROTECTED] wrote: I need to pass a

Re: [PHP] Perl and PHP

2002-03-06 Thread Steve Cayford
however it prints the varforPHP to the broswer, I need it saved it var Any (more) help would be great!! Michael On Wed, 6 Mar 2002, Steve Cayford wrote: If you're running a perl script on the command line you would use /path/to/perl/script.pl value1 value2 value3 ... In your perl script

Re: [PHP] Driving me nuts, need one second of your time

2002-03-15 Thread Steve Cayford
It looks like your sql query failed, so the result is invalid. Assuming that this is really the whole script, then you're counting on the mysql_db_query function to open a connection to the database db using the default connection values which (according to the manual) are host: localhost,

Re: [PHP] Where is php.ini on Mac OS X?

2002-03-27 Thread Steve Cayford
On mine it's in /usr/local/lib, but I seem to recall discussion earlier about some OSX installations lacking the ini file. -Steve On Tuesday, March 26, 2002, at 04:53 PM, Chuck PUP Payne wrote: Can some one please tell me where php.ini is located on Mac OS X? Thanks, Chuck Payne Magi

Re: [PHP] Parsing error

2002-04-01 Thread Steve Cayford
It looks like you've got a closing curly bracket } for your switch statement, but not for your while statement. Also, have you read up on the switch statement? Keep in mind that if something matches your case 1, it will also fall through and execute case 2, case 3, etc... unless you include

Re: [PHP] session

2002-04-02 Thread Steve Cayford
Try putting session_start() in your retief.php script as well as piet.php. -Steve On Wednesday, April 3, 2002, at 01:06 PM, R. Lindeman wrote: okay i've posted something before here are my scripts either you tell me what i do wrong or i'll go beserk you can check the outcome of the code

Re: [PHP] Loop, array, life....

2002-04-03 Thread Steve Cayford
On your first email you loop through all the news in the $newsfetch resource. I think you need to then do a mysql_data_seek() call against that to reset it for the next time through the loop. Otherwise you'll just get a null result because you're already at the end of the data. -Steve On

Re: [PHP] Classes??

2002-04-04 Thread Steve Cayford
Yeah, sure. -Steve On Thursday, April 4, 2002, at 10:42 AM, Gerard Samuel wrote: Maybe a simple question. But can one file contain 2 or more classes?? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing

Re: [PHP] English/Arabic Mysql problem...

2002-04-04 Thread Steve Cayford
Are you using unicode? I don't know the answer for you - maybe check the mysql site - but I'd be interested in hearing an answer as well if anyone has one. -Steve On Thursday, April 4, 2002, at 12:11 AM, Dhaval Desai wrote: Hello people, I am making a bilingual website English/Arabic. I

Re: [PHP] objects handling objects

2002-04-04 Thread Steve Cayford
On Thursday, April 4, 2002, at 04:21 PM, Erik Price wrote: I looked in the manual, but didn't see anything about this. I've read that PHP isn't a true object-oriented language, but rather simulates elements of object-oriented programming. Can I write a class that performs operations

Re: [PHP] objects handling objects

2002-04-04 Thread Steve Cayford
Doh, typo: // this next line would generate a parse error // print(c:a1: . $c-echo($a)-method1() . br /\n); should read // this next line would generate a parse error // print(c:a1: . $c-echoMethod($a)-method1() . br /\n); On Thursday, April 4, 2002, at 05:25 PM, Steve Cayford wrote

Re: [PHP] How to sort by 3rd row in an 2d-Array

2002-04-12 Thread Steve Cayford
Or try the usort() function? ?php ... myArray[1][firstname] = Joe; myArray[1][lastname] = Smith; myArray[1][company] = Bullock; myArray[1][email] = [EMAIL PROTECTED]; myArray[2][firstname] = Jim; myArray[2][lastname] = Cords; myArray[2][company] = Jamen; myArray[2][email] = [EMAIL PROTECTED];

Re: [PHP] Wanting a better understanding of classes in PHP...

2002-04-12 Thread Steve Cayford
Well, start here probably: http://www.php.net/manual/en/language.oop.php -Steve On Friday, April 12, 2002, at 12:50 PM, Chuck PUP Payne wrote: Hi, I was up on freshmeat and I saw a TON of php classes. I like to know how can I use them? And is a class a bit of code that you are always

Re: [PHP] What date/time was it 7 hours ago?

2002-04-15 Thread Steve Cayford
You could convert it to a timestamp using strtotime(), subtract 7*60*60, then convert it back to a string with strftime(). -Steve On Monday, April 15, 2002, at 09:50 AM, Torkil Johnsen wrote: What date/time was it 7 hours ago? I'm just trying to make a log using mysql/php This log is

Re: [PHP] calculating US holidays

2002-04-15 Thread Steve Cayford
You could port Date::Calc from perl... or just call a perl script to do the calculation. Probably the easiest way to figure out Easter (for the extreme example) that I can think of. -Steve On Monday, April 15, 2002, at 03:05 PM, Tom Beidler wrote: That's fine for fixed dates, and I have

Re: [PHP] Please Help

2002-04-16 Thread Steve Cayford
Check out the bottom of each message... -Steve On Tuesday, April 16, 2002, at 10:43 AM, Omland Christopher m wrote: Can anyone tell me how to unsubscribe. There is just a bit too much volume for me. Thanks. -Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Array Question

2002-04-18 Thread Steve Cayford
On Thursday, April 18, 2002, at 04:38 PM, Jason Lam wrote: $arr2 is a 2d array. $arr1[0] = 1; $arr1[1] = 10; $arr2[0] = $arr1; print $arr2[0][1]; Result will be 10 But, $arr1[0] = 1; $arr1[1] = 10; $arr2[0] = $arr1; $arr3 = each($arr2); print $arr3[1]; What are you expecting?

Re: [PHP] Cannot add header information

2002-04-29 Thread Steve Cayford
On Monday, April 29, 2002, at 12:02 PM, Bo Pritchard wrote: I know without the accompanying code there's no way to help me...But without having to get real specific what does the following message tell me is wrong? Thanks Warning: Cannot add header information - headers already sent

Re: [PHP] parse error

2002-04-30 Thread Steve Cayford
Looks like your problem is on line 24. See below. -Steve On Tuesday, April 30, 2002, at 12:48 PM, Jule wrote: Hey guys, i'm writing this guestbook script for my site, and i'm getting a random parse error where i think everything is normal, it gives it on line 26 which is echo Your

[PHP] Querying an object's functions

2001-09-24 Thread Steve Cayford
Is there any way in PHP 4.0.6 to query an object for its member functions? For example I have a couple classes that have an htmlString() function to display themselves in some special way as html. I'd like to go through a list of various objects, find out if each can run htmlString() and if

Re: [PHP] Querying an object's functions

2001-09-24 Thread Steve Cayford
Thanks. Sorry for missing that. -Steve On Monday, September 24, 2001, at 05:54 PM, Rasmus Lerdorf wrote: http://www.php.net/manual/en/function.get-class-methods.php On Mon, 24 Sep 2001, Steve Cayford wrote: Is there any way in PHP 4.0.6 to query an object for its member functions

Re: [PHP] Feature?

2001-09-25 Thread Steve Cayford
Maybe this? A bit verbose, but functional. -Steve ?php function foo($p) { if (empty($p['fred'])){ $p['fred'] = 'hello'; } if (empty($p['banana'])){ $p['banana'] = 'world'; } echo $p['fred'] . $p['banana']; } foo(array('fred' = 'hello', 'banana' = 'world')); ? On

Re: [PHP] Getting my head around nulls

2001-09-25 Thread Steve Cayford
On Tuesday, September 25, 2001, at 10:30 AM, [EMAIL PROTECTED] wrote: Thanks for correcting my misspelling, Andrey, IS NULL not IS_NULL. Another thing to look at, Ben, is IFNULL(). I would give you an example, but I never got it to work like I thought it should ;) I think it is

Re: [PHP] Getting my head around nulls

2001-09-26 Thread Steve Cayford
On Wednesday, September 26, 2001, at 02:48 AM, [EMAIL PROTECTED] wrote: Steve Cayford [EMAIL PROTECTED] on 25/09/2001 17:28:57 To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [PHP] Getting my head around nulls On Tuesday, September 25, 2001

[PHP] Extract. Was Re: Feature?

2001-09-26 Thread Steve Cayford
Just looking up that extract function, the manual says it extracts into the current symbol table. I assume that means that within foo() the array would be extracted into local variables. Is that right? -Steve On Wednesday, September 26, 2001, at 06:50 AM, Alister wrote: Follow up to my own

Re: [PHP] Building Dynamic Value list using ohp

2001-09-26 Thread Steve Cayford
Also look for missing semicolons and unclosed braces in the lines above 22. -Steve On Wednesday, September 26, 2001, at 09:19 AM, Derek Mailer wrote: oops...I was going to add... 2) - $result = mysql_query($query, $mysql_link); doesn't require the $mysql_link argument, try $result =

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

Re: [PHP] require include

2001-10-22 Thread Steve Cayford
http://www.php.net/manual/en/function.require.php require() pulls in the target file when the source file is parsed/compiled, include() pulls in the target file when the source file is executed. So an include() nested in an if statement will only be included if the if statement evaluates to

Re: [PHP] Re: require include

2001-10-23 Thread Steve Cayford
So both include() and require() *are* subject to conditional statements in the code? Guess I missed that. Thanks. -Steve On Tuesday, October 23, 2001, at 01:00 AM, Rasmus Lerdorf wrote: That's outdated. The only difference today is that if a file can't be included/required for some

[PHP] Confused object in session variable.

2001-10-25 Thread Steve Cayford
Well, it's probably me that's confused. I have an authenticate() function which should start a session and if the user is not logged in then show the login screen otherwise return after storing and registering a user object in a session variable. This object has accessor methods to get the

Re: [PHP] Confused object in session variable.

2001-10-25 Thread Steve Cayford
was doing wrong. Thanks for any suggestions. -Steve On Thursday, October 25, 2001, at 12:07 PM, Steve Cayford wrote: Well, it's probably me that's confused. I have an authenticate() function which should start a session and if the user is not logged in then show the login screen otherwise return

Re: [PHP] function names

2001-10-25 Thread Steve Cayford
On Thursday, October 25, 2001, at 02:08 PM, Martín Marqués wrote: On Jue 25 Oct 2001 15:36, you wrote: Hello php-general, I have such code: class A { var $xxx; function print() { echo $xxx; $xxx is internal to the print function.

Re: [PHP] Setting A MySQL Column to NO DUPLICATES

2001-10-25 Thread Steve Cayford
I think you want UNIQUE. create table sometable ( somecolumn char(40), someothercolum int, unique somecolumn ) ...something like that. I haven't messed with it much. -Steve On Thursday, October 25, 2001, at 04:31 PM, Jeff Gannaway wrote: Does anyone know how to set

Re: [PHP] Re: header(Location:);

2001-10-30 Thread Steve Cayford
On Tuesday, October 30, 2001, at 11:41 AM, Henrik Hansen wrote: [EMAIL PROTECTED] (Alberto) wrote: Ok, it works fine for me, i can redirection, but I don't want the browser to load another page, I want to IF A THEN RUN A.PHP, IF B THEN RUN B.PHP, I know i can use include('a.php') or

Re: [PHP] Sessions Header PROBLEM again!

2001-11-02 Thread Steve Cayford
Don't know offhand what the problem is, but a couple thoughts: 1. Why are you using session_name(mysession) instead of session_name('mysession')? 2. Assuming you have register_globals on, you're trying to pass $count both as a session variable and a post variable. One of these is going to

Re: [PHP] very weird PHP behaviour...

2001-11-14 Thread Steve Cayford
Sure sounds like you're hitting this function twice by accident. Are you sure you're only calling it once? That would explain why you only get one output with the die(), but two without it. -Steve On Wednesday, November 14, 2001, at 10:34 AM, Christian Dechery wrote: I don't know what it

Re: [PHP] Anyone ever done this - sort a multi-dimensional array

2001-11-15 Thread Steve Cayford
You can roll your own fairly easily: function mycmp($a,$b) { return strcmp($a[1],$b[1]); } usort($array, 'mycmp'); ...something like that at any rate. -Steve On Thursday, November 15, 2001, at 10:07 AM, Richard S. Crawford wrote: Of the type... $array[0][0] = !row of c's;

Re: [PHP] query works in mysql, but not from php

2001-11-19 Thread Steve Cayford
You don't need to put in the final semi-colon when running a query from php. Take that out and you should be fine. -Steve On Monday, November 19, 2001, at 04:58 PM, Olav Drageset wrote: Hi $sql = SELECT user FROM persons WHERE user = '$firstName' and domain = '$domainName' ; ; $result

[PHP] Why are slashes automatically stripped from db result?

2001-12-03 Thread Steve Cayford
Hey all. I'm storing some jpeg images in a mysql database using the PEAR classes. Before inserting the image into the db I call addslashes() on the data, I was, accordingly, calling stripslashes() on the data after pulling the image back out of the database, but the image was getting mangled.

Re: [PHP] Why are slashes automatically stripped from db result?

2001-12-04 Thread Steve Cayford
. Thanks. -Steve Good luck Steve, Tyler Longren - Original Message - From: Martin Towell [EMAIL PROTECTED] To: 'Steve Cayford' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, December 03, 2001 6:04 PM Subject: RE: [PHP] Why are slashes automatically stripped from db result

Re: [PHP] 'Running' a file from PHP script

2001-12-04 Thread Steve Cayford
On Tuesday, December 4, 2001, at 02:22 AM, George Pitcher wrote: Hi all, I'm a PHP newbie, my main scipring being done in Blueworld's Lasso. I have used php fro time to time with Lasso to do some file handling. My question is: 'Can I run a file from a PHP script?' The file in question

Re: [PHP] Cannot use a scalar value as an array

2001-12-04 Thread Steve Cayford
On Tuesday, December 4, 2001, at 06:04 AM, Xavier Antoviaque wrote: Hello all, I have a problem with a php script, which I want to use to fetch two data (integer) from a MySQL table, divide the first by the second, and store the value resulting in an double array. That seems not very

Re: [PHP] 'Running' a file from PHP script

2001-12-04 Thread Steve Cayford
is running and if it isn't then I want to 'run' it. Platform is NT, server is IIS4 George - Original Message - From: Steve Cayford [EMAIL PROTECTED] To: George Pitcher [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, December 04, 2001 3:39 PM Subject: Re: [PHP] 'Running

Re: [PHP] Display BLOB Image

2001-12-06 Thread Steve Cayford
This is what I used to do what you're trying: header(Content-Type: image/ . $imagetype); // $imagetype is jpeg or gif header(Content-Length: . strlen($image)); echo $image; Note that Type is capitalized in Content-Type, and include the Content-Length as well. -Steve On Thursday, December

Re: [PHP] Finding num of days b/t two dates.

2001-12-07 Thread Steve Cayford
Here's one way to do it by converting dates into timestamps. ?php $date1 = mktime(0,0,0,10,1,2001); // in the form (hours, minutes, seconds, month, day, year) $date2 = mktime(0,0,0,10,1,2000); $timedif = $date1 - $date2; print(strftime(date 1 is %b %d, %Y, $date1) . br\n); print(strftime(date

[PHP] Class methods and inheritance...

2001-12-11 Thread Steve Cayford
Hi. Is there a way to find the class name of a method when called in the class::method() format? If called on an object (eg. object-method()) I could just ask for get_class($this), but when called as class::method(), $this should not be defined. Anyway around this? Thanks. -Steve -- PHP

Re: [PHP] Date formatting

2001-12-11 Thread Steve Cayford
On Monday, December 10, 2001, at 09:35 PM, phantom wrote: What would be an easy what to format a date value into month day year?? I want to specially display a date stored in mysql in date format -MM-DD The manual says: string date (string format, int [timestamp]) I tried