[PHP] Re: 2 decimal places

2001-09-26 Thread Geir Eivind Mork

Kurth Bemis wrote:

 i'm looking for a php function to add 2 decimal place sto a number.  if the
 number already have one decimal place then one more zero should be added to
 make it two decimal placesanyone know of a quick way to do this?

printf(%.2f,$var);
-- 
PHP Developer, home: http://www.moijk.net | work: http://www.coretrek.com
parse_str: Parses the string into variables | 
http://www.php.net/manual/en/function.parse-str.php

-- 
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] Receive Header.

2001-09-26 Thread Marian Vasile

I have a dir, full with bounch of pictures.
I need to find out the size of pictures, from another server.
I can't ftp or anything like this, so I need to open those pics, and
find out the size.
The problem is that is too slow for a lot of pics but I woder...
I can't find out the size without downloading the entire file ?
(sometimes browser shows the size from the beginning)

Any idea ?

Any help will be greatly appreciated !
Thank you,
Marian


-- 
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] one pattern, one string, multiple results

2001-09-26 Thread Richard Baskett

I just can not seem to figure this out.

If i have a pattern 'arc' and I want to search the string:
an arc is an archer, but what about marc and darcy?

How can I find out how many occurances of arc is within that string?  I know
I can do an explode and then compare it, but when you have huge amounts of
text... is this the best way?  Or is there something better?  Any help would
be great I have been struggling with this for awhile, since I really do not
want to explode, pun intended :)

Rick


-- 
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] Problem: ereg doesn't work ok (?).

2001-09-26 Thread * RzE:

 I noticed something I haven't before: I'm generating a RPM for php-4.0.6
 which is what I'm installing, but using the .spec file from the 4.0.4
 which comes with RedHat. Well, in the configure it had
 --with-regex=system. I removed this option, recompiled, and the regex'es
 seem to be working fine now. The --with-regex=system comes by default in
 the RedHat RPM for PHP.

Ah. Glad the problem is solved. Otherwise it would be a *strange*
problem!


 Thank you.
 Rodolfo.
 
 P.S.
  $yesternews = date(Y-m-d, mktime(0,0,0,$regs[2],$regs[3]-1,$regs[1]));
 
 Indeed. Cool, thanks :)

UR welcome.

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
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] Receive Header.

2001-09-26 Thread Maxim Maletsky \(PHPBeginner.com\)


Have you looked into GetImageSize()? php.net/getimagesize
Though, I don't know if it works with remote files. Try it.


Maxim Maletsky
PHPBeginner.com



-Original Message-
From: Marian Vasile [mailto:[EMAIL PROTECTED]] 
Sent: mercoledì 26 settembre 2001 8.48
To: [EMAIL PROTECTED]
Subject: [PHP] Receive Header.


I have a dir, full with bounch of pictures.
I need to find out the size of pictures, from another server.
I can't ftp or anything like this, so I need to open those pics, and
find out the size. The problem is that is too slow for a lot of pics but
I woder... I can't find out the size without downloading the entire file
? (sometimes browser shows the size from the beginning)

Any idea ?

Any help will be greatly appreciated !
Thank you,
Marian


-- 
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: one pattern, one string, multiple results

2001-09-26 Thread _lallous

try this!
I don't know how effective is preg_replace w/ huge memory contentsbut
this should work fine!

  $mem = an arc is an archer, arc but what about marc and darcy?;
  $match = arc;
  $count = 0;
  preg_replace(/\b$match\b/ie, \$count++;, $mem);
  echo $count;

Richard Baskett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I just can not seem to figure this out.

 If i have a pattern 'arc' and I want to search the string:
 an arc is an archer, but what about marc and darcy?

 How can I find out how many occurances of arc is within that string?  I
know
 I can do an explode and then compare it, but when you have huge amounts of
 text... is this the best way?  Or is there something better?  Any help
would
 be great I have been struggling with this for awhile, since I really do
not
 want to explode, pun intended :)

 Rick




-- 
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] one pattern, one string, multiple results

2001-09-26 Thread * RzE:

Original message
From: Richard Baskett [EMAIL PROTECTED]
Date: Wed, Sep 26, 2001 at 12:01:11AM -0700
Message-ID: [EMAIL PROTECTED]
Subject: [PHP] one pattern, one string, multiple results

 I just can not seem to figure this out.
 
 If i have a pattern 'arc' and I want to search the string:
 an arc is an archer, but what about marc and darcy?
 
 How can I find out how many occurances of arc is within that string?  I know
 I can do an explode and then compare it, but when you have huge amounts of
 text... is this the best way?  Or is there something better?  Any help would
 be great I have been struggling with this for awhile, since I really do not
 want to explode, pun intended :)
 
 Rick

/Original message

Reply

This you do the job exactly as you want:

http://www.php.net/manual/en/function.substr-count.php

int substr_count (string haystrack, string needle)

/Reply

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
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] one pattern, one string, multiple results

2001-09-26 Thread Maxim Maletsky \(PHPBeginner.com\)


Hi Richard.

Subsrt_count() is what you are looking for:
int substr_count (string haystrack, string needle)
php.net/substr_count

P.S: Helen Fielding's Bridget Jones Diary is a nice novel, hun?


Maxim Maletsky
PHPBeginner.com



-Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]] 
Sent: mercoledi 26 settembre 2001 9.01
To: PHP General
Subject: [PHP] one pattern, one string, multiple results


I just can not seem to figure this out.

If i have a pattern 'arc' and I want to search the string:
an arc is an archer, but what about marc and darcy?

How can I find out how many occurances of arc is within that string?  I
know I can do an explode and then compare it, but when you have huge
amounts of text... is this the best way?  Or is there something better?
Any help would be great I have been struggling with this for awhile,
since I really do not want to explode, pun intended :)

Rick


-- 
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] Getting my head around nulls

2001-09-26 Thread Ben . Edwards







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, at 10:30  AM, [EMAIL PROTECTED]
wrote:


 Just had a look at manual, ifnull() seems close to useless.  However if
 they had NVL(), as Oracle douse

 NVL( column|litrel, '*null*' )

 This takes a column or literal as its first arg and if arg is null
 returns
 2nd arg otherwise returns arg.  In other words if the column is null it
 is
 replaces by arg2 otherwise it is simply returned.


Um, that's what ifnull() does. At least it works for me.

-Steve

Verry true, sorry, was looking at nullif.  Also noticed the if function,
can this have more than three parameters.  i.e

if ( col, 'A', 'Accept', 'C', 'Complete', 'Unknown' )

like Oracle decode. and if elseif else structure.

Neb










-- 
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] Receive Header.

2001-09-26 Thread Marian Vasile

I have a dir, full with bounch of pictures.

I need to find out the size of pictures, from another server.

I can't ftp or anything like this, so I need to open those pics, and find
out the size. The problem is that is too slow for a lot of pics but I
woder... I can't find out the size without downloading the entire file ?
(sometimes browser shows the size from the beginning)

Any idea ?

Any help will be greatly appreciated !

Thank you,

Marian




-- 
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] one pattern, one string, multiple results

2001-09-26 Thread Richard Baskett

Thank you much!  I was going to use preg_grep, preg_replace, preg_match,
preg_match_all something like that, but this subsrt_count() will do the
trick nicely!  Thank you very much!

Rick

 Hi Richard.
 
 Subsrt_count() is what you are looking for:
 int substr_count (string haystrack, string needle)
 php.net/substr_count
 
 P.S: Helen Fielding's Bridget Jones Diary is a nice novel, hun?
 
 
 Maxim Maletsky
 PHPBeginner.com
 
 
 
 -Original Message-
 From: Richard Baskett [mailto:[EMAIL PROTECTED]]
 Sent: mercoledi 26 settembre 2001 9.01
 To: PHP General
 Subject: [PHP] one pattern, one string, multiple results
 
 
 I just can not seem to figure this out.
 
 If i have a pattern 'arc' and I want to search the string:
 an arc is an archer, but what about marc and darcy?
 
 How can I find out how many occurances of arc is within that string?  I
 know I can do an explode and then compare it, but when you have huge
 amounts of text... is this the best way?  Or is there something better?
 Any help would be great I have been struggling with this for awhile,
 since I really do not want to explode, pun intended :)
 
 Rick
 
 
 -- 
 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] Receive Header.

2001-09-26 Thread Marian Vasile

If I use GetImageSize I get

Warning: Unable to open http://www.php.net/gifs/logo.gif in
/home/irisi/public_html/bonic/webgal/test.php on line 2

Any idea why ?

Maxim Maletsky ) [EMAIL PROTECTED] wrote in message
006801c1465d$458a5100$c029abd4@tatiana">news:006801c1465d$458a5100$c029abd4@tatiana...

Have you looked into GetImageSize()? php.net/getimagesize
Though, I don't know if it works with remote files. Try it.


Maxim Maletsky
PHPBeginner.com



-Original Message-
From: Marian Vasile [mailto:[EMAIL PROTECTED]]
Sent: mercoledì 26 settembre 2001 8.48
To: [EMAIL PROTECTED]
Subject: [PHP] Receive Header.


I have a dir, full with bounch of pictures.
I need to find out the size of pictures, from another server.
I can't ftp or anything like this, so I need to open those pics, and
find out the size. The problem is that is too slow for a lot of pics but
I woder... I can't find out the size without downloading the entire file
? (sometimes browser shows the size from the beginning)

Any idea ?

Any help will be greatly appreciated !
Thank you,
Marian


--
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: Running Programs.....

2001-09-26 Thread Lukas

Anthony,


Anthony [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 posted  mailed

 Im trying to use PHP to execute a program, called J-Express, and its run
 through the command shell through ./J-Express.
 What do I use in PHP so that this program will be automatically opened
 through my website.
 I have tried a whole variety of things, but cant seem to find anything
that
 actually opens a program that the user can use.


I'm not sure if this is what you mean, but if you mean that you're trying to
open an application on the users computer then you're out of luck. PHP is
only able to work on the server.

I am not aware of anything that will allow you to execute applications on
the client besides some sort of custom plugin or something.


 Thanks

 Anthony



-- 
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: one pattern, one string, multiple results

2001-09-26 Thread _lallous

use this modifier /ies instead of /ie

_lallous [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 try this!
 I don't know how effective is preg_replace w/ huge memory contentsbut
 this should work fine!

   $mem = an arc is an archer, arc but what about marc and darcy?;
   $match = arc;
   $count = 0;
   preg_replace(/\b$match\b/ie, \$count++;, $mem);
   echo $count;

 Richard Baskett [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I just can not seem to figure this out.
 
  If i have a pattern 'arc' and I want to search the string:
  an arc is an archer, but what about marc and darcy?
 
  How can I find out how many occurances of arc is within that string?  I
 know
  I can do an explode and then compare it, but when you have huge amounts
of
  text... is this the best way?  Or is there something better?  Any help
 would
  be great I have been struggling with this for awhile, since I really do
 not
  want to explode, pun intended :)
 
  Rick
 





-- 
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 can I fetch a table from html file using php?

2001-09-26 Thread Sami Kyösti

I have a sample file in http://demo.ina-finland.fi/sample.html and
there's a table which is named ruudukko.

How can a just get that table in to my other html file using php?

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

2001-09-26 Thread Christian Reiniger

On Wednesday 26 September 2001 01:07, Andrew Austin wrote:
 What is the method for mySQL to surround single speechmarks as in 
 (don't) so it will be accepted in an SQL statement.

http://php.net/addslashes

-- 
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)

Error 032: Recursion error - see error 032

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

2001-09-26 Thread CB

Hi!

Is it possible to use PHP (or maybe Perl) for communication with a
Novell-network/a Novell-server from a webserver?

/Örjan

--


 Mail: [EMAIL PROTECTED]
 URL:  http://www.tag.nu/orjan/





-- 
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] Free hosts, or Temp account...some thing

2001-09-26 Thread ReDucTor

Hey,
  I just made a kewl little script, that i want to test out it requires GD,
it doesn't appear to work on my Windows machine, but i think it might work
better on a Unix/Linux machine, so does anyone know of a free web host, that
supports php, gd, or someone that can open an account for about half an hour
or so, for me to test out my script, to see if it is my OS that is causing
these problem
   - James ReDucTor Mitchell


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

2001-09-26 Thread Richard Baskett

Ok i've gone through the archives.. and you know.. I don't think anybody
really understands this function.  I hope I am wrong, but here goes.

I have an array called let's say.. $results
first dimension are just numbers
and the second has associative names [name],[title],[descript],[keycount] so
basically

$result[0][name]
$result[0][title]
$result[0][descript]
$result[0][keycount]

The first dimension goes up to hmm.. in the three digits and each has the
four other categories,  I want to sort $result by [keycount] which are all
numbers.

How the umm.. heck do you use that funky array_multisort function?

Rick


-- 
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] showing wrong php version after install

2001-09-26 Thread Caleb Carvalho

hi all,

just finished installing php-4.0.6, now when writing the test.php page with 
the ?phpinfo();?

i am still getting the PHP Version 4.0.4pl1 that was installed with my linux 
7.1 distro !!!

any help?


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] connect to sybase

2001-09-26 Thread Krzysztof Kocjan

Can You describe more detail ??? What kind, version of Sybase server do
You use, what version of PHP, what Linux distribution etc... In other
case I can't help You.

Krzysztof Kocjan

Edney Marcel Imm wrote:

 Hi

 How I can connect to syBase?

 Tks


--
Sprawdz, jak fantazja staje siê rzeczywistoscia...
 http://final-fantasy.interia.pl/



-- 
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] where can i get a sample php scripts to get data from pubs2 in sybase?

2001-09-26 Thread Caleb Carvalho

hi all,

i've managed to setup php-4.0.6 sucessfully with sybase, apache :)

does any1 know where to get a sample script that will initially get the 
pubs2 data from sybase?



Caleb Carvalho
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] Feature?

2001-09-26 Thread php

On Tue, 25 Sep 2001 09:36:57 -0500, you wrote:

 ?php
 function foo($p) {  echo  $p['fred'] . $p['banana']; }
 foo(array('fred' = 'hello', 'banana' = 'world'));
 ?

 Yeap, I know that. I thought about this bit of hack but this breaks the 
 conception on giving parameters. Also this trick cannot
 solve the problem with default parameters. If I have function with 5 
 params and all of them have default values and I want to pass
 value only to the second parameter what I have to do?

Maybe this? A bit verbose, but functional.
?php
function foo($p)
{
   if (empty($p['fred']))
 $p['fred'] = 'hello'; // same for banana
   echo  $p['fred'] . $p['banana'];
}
foo(array('fred' = 'hello', 'banana' = 'world'));
?
steve

I'm not keen on adding lots of multi-line if statements - I prefer tp
put things into arrays where I can.  Easier to update them.

?php
function foo($p)
{
$foodefault = array(// prefix matching the name in 'extract'
'foo_fred'= 'strongdefault fred/strong',
'foo_banana' = 'strongdefault bananananana/strong',
);
extract ($p, EXTR_PREFIX_ALL, 'foo');   // get params
extract ($foodefault, EXTR_SKIP, foo);// get defaults
echo  $foo_fred / $foo_banana;
}
echo Both in place: ;
foo(array('fred' = 'hello', 'banana' = 'world'));
echo br / Now with a missing param: ;
foo(array('fred' = 'hello'));
echo br / Now both missing params: ;
foo(array());
?

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




Fw: [PHP] Feature?

2001-09-26 Thread Andrey Hristov

 Let this be last message in the thread. Thanks for the examples! I'll wait for PHP5. 
There is a possibility that this feature will
be in.

 Have fun

 Andrey Hristov
 IcyGEN Corporation
 http://www.icygen.com
 BALANCED SOLUTIONS

 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, September 26, 2001 2:42 PM
 Subject: Re: [PHP] Feature?


  On Tue, 25 Sep 2001 09:36:57 -0500, you wrote:
 
   ?php
   function foo($p) { echo  $p['fred'] . $p['banana']; }
   foo(array('fred' = 'hello', 'banana' = 'world'));
   ?
 
   Yeap, I know that. I thought about this bit of hack but this breaks the
   conception on giving parameters. Also this trick cannot
   solve the problem with default parameters. If I have function with 5
   params and all of them have default values and I want to pass
   value only to the second parameter what I have to do?
 
  Maybe this? A bit verbose, but functional.
  ?php
  function foo($p)
  {
 if (empty($p['fred']))
   $p['fred'] = 'hello'; // same for banana
 echo  $p['fred'] . $p['banana'];
  }
  foo(array('fred' = 'hello', 'banana' = 'world'));
  ?
  steve
 
  I'm not keen on adding lots of multi-line if statements - I prefer tp
  put things into arrays where I can.  Easier to update them.
 
  ?php
  function foo($p)
  {
  $foodefault = array( // prefix matching the name in 'extract'
  'foo_fred'= 'strongdefault fred/strong',
  'foo_banana' = 'strongdefault bananananana/strong',
  );
  extract ($p, EXTR_PREFIX_ALL, 'foo'); // get params
  extract ($foodefault, EXTR_SKIP, foo); // get defaults
  echo  $foo_fred / $foo_banana;
  }
  echo Both in place: ;
  foo(array('fred' = 'hello', 'banana' = 'world'));
  echo br / Now with a missing param: ;
  foo(array('fred' = 'hello'));
  echo br / Now both missing params: ;
  foo(array());
  ?
 
  --
  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] Feature?

2001-09-26 Thread Alister

Follow up to my own message:

If you want to also skip even needing the empty 'array()' (new fianl
example) - check if it is an array, and only do the first extract of
the parameters if there's something there.

?php
function foo($p='')
{
$foodefault = array(
'foo_fred'= 'strongdefault fred/strong',
'foo_banana' = 'strongdefault bananananana/strong',
);
if (is_array($p))
extract ($p, EXTR_PREFIX_ALL, 'foo');   // get values
extract ($foodefault, EXTR_SKIP, foo);// get defaults
echo  $foo_fred / $foo_banana;
}

echo Both in place: ;
foo(array('fred' = 'hello', 'banana' = 'world'));
echo br / Now with a missing param: ;
foo(array('fred' = 'hello'));
echo br / Now both missing params: ;
foo(array());
echo br / and with no array: ;
foo();
?

-- 
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: Socket help

2001-09-26 Thread Stefano Baronio

Chris Lee wrote:
 your server has to open a connection to a remote
 host to see if there are
 messages ? like email ?

 yes. It is a sort of ftp-like protocol.

 if this is so then use
 cron once every so often to
 check if there are new messages.

I'll receive/send a lot of messages and this solution could
not be efficient. But it is a possible way to do that,
thanks, I didn't thought at it.

 if the remote
 host makes a connection to
 your server the use tcp_wrappers to call your php script.

It's my server that make the connection.

 the second script can NOT use the first apps
 socket, sockets arent shared
 like that.

Could I set up a script that handle the connection and take
the message data from another script (launched by a html
form )?

 yes, sending and recienveing should be ok, any
 data backed up will just be
 stored in buffers.
ok thanks
 --

   Chris Lee
   [EMAIL PROTECTED]

Thanks for your help.

Stefano Baronio


-- 
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] header() confusion

2001-09-26 Thread pierre-yves

Hello,
several months ago I discovered that under some IE 4.0 and upgrades of 4.0 the 
header() function would simply not redirect if 
you don't put exit() right after the header() call.  Now I'm discovering that header() 
does not work under netscape 6 if you put 
exit() right after!

How come this function is so dependant of the client? How can I avoid all this mess? 
Has anyone experience this?

py



Re: [PHP] header() confusion

2001-09-26 Thread * RzE:

Original message
From: pierre-yves [EMAIL PROTECTED]
Date: Wed, Sep 26, 2001 at 08:41:24AM -0400
Message-ID: 007301c14688$8d9b0d10$0100a8c0@py
Subject: [PHP] header() confusion

 Hello,
 several months ago I discovered that under some IE 4.0 and upgrades of 4.0 the 
header() function would simply not redirect if 
 you don't put exit() right after the header() call.  Now I'm discovering that 
header() does not work under netscape 6 if you put 
 exit() right after!
 
 How come this function is so dependant of the client? How can I avoid all this mess? 
Has anyone experience this?
 
 py

/Original message

Reply

It's not dependent on the client. The script just simply doesn't
stop after header(). It's just a bit strange that it worked with
some other browsers. Everything after header() will just be executed
until:

- an error occurs
- the script reaches the end
- exit;

So... when redirecting the user to a different page, you should
always put exit after the header() call.

/Reply

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
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] sending multiple variables to external PERL script for results

2001-09-26 Thread Dave VanAuken

Problem;

call external perl script with variables as arguments when variables may have
spaces or other restricted characters.

Details;

script needs to process $name $phone $creditcard (as examples)

normally this would easily be solved passing the command as
$command=myscript.pl $name $phone $ccnum;
$results=passthru($command);
and parsing out the argv's in the perl script

however, this breaks if $name happens to have a space in it (or other restricted
or special characters like ' \ ; and so forth) since it creates an additional
arg (or error)
 myscript.pl Joe Schmoe 555-1212 1234123412341234 = 4 arguments passed not 3

This particular application is restricted to using preexisting perl libraries
and modules, or we would simply recode the entire process in PHP in integrate it
more solidly into the solution.

perhaps result of being up all night...  can't wrap my head around it.

Dave


-- 
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] display query results at random

2001-09-26 Thread Steve Werby

Matthew Delmarter [EMAIL PROTECTED] wrote:
 How do I return a specific record from a db outside of the query?

 Let's say I select * from table (using mysql_fetch_object) and get 5
 results. I want to display the 5 results in different / random places
 on the page.

 Place 1 - show details for record 3
 Place 2 - show details for record 1
 Place 5 - show details for record 5

 How do I do this?

Someone mentioned saving to an array.  That's the way to go, but I'm not
sure if the reply was clear.

$i = 1;
while ( $qd= mysql_fetch_object( $rs ) )
{
if ( $i == 1 ) { $var1 = $qd-my_field; }
else if ( $i == 2 ) { $var2 = $qd-my_field; }
...
else if ( $i == 5 ) { $var5 = $qd-my_field; }
}

Then use $var1, $var2, ..., $var5 where needed after the loop finishes.  I
may be misunderstanding, so if you really want your query to return 5
records, but want to randomly pick a record for each of 5 random spots on
your page then do this:

$i = 1;
while ( $qd= mysql_fetch_object( $rs ) )
{
$var[] = $qd-my_field;
$i++;
}

Then use array_rand() inside a loop to pull from $var[], removing each
element after it's selected (more efficient) or adding code to ensure the
same element isn't picked twice (less efficient).

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.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] ftp_get giving problem

2001-09-26 Thread root

Hi,

In my php program I am trying to download a file from server. My web
server and file downloading server is diffrent. When use ftp_get command
it is giving the result true. But the file is not there in client
system. Please help me.

anil
[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]session and frames: please HELP!!!!!

2001-09-26 Thread Michael . Thanry


Hello everyone!

I've a quick question I've been working on for a few days, look into the
archive of the mailing-list but found nothing relevant:

How to forward a session variable such as a password to a page containing
frames?
I tried something like frame src=menu.php?? echo session_name().
=.session_id(); ? but it didn't seem to work.

Any idea or suggestion?

Regards,

Michael Thanry


-- 
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: problem with arrays. Please Help!!

2001-09-26 Thread ewunia

Hello,
But can you be more specific what I need to do with this function?
How to use it in the context?

Thanks
Pedja [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 function array_search ($needle, $haystack, $strict = FALSE)


 foreach (array_keys($haystack) as $key)


 if ($strict)

 if ($haystack[$key] === $needle) return $key;
 }
 else

 if ($haystack[$key] == $needle) return $key;
 }
 }
 return FALSE;
 }


 Ewunia [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello,
 
  I need some help with checkboxes and multiple arrays,
 
  Here is the peace of code I am working with, and it gives me a list of
  products.
 
  This is the while statement which grabs information from the database:
  $tplv .= TR BGCOLOR=\$bgColor\ class=\medium\ align=\center\;
  $P.=input type=\checkbox\ name=\select[]\ value=\$id\
size=\3\;
  if($id == $select[$auctions_count])
$P .=  CHECKED;
  $P .= ;
 
  $tplv .= TD width=\5%\$P/td;
  $tplv .= TD width=\15%\input type=\hidden\ name=\id[]\
  value=\$q[id]\. $actual./TD;
  $tplv .= TD width=\15%\input type=\hidden\ name=\price[]\
  value=\$q[price]\. $actual./TD;
  $tplv .= TD width=\15%\input type=\text\ name=\shipping[]\
  value=\\ size=\10\;
  $tplv .= TD width=\10%\input type=\hidden\ name=\status[]\
  value=\$q[status]\$stat1/TD;
  $tplv .= /TR;
 
  and creates someing like this
  checkboxesidpriceshippingstatus
  11 4.99 1.99 0
  245.99   2.990
 
  As you can see I have 5 arrays. one is select /checkbox, id, price,
shipping
  and status.
  What I am trying to do is search through the array of checkboxes and if
the
  checkbox is checked I want the information in arrays id, price,
shipping,
  status be added to the database.
 
  Ale there need to be a check if the status[] == 0;
  then add the information to a table.
  Can anyone help me to resolve the problem.
 
  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] Building Dynamic Value list using ohp

2001-09-26 Thread George Pitcher

Hi all,

I'm having a problem with dynamically building a value list.

My code:

?php
mysql_connect ('localhost', 'root', 'monty');
mysql_select_db ('Heronsql');
   $query = (select HEI from heronuser); // LINE 22 on original script
   $result = mysql_query($query, $mysql_link);
 if(mysql_num_rows($result)) {
   // show all HEIs as options in select form
   while($row = mysql_fetch_row($result))
   {
  print(option value=\$row[0]\$row[0]/option);
   }
 }
?

But this generates:

Parse error:  parse error in c:\program files\apache
group\apache\htdocs\bizflyers\login.php on line 22

Any suggestions?

Regards

George


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




Re: [PHP] select based on time/date

2001-09-26 Thread Sheridan Saint-Michel

The reason my query didn't work is you have time_in as a varchar.
Change it to a datetime field or timestamp field and it should work.

I would suggest making it a timestamp field.  That way whenever
you update the row (probably update the session field with a new
session) MySQL will automatically set time_in to Now().  This will
avoid a lot of headache for you  =)

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


- Original Message -
From: Jason Dulberg [EMAIL PROTECTED]
To: Sheridan Saint-Michel [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, September 25, 2001 5:08 PM
Subject: RE: [PHP] select based on time/date


 I tried basically what you have but I got an error:

 $sql=select * from logged_in where time_in + interval 1 hour = now();
 $result = mysql_query($sql);

 If it will help, here's the table structure -- looks like my structure is
 bit different from what I orignally posted:

 CREATE TABLE logged_in (
id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
session varchar(100) DEFAULT '0' NOT NULL,
time_in varchar(50) NOT NULL,
KEY id (id)
 );

 Thanks again.

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


  The problem with this is curtime returns a number in HHMMSS
  format and your
  extract
  returns MM so you get HHMMSS - MM which is always going to be greater
than
  60
  unless you are running your script in the first minute of the day (ie
  37 - 49).
 
  Try this instead:
 
  select * from sessions where $timein + interval 1 hour = now();

 - Original Message -
 From: Jason Dulberg [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, September 25, 2001 2:35 PM
 Subject: RE: [PHP] select based on time/date

   I had a look at the DATE_FORMAT info on the mysql doc page and its a
bit
   easier to understand than the CONCATS.
  
   Would I want to use the CURTIME() function since I would want to
select
   sessions based on the hour? How would I go about combining CURTIME
with
  the
   rest of my query?
  
   Theoretically, here is what I understand, please let me know whether
or
  not
   I am correct:
  
   select * from sessions where (CURTIME() - EXTRACT(MINUTE FROM
  $timein) =
   60);
   //where 60 is the lifespan of the session


-- 
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] select based on time/date

2001-09-26 Thread Sheridan Saint-Michel

date_add(time_in,interval 1 hour)
is the same as
time_in + interval 1 hour
as of MySQL 3.23 so unless you are using 3.22 you should get the
same result (anything prior to 3.22 won't support date_add)

Neither query is going to work, however, because time_in is a varchar
rather than one of the date types.

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


- Original Message -
From: Jason Dulberg [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, September 25, 2001 6:24 PM
Subject: RE: [PHP] select based on time/date


 I plugged your query in and it didn't result in an error - however, it
came
 up with no results even though there should be.

 This one should have come up but didn't:
 INSERT INTO logged_in VALUES ( '5', 'b406e68a7cde49534a14f5fd8848006e',
 'September 24, 2001, 3:27 pm', '');
 -- the fields correspond to the table structure quoted below

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


  -Original Message-
  From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
  Sent: September 25, 2001 7:07 PM
  To: 'Jason Dulberg'; 'Sheridan Saint-Michel'; [EMAIL PROTECTED]
  Subject: RE: [PHP] select based on time/date
 
 
  select * from logged_in where date_add(time_in,interval 1 hour) = now()
 
  -jack
 
  -Original Message-
  From: Jason Dulberg [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, September 25, 2001 6:08 PM
  To: Sheridan Saint-Michel; [EMAIL PROTECTED]
  Subject: RE: [PHP] select based on time/date
 
  I tried basically what you have but I got an error:
 
  $sql=select * from logged_in where time_in + interval 1 hour = now();
  $result = mysql_query($sql);
 
  If it will help, here's the table structure -- looks like my structure
  is
  bit different from what I orignally posted:
 
  CREATE TABLE logged_in (
 id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
 session varchar(100) DEFAULT '0' NOT NULL,
 time_in varchar(50) NOT NULL,
 KEY id (id)
  );


 --
 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] header() confusion

2001-09-26 Thread pierre-yves

 So... when redirecting the user to a different page, you should
 always put exit after the header() call.

Yes that's what I do but it freeze on netscape 6 ?
Does anyone has experience this or am I the only one ?

py


-- 
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] Building Dynamic Value list using ohp

2001-09-26 Thread George Pitcher

Thanks Gottfried, but that doesn't change the response I get.

Any more suggestions.

George P in Edinburgh

PS I am hoping to come over to Frankfurt for the conference in November
(boss might pay)

- Original Message -
From: [EMAIL PROTECTED]
To: George Pitcher [EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 2:46 PM
Subject: Re: [PHP] Building Dynamic Value list using ohp


 hi!

 try:

 $query = select HEI from heronuser; // line 22

 greetinx!
 gottfried

  Hi all,
 
  I'm having a problem with dynamically building a value list.
 
  My code:
 
  ?php
  mysql_connect ('localhost', 'root', 'monty');
  mysql_select_db ('Heronsql');
 $query = (select HEI from heronuser); // LINE 22 on original script
 $result = mysql_query($query, $mysql_link);
   if(mysql_num_rows($result)) {
 // show all HEIs as options in select form
 while($row = mysql_fetch_row($result))
 {
print(option value=\$row[0]\$row[0]/option);
 }
   }
  ?
 
  But this generates:
 
  Parse error:  parse error in c:\program files\apache
  group\apache\htdocs\bizflyers\login.php on line 22
 
  Any suggestions?
 
  Regards
 
  George
 
 
  _
  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]
 

 --
 GMX - Die Kommunikationsplattform im Internet.
 http://www.gmx.net


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




Re: [PHP] header() confusion

2001-09-26 Thread * RzE:

 Yes that's what I do but it freeze on netscape 6 ?

FAFAIK the client's browser can't influence the header() call in
your script. Are you sure there aren't any errors somewhere else. Eg
before the header() call or at the start of the page where you
redirect the user to?

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
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] header() confusion

2001-09-26 Thread Boget, Chris

  Yes that's what I do but it freeze on netscape 6 ?
 FAFAIK the client's browser can't influence the header() call in
 your script. Are you sure there aren't any errors somewhere else. Eg
 before the header() call or at the start of the page where you
 redirect the user to?

Indeed.  A good way to tell if this might be the case is to view the
source of the page you get stuck at.

Chris



Re: [PHP] header() confusion

2001-09-26 Thread * RzE:

   Yes that's what I do but it freeze on netscape 6 ?
  FAFAIK the client's browser can't influence the header() call in
  your script. Are you sure there aren't any errors somewhere else. Eg
  before the header() call or at the start of the page where you
  redirect the user to?
 
 Indeed.  A good way to tell if this might be the case is to view the
 source of the page you get stuck at.

Yep! Or set the error-reporting-level to eg 2047 and check the 
logfile(s).

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
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] Building Dynamic Value list using ohp

2001-09-26 Thread Derek Mailer

A couple of things about the code...

1) -

mysql_connect ('localhost', 'root', 'monty');

should be

$mysql_link = mysql_connect ('localhost', 'root', 'monty');

2) -


You only pass

you can read more about it all and copy and adapt the code snippter from

http://www.php.net/manual/en/ref.mysql.php

- Original Message -
From: George Pitcher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 2:54 PM
Subject: Re: [PHP] Building Dynamic Value list using ohp


 Thanks Gottfried, but that doesn't change the response I get.

 Any more suggestions.

 George P in Edinburgh

 PS I am hoping to come over to Frankfurt for the conference in November
 (boss might pay)

 - Original Message -
 From: [EMAIL PROTECTED]
 To: George Pitcher [EMAIL PROTECTED]
 Sent: Wednesday, September 26, 2001 2:46 PM
 Subject: Re: [PHP] Building Dynamic Value list using ohp


  hi!
 
  try:
 
  $query = select HEI from heronuser; // line 22
 
  greetinx!
  gottfried
 
   Hi all,
  
   I'm having a problem with dynamically building a value list.
  
   My code:
  
   ?php
   mysql_connect ('localhost', 'root', 'monty');
   mysql_select_db ('Heronsql');
  $query = (select HEI from heronuser); // LINE 22 on original
script
  $result = mysql_query($query, $mysql_link);
if(mysql_num_rows($result)) {
  // show all HEIs as options in select form
  while($row = mysql_fetch_row($result))
  {
 print(option value=\$row[0]\$row[0]/option);
  }
}
   ?
  
   But this generates:
  
   Parse error:  parse error in c:\program files\apache
   group\apache\htdocs\bizflyers\login.php on line 22
  
   Any suggestions?
  
   Regards
  
   George
  
  
   _
   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]
  
 
  --
  GMX - Die Kommunikationsplattform im Internet.
  http://www.gmx.net


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




**
This e-mail (and any attachment) is intended only for the attention
of the addressee(s). Its unauthorised use, disclosure, storage
or copying is not permitted. If you are not the intended recipient,
please destroy all copies and inform the sender by return e-mail. 
This e-mail (whether you are the sender or the recipient) may be 
monitored, recorded and retained by Business Information 
Publications Limited (BiP). E-mail monitoring/ blocking software 
may be used, and e-mail content may be read at any time.You 
have a responsibility to ensure laws are not broken when composing 
or forwarding e-mails and their contents.
**


-- 
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] Building Dynamic Value list using ohp

2001-09-26 Thread Derek Mailer

oops...I was going to add...

2) -

$result = mysql_query($query, $mysql_link);

doesn't require the $mysql_link argument, try

$result = mysql_query($query);

Another general comment is that you have copied a bit of your code that
seems to include the root password to mysql.  Not a good idea - you should
check and edit your code if necessary before posting.

Hope this helps - good luck

Derek

- Original Message -
From: George Pitcher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 2:54 PM
Subject: Re: [PHP] Building Dynamic Value list using ohp


 Thanks Gottfried, but that doesn't change the response I get.

 Any more suggestions.

 George P in Edinburgh

 PS I am hoping to come over to Frankfurt for the conference in November
 (boss might pay)

 - Original Message -
 From: [EMAIL PROTECTED]
 To: George Pitcher [EMAIL PROTECTED]
 Sent: Wednesday, September 26, 2001 2:46 PM
 Subject: Re: [PHP] Building Dynamic Value list using ohp


  hi!
 
  try:
 
  $query = select HEI from heronuser; // line 22
 
  greetinx!
  gottfried
 
   Hi all,
  
   I'm having a problem with dynamically building a value list.
  
   My code:
  
   ?php
   mysql_connect ('localhost', 'root', 'monty');
   mysql_select_db ('Heronsql');
  $query = (select HEI from heronuser); // LINE 22 on original
script
  $result = mysql_query($query, $mysql_link);
if(mysql_num_rows($result)) {
  // show all HEIs as options in select form
  while($row = mysql_fetch_row($result))
  {
 print(option value=\$row[0]\$row[0]/option);
  }
}
   ?
  
   But this generates:
  
   Parse error:  parse error in c:\program files\apache
   group\apache\htdocs\bizflyers\login.php on line 22
  
   Any suggestions?
  
   Regards
  
   George
  
  
   _
   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]
  
 
  --
  GMX - Die Kommunikationsplattform im Internet.
  http://www.gmx.net


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




**
This e-mail (and any attachment) is intended only for the attention
of the addressee(s). Its unauthorised use, disclosure, storage
or copying is not permitted. If you are not the intended recipient,
please destroy all copies and inform the sender by return e-mail. 
This e-mail (whether you are the sender or the recipient) may be 
monitored, recorded and retained by Business Information 
Publications Limited (BiP). E-mail monitoring/ blocking software 
may be used, and e-mail content may be read at any time.You 
have a responsibility to ensure laws are not broken when composing 
or forwarding e-mails and their contents.
**


-- 
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 // eregi question

2001-09-26 Thread Brian V Bonini

From the PHP manual:

http://www.php.net/manual/en/features.remote-files.php

Example 20-1. Getting the title of a remote page

?php
$file = fopen (http://www.php.net/;, r);
if (!$file) {
echo pUnable to open remote file.\n;
exit;
}
while (!feof ($file)) {
$line = fgets ($file, 1024);
/* This only works if the title and its tags are on one line */
if (eregi (title(.*)/title, $line, $out)) {
$title = $out[1];
break;
}
}
fclose($file);
?

How would you make this work if the tags and content
spanned several lines?


 

-- 
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] Building Dynamic Value list using ohp

2001-09-26 Thread Maxim Maletsky \(PHPBeginner.com\)


1. this:
print(option value=\$row[0]\$row[0]/option);
 should be this:
print(option value=\{$row[0]}\{$row[0]}/option);
 or like this:
echo 'option value='.$row[0].''.$row[0].'/option');

The reason for it is that within double quote you can parse for 'simple'
variables only (es: $var, not $var[]). Otherwise it gives you a parse
error.

2. this: 
mysql_connect ('localhost', 'root', 'monty');
 better be this: 
mysql_connect ('localhost', '', ''); // for security
reasons obviously, you don't wanna give the password our to the group,
even so it is your local server (you might not be original with the
password on production machines, no?)


Hope it helps,
Maxim Maletsky

PHPBeginner.com




-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED]] 
Sent: mercoledì 26 settembre 2001 15.31
To: [EMAIL PROTECTED]
Subject: [PHP] Building Dynamic Value list using ohp


Hi all,

I'm having a problem with dynamically building a value list.

My code:

?php
mysql_connect ('localhost', 'root', 'monty');
mysql_select_db ('Heronsql');
   $query = (select HEI from heronuser); // LINE 22 on original script
   $result = mysql_query($query, $mysql_link);
 if(mysql_num_rows($result)) {
   // show all HEIs as options in select form
   while($row = mysql_fetch_row($result))
   {
  print(option value=\$row[0]\$row[0]/option);
   }
 }
?

But this generates:

Parse error:  parse error in c:\program files\apache
group\apache\htdocs\bizflyers\login.php on line 22

Any suggestions?

Regards

George



_

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 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 can I fetch a table from html file using php?

2001-09-26 Thread Sheridan Saint-Michel

You just need a simple Regex.  This should do it

?php
$fp = fopen(http://demo.ina-finland.fi/sample.html,r;);
$buffer = fread ($fp, 100);

preg_match(|Table[^]*ruudukko[^]*.+/Table|is, $buffer, $regs );
  $table = $regs[0];
  echo $table;
?

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


- Original Message -
From: Sami Kyösti [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 4:25 AM
Subject: [PHP] How can I fetch a table from html file using php?


 I have a sample file in http://demo.ina-finland.fi/sample.html and
 there's a table which is named ruudukko.

 How can a just get that table in to my other html file using php?

 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 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] Getting the file size, wtihout download... is this possible ?

2001-09-26 Thread Marian Vasile

It is possible to get the filesize for couple files on other server, without
downloading ?

Probably this will be not fully resolved, but is there any way ?

Thanx,
M



-- 
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] Globals and HTTP_SESSION_VARS variables.

2001-09-26 Thread Johnson, Kirk

 Is here anyway to make a variable like $var not the same than
 $HTTP_SESSION_VARS[var], when register_globals=1?. (where 
 $var is in the
 script scope).
 
 I read in a changelog that this is relatively recent (make 
 $var the same
 than $HTTP_SESSION_VARS[var]).

I'm not sure what was changed. As far as I can see, the global version of
$test and $HTTP_SESSION_VARS[test] still reference different memory
locations, and they are not the same variable, *while on the current page*.
However, if register_globals is on, then the global version gets saved to
the session file, and will be in the $HTTP_SESSION_VARS array on the next
page.

?
session_start();
$test=globalversion;
session_register(test);
$HTTP_SESSION_VARS[test] = arrayversion;
echo global version of test = $testbr;
echo sess array version of test = .$HTTP_SESSION_VARS[test].br;
?

Kirk

-- 
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] Site Hosting

2001-09-26 Thread Darren Henderson

On Fri, 21 Sep 2001, vishal khialani wrote:

 Hi,
   I am searching companies who will host my site. Presently I am looking out 
 for php, mysql and ssl support. So does anyone know a good company ?
 Vishal

Something to consider... perhaps supporting those companies that support PHP
might be a good idea, take a look at www.php.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] search engine submission

2001-09-26 Thread Marian Vasile

All you need to learn, about submission is just forms (post get) and some
javascript, to simulate perfectly like user is typing the info.
Youca use two frames for that and it's really easy... :)

Yours
Marian

Krushna Kumar R [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I have a website which i would like to submit to the search engines
 frequently, so i thought i could write a program for this, not depending
on
 other free web sites  for submission

 Rgds
 Krushna Kumar

 - Original Message -
 From: Jon Haworth [EMAIL PROTECTED]
 To: 'Krushna Kumar R' [EMAIL PROTECTED];
[EMAIL PROTECTED]
 Sent: Monday, September 24, 2001 7:36 PM
 Subject: RE: [PHP] search engine submission


  You can find this code all over the web, an example of it can be seen at
  most search engines on the Add a URL page :-)
 
  What are you trying to do?
 
  Cheers
  Jon
 
 
  -Original Message-
  From: Krushna Kumar R [mailto:[EMAIL PROTECTED]]
  Sent: 24 September 2001 15:08
  To: [EMAIL PROTECTED]
  Subject: [PHP] search engine submission
 
 
  Hi,
 
  Can someone help me by where i could get some free code for search
engine
  submission
 
  Regards
  Krushna Kumar
 
 
  **
  'The information included in this Email is of a confidential nature and
is
  intended only for the addressee. If you are not the intended addressee,
  any disclosure, copying or distribution by you is prohibited and may be
  unlawful. Disclosure to any party other than the addressee, whether
  inadvertent or otherwise is not intended to waive privilege or
 confidentiality'
 
  **
 
  --
  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] 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, at 10:30  AM, [EMAIL PROTECTED]
 wrote:


 Just had a look at manual, ifnull() seems close to useless.  However 
 if
 they had NVL(), as Oracle douse

 NVL( column|litrel, '*null*' )

 This takes a column or literal as its first arg and if arg is null
 returns
 2nd arg otherwise returns arg.  In other words if the column is null 
 it
 is
 replaces by arg2 otherwise it is simply returned.


 Um, that's what ifnull() does. At least it works for me.

 -Steve

 Verry true, sorry, was looking at nullif.  Also noticed the if function,
 can this have more than three parameters.  i.e

 if ( col, 'A', 'Accept', 'C', 'Complete', 'Unknown' )

 like Oracle decode. and if elseif else structure.

 Neb


Looks like you want the CASE statement. I haven't used it but it looks 
pretty much like what you're asking.

CASE value WHEN [compare-value] THEN result [WHEN [compare-value] THEN 
result ...] [ELSE result] END

Guess this discussion should really be on php-db :)

-Steve

-- 
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: sending multiple variables to external PERL script for results

2001-09-26 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Dave Vanauken) wrote:

 normally this would easily be solved passing the command as
   $command=myscript.pl $name $phone $ccnum;
   $results=passthru($command);
 and parsing out the argv's in the perl script
 
 however, this breaks if $name happens to have a space in it (or other 
 restricted
 or special characters like ' \ ; and so forth) 

Check out http://www.php.net/manual/en/function.escapeshellarg.php and 
http://www.php.net/manual/en/function.escapeshellcmd.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] Getting the file size, wtihout download... is this possible ?

2001-09-26 Thread Maxim Maletsky \(PHPBeginner.com\)


AFAIAC,
The only function that gets you image size is GetImageSize() which you
claimed cannot do remote check. Therefore, I do not think you can manage
this without downloading/copying the file to your server.


Maxim Maletsky
www.PHPBeginner.com


-Original Message-
From: Marian Vasile [mailto:[EMAIL PROTECTED]] 
Sent: mercoledì 26 settembre 2001 16.14
To: [EMAIL PROTECTED]
Subject: [PHP] Getting the file size, wtihout download... is this
possible ?


It is possible to get the filesize for couple files on other server,
without downloading ?

Probably this will be not fully resolved, but is there any way ?

Thanx,
M



-- 
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 and frames: please HELP!!!!!

2001-09-26 Thread Marian Vasile

You can't send from outside, something that is INSIDE... I mean a session
variable.

If that could be done than probably I will seriously have security problems.

Now what you've written it's correct in my opinion and it should work.
What are you trying to do exactly? to save a session variable, or the
current session name ?

I think this is the problem you got it wrong.
The best way for you, to forward a password (because this was the example
you said) is to do like this:

in the current file you'll have:
session_start(); session_register(session_password);
session_register(session_value);
$password=session_password; $value=session_value;
then
frame src=menu.php?? echo session_name().=.session_id(); ?

and in the menu.php you need to have that:
session_start();

(to start the sessions and create the sessions variable... :)

Yours,
M

Michael Thanry [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hello everyone!

 I've a quick question I've been working on for a few days, look into the
 archive of the mailing-list but found nothing relevant:

 How to forward a session variable such as a password to a page containing
 frames?
 I tried something like frame src=menu.php?? echo session_name().
 =.session_id(); ? but it didn't seem to work.

 Any idea or suggestion?

 Regards,

 Michael Thanry




-- 
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] Building Dynamic Value list using ohp

2001-09-26 Thread George Pitcher

Thanks for everyone's help but this is still failing to work.

Revised code is:

?php
$link = mysql_connect ('localhost', '', '')
   or die (Could not select db);
mysql_select_db ('Heronsql')
   or die (Could not connect);
$query=select distinct HEI from heronuser;
   $result = mysql_query ($query); // I've also tried with ($query, $link)
 if(mysql_num_rows($result)) {
   // show all HEIs as options in select form
   while($row = mysql_fetch_row($result))
   {
  print(option value=\{$row[0]}\{$row[0]}/option);
   }
 }
mysql_close($link);
?

Any more suggestions (please)?

George
- Original Message -
From: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED]
To: 'George Pitcher' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 3:17 PM
Subject: RE: [PHP] Building Dynamic Value list using ohp



1. this:
print(option value=\$row[0]\$row[0]/option);
 should be this:
print(option value=\{$row[0]}\{$row[0]}/option);
 or like this:
echo 'option value='.$row[0].''.$row[0].'/option');

The reason for it is that within double quote you can parse for 'simple'
variables only (es: $var, not $var[]). Otherwise it gives you a parse
error.

2. this:
mysql_connect ('localhost', 'root', 'monty');
 better be this:
mysql_connect ('localhost', '', ''); // for security
reasons obviously, you don't wanna give the password our to the group,
even so it is your local server (you might not be original with the
password on production machines, no?)


Hope it helps,
Maxim Maletsky

PHPBeginner.com




-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED]]
Sent: mercoledì 26 settembre 2001 15.31
To: [EMAIL PROTECTED]
Subject: [PHP] Building Dynamic Value list using ohp


Hi all,

I'm having a problem with dynamically building a value list.

My code:

?php
mysql_connect ('localhost', 'root', 'monty');
mysql_select_db ('Heronsql');
   $query = (select HEI from heronuser); // LINE 22 on original script
   $result = mysql_query($query, $mysql_link);
 if(mysql_num_rows($result)) {
   // show all HEIs as options in select form
   while($row = mysql_fetch_row($result))
   {
  print(option value=\$row[0]\$row[0]/option);
   }
 }
?

But this generates:

Parse error:  parse error in c:\program files\apache
group\apache\htdocs\bizflyers\login.php on line 22

Any suggestions?

Regards

George



_

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




Re: [PHP] fopen // eregi question

2001-09-26 Thread Sheridan Saint-Michel

If you use preg_match (PERL style Regex) instead of ereg
you can use the s match modifier which tells it to treat the
entire file as a single line... so your Regex would be

if (preg_match(|title(.*)/title|is, $line, $out)) {

(The i is case insensitive... since you were using eregi)

Hope that helps

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


- Original Message - 
From: Brian V Bonini [EMAIL PROTECTED]
To: PHP Lists [EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 9:21 AM
Subject: [PHP] fopen // eregi question


 From the PHP manual:
 
 http://www.php.net/manual/en/features.remote-files.php
 
 Example 20-1. Getting the title of a remote page
 
 ?php
 $file = fopen (http://www.php.net/;, r);
 if (!$file) {
 echo pUnable to open remote file.\n;
 exit;
 }
 while (!feof ($file)) {
 $line = fgets ($file, 1024);
 /* This only works if the title and its tags are on one line */
 if (eregi (title(.*)/title, $line, $out)) {
 $title = $out[1];
 break;
 }
 }
 fclose($file);
 ?
 
 How would you make this work if the tags and content
 spanned several lines?
 
 
  
 
 -- 
 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] 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 message:

 If you want to also skip even needing the empty 'array()' (new fianl
 example) - check if it is an array, and only do the first extract of
 the parameters if there's something there.

 ?php
 function foo($p='')
 {
   $foodefault = array(
   'foo_fred'= 'strongdefault fred/strong',
   'foo_banana' = 'strongdefault bananananana/strong',
   );
   if (is_array($p))
   extract ($p, EXTR_PREFIX_ALL, 'foo');   // get values
   extract ($foodefault, EXTR_SKIP, foo);// get defaults
   echo  $foo_fred / $foo_banana;
 }

 echo Both in place: ;
 foo(array('fred' = 'hello', 'banana' = 'world'));
 echo br / Now with a missing param: ;
 foo(array('fred' = 'hello'));
 echo br / Now both missing params: ;
 foo(array());
 echo br / and with no array: ;
 foo();
 ?

-- 
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] 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 = mysql_query($query);

 Another general comment is that you have copied a bit of your code that
 seems to include the root password to mysql.  Not a good idea - you 
 should
 check and edit your code if necessary before posting.

 Hope this helps - good luck

 Derek

 - Original Message -
 From: George Pitcher [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Wednesday, September 26, 2001 2:54 PM
 Subject: Re: [PHP] Building Dynamic Value list using ohp


 Thanks Gottfried, but that doesn't change the response I get.

 Any more suggestions.

 George P in Edinburgh

 PS I am hoping to come over to Frankfurt for the conference in November
 (boss might pay)

 - Original Message -
 From: [EMAIL PROTECTED]
 To: George Pitcher [EMAIL PROTECTED]
 Sent: Wednesday, September 26, 2001 2:46 PM
 Subject: Re: [PHP] Building Dynamic Value list using ohp


 hi!

 try:

 $query = select HEI from heronuser; // line 22

 greetinx!
 gottfried

 Hi all,

 I'm having a problem with dynamically building a value list.

 My code:

 ?php
 mysql_connect ('localhost', 'root', 'monty');
 mysql_select_db ('Heronsql');
$query = (select HEI from heronuser); // LINE 22 on original
 script
$result = mysql_query($query, $mysql_link);
  if(mysql_num_rows($result)) {
// show all HEIs as options in select form
while($row = mysql_fetch_row($result))
{
   print(option value=\$row[0]\$row[0]/option);
}
  }
 ?

 But this generates:

 Parse error:  parse error in c:\program files\apache
 group\apache\htdocs\bizflyers\login.php on line 22

 Any suggestions?

 Regards

 George


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


 --
 GMX - Die Kommunikationsplattform im Internet.
 http://www.gmx.net


 _
 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: php-list-
 [EMAIL PROTECTED]




 *
 *
 This e-mail (and any attachment) is intended only for the attention
 of the addressee(s). Its unauthorised use, disclosure, storage
 or copying is not permitted. If you are not the intended recipient,
 please destroy all copies and inform the sender by return e-mail.
 This e-mail (whether you are the sender or the recipient) may be
 monitored, recorded and retained by Business Information
 Publications Limited (BiP). E-mail monitoring/ blocking software
 may be used, and e-mail content may be read at any time.You
 have a responsibility to ensure laws are not broken when composing
 or forwarding e-mails and their contents.
 *
 *


 --
 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] Building Dynamic Value list using ohp

2001-09-26 Thread Sheridan Saint-Michel

- Original Message -
From: George Pitcher [EMAIL PROTECTED]
To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 9:42 AM
Subject: Re: [PHP] Building Dynamic Value list using ohp


 Thanks for everyone's help but this is still failing to work.

 Revised code is:

 ?php
 $link = mysql_connect ('localhost', '', '')
or die (Could not select db);
 mysql_select_db ('Heronsql')
or die (Could not connect);
 $query=select distinct HEI from heronuser;
$result = mysql_query ($query); // I've also tried with ($query, $link)
  if(mysql_num_rows($result)) {
// show all HEIs as options in select form
while($row = mysql_fetch_row($result))
{
   print(option value=\{$row[0]}\{$row[0]}/option);
}
  }
 mysql_close($link);
 ?

 Any more suggestions (please)?

 George

I don't see anything glaringly wrong with your code.
I would change this:

$result = mysql_query ($query)

into:

if( !($result = mysql_query ($query)) )
  echo Error:  . mysql_error() . BR;

as I find that most of my errors in something this simple
are in something fairly simple with the query itself (misspelled
table or something).

also make sure that if you copy your query and paste it directly
into MySQL that it works.

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.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] Building Dynamic Value list using ohp

2001-09-26 Thread Derek Mailer

what's the error you're getting now?

if you aren't getting any error, but it just isn't working try something
like...(note that I haven't tested this code).

 $drop_down_list = select name=\select\;

$link = mysql_connect ('localhost', '', '')
or die (Could not select db);
mysql_select_db ('Heronsql')
or die (Could not connect);
$query=select distinct HEI from heronuser;
$result = mysql_query ($query);
$num = mysql_num_rows($result);
for ($i = 0; $i  $num; $i++) {
$HEI = mysql_result($result, $i, HEI);
$drop_down_list .= option value=\$HEI\$HEI/option;
}
mysql_close($link);

$drop_down_list .= /select;

echo $drop_down_list;


Cheers the noo,

Derek

- Original Message -
From: George Pitcher [EMAIL PROTECTED]
To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 3:42 PM
Subject: Re: [PHP] Building Dynamic Value list using ohp


 Thanks for everyone's help but this is still failing to work.

 Revised code is:

 ?php
 $link = mysql_connect ('localhost', '', '')
or die (Could not select db);
 mysql_select_db ('Heronsql')
or die (Could not connect);
 $query=select distinct HEI from heronuser;
$result = mysql_query ($query); // I've also tried with ($query, $link)
  if(mysql_num_rows($result)) {
// show all HEIs as options in select form
while($row = mysql_fetch_row($result))
{
   print(option value=\{$row[0]}\{$row[0]}/option);
}
  }
 mysql_close($link);
 ?

 Any more suggestions (please)?

 George
 - Original Message -
 From: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED]
 To: 'George Pitcher' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Wednesday, September 26, 2001 3:17 PM
 Subject: RE: [PHP] Building Dynamic Value list using ohp



 1. this:
 print(option value=\$row[0]\$row[0]/option);
  should be this:
 print(option value=\{$row[0]}\{$row[0]}/option);
  or like this:
 echo 'option value='.$row[0].''.$row[0].'/option');

 The reason for it is that within double quote you can parse for 'simple'
 variables only (es: $var, not $var[]). Otherwise it gives you a parse
 error.

 2. this:
 mysql_connect ('localhost', 'root', 'monty');
  better be this:
 mysql_connect ('localhost', '', ''); // for security
 reasons obviously, you don't wanna give the password our to the group,
 even so it is your local server (you might not be original with the
 password on production machines, no?)


 Hope it helps,
 Maxim Maletsky

 PHPBeginner.com




 -Original Message-
 From: George Pitcher [mailto:[EMAIL PROTECTED]]
 Sent: mercoledì 26 settembre 2001 15.31
 To: [EMAIL PROTECTED]
 Subject: [PHP] Building Dynamic Value list using ohp


 Hi all,

 I'm having a problem with dynamically building a value list.

 My code:

 ?php
 mysql_connect ('localhost', 'root', 'monty');
 mysql_select_db ('Heronsql');
$query = (select HEI from heronuser); // LINE 22 on original script
$result = mysql_query($query, $mysql_link);
  if(mysql_num_rows($result)) {
// show all HEIs as options in select form
while($row = mysql_fetch_row($result))
{
   print(option value=\$row[0]\$row[0]/option);
}
  }
 ?

 But this generates:

 Parse error:  parse error in c:\program files\apache
 group\apache\htdocs\bizflyers\login.php on line 22

 Any suggestions?

 Regards

 George



 _

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




**
This e-mail (and any attachment) is intended only for the attention
of the addressee(s). Its unauthorised use, disclosure, storage
or copying is not permitted. If you are not the intended recipient,
please destroy all copies and inform the sender by return e-mail. 
This e-mail (whether you are the sender or the recipient) may be 
monitored, recorded and retained by Business Information 
Publications Limited (BiP). E-mail monitoring/ blocking software 
may be used, and e-mail content may be read at any time.You 
have a responsibility to ensure 

Re: [PHP] Building Dynamic Value list using ohp

2001-09-26 Thread George Pitcher

Sheridan,

I added the error stuff (adding an else bit) but when I went to my browser,
I got the same resulting error I've always had.

I have tried pasting the select statement striaght into MySQL_Front and I
get my nice neat list. So it doen't look like a SQL problem.

Head banging off wall right now.

George

- Original Message -
From: Sheridan Saint-Michel [EMAIL PROTECTED]
To: George Pitcher [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 4:00 PM
Subject: Re: [PHP] Building Dynamic Value list using ohp


 - Original Message -
 From: George Pitcher [EMAIL PROTECTED]
 To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Wednesday, September 26, 2001 9:42 AM
 Subject: Re: [PHP] Building Dynamic Value list using ohp


  Thanks for everyone's help but this is still failing to work.
 
  Revised code is:
 
  ?php
  $link = mysql_connect ('localhost', '', '')
 or die (Could not select db);
  mysql_select_db ('Heronsql')
 or die (Could not connect);
  $query=select distinct HEI from heronuser;
 $result = mysql_query ($query); // I've also tried with ($query,
$link)
   if(mysql_num_rows($result)) {
 // show all HEIs as options in select form
 while($row = mysql_fetch_row($result))
 {
print(option value=\{$row[0]}\{$row[0]}/option);
 }
   }
  mysql_close($link);
  ?
 
  Any more suggestions (please)?
 
  George

 I don't see anything glaringly wrong with your code.
 I would change this:

 $result = mysql_query ($query)

 into:

 if( !($result = mysql_query ($query)) )
   echo Error:  . mysql_error() . BR;

 as I find that most of my errors in something this simple
 are in something fairly simple with the query itself (misspelled
 table or something).

 also make sure that if you copy your query and paste it directly
 into MySQL that it works.

 Sheridan Saint-Michel
 Website Administrator
 FoxJet, an ITW Company
 www.foxjet.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]


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




Re: [PHP] Getting the file size, wtihout download... is this possible ?

2001-09-26 Thread Tamas Arpad

Hi,
HTTP has a method called HEAD, that is for example can be used for
exmample to get the requested files' size if the other web
server/php script supplies it.
So all you have to do is to make a connection to the other web
server, give a HEAD request (it is almost the same as GET), and
parse the data that the server sends back. If there's a
Content-Lenght header...
Arpi
 AFAIAC,
 The only function that gets you image size is GetImageSize()
 which you claimed cannot do remote check. Therefore, I do not
 think you can manage this without downloading/copying the file to
 your server.

 It is possible to get the filesize for couple files on other
 server, without downloading ?
 Probably this will be not fully resolved, but is there any way
 ?

-- 
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] Building Dynamic Value list using ohp

2001-09-26 Thread Maxim Maletsky \(PHPBeginner.com\)


What error do you see, George?


Maxim Maletsky
www.PHPBeginner.com



-Original Message-
From: Sheridan Saint-Michel [mailto:[EMAIL PROTECTED]] 
Sent: mercoledì 26 settembre 2001 17.01
To: George Pitcher; [EMAIL PROTECTED]
Subject: Re: [PHP] Building Dynamic Value list using ohp


- Original Message -
From: George Pitcher [EMAIL PROTECTED]
To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 9:42 AM
Subject: Re: [PHP] Building Dynamic Value list using ohp


 Thanks for everyone's help but this is still failing to work.

 Revised code is:

 ?php
 $link = mysql_connect ('localhost', '', '')
or die (Could not select db);
 mysql_select_db ('Heronsql')
or die (Could not connect);
 $query=select distinct HEI from heronuser;
$result = mysql_query ($query); // I've also tried with ($query,
$link)
  if(mysql_num_rows($result)) {
// show all HEIs as options in select form
while($row = mysql_fetch_row($result))
{
   print(option value=\{$row[0]}\{$row[0]}/option);
}
  }
 mysql_close($link);
 ?

 Any more suggestions (please)?

 George

I don't see anything glaringly wrong with your code.
I would change this:

$result = mysql_query ($query)

into:

if( !($result = mysql_query ($query)) )
  echo Error:  . mysql_error() . BR;

as I find that most of my errors in something this simple
are in something fairly simple with the query itself (misspelled table
or something).

also make sure that if you copy your query and paste it directly into
MySQL that it works.

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.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 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 recommendations

2001-09-26 Thread Tom Beidler

Does anyone have a recommendation on a PHP based Chat system. I'm looking
for an easy to install and reliable system.

Thanks,
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] Building Dynamic Value list using ohp

2001-09-26 Thread Maxim Maletsky \(PHPBeginner.com\)

If you see no errors this might mean you have no records :-)

Maxim Maletsky
www.PHPBeginner.com



-Original Message-
From: Derek Mailer [mailto:[EMAIL PROTECTED]] 
Sent: mercoledì 26 settembre 2001 17.14
To: George Pitcher
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Building Dynamic Value list using ohp


what's the error you're getting now?

if you aren't getting any error, but it just isn't working try something
like...(note that I haven't tested this code).

 $drop_down_list = select name=\select\;

$link = mysql_connect ('localhost', '', '')
or die (Could not select db);
mysql_select_db ('Heronsql')
or die (Could not connect);
$query=select distinct HEI from heronuser;
$result = mysql_query ($query);
$num = mysql_num_rows($result);
for ($i = 0; $i  $num; $i++) {
$HEI = mysql_result($result, $i, HEI);
$drop_down_list .= option value=\$HEI\$HEI/option;
}
mysql_close($link);

$drop_down_list .= /select;

echo $drop_down_list;


Cheers the noo,

Derek

- Original Message -
From: George Pitcher [EMAIL PROTECTED]
To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 3:42 PM
Subject: Re: [PHP] Building Dynamic Value list using ohp


 Thanks for everyone's help but this is still failing to work.

 Revised code is:

 ?php
 $link = mysql_connect ('localhost', '', '')
or die (Could not select db);
 mysql_select_db ('Heronsql')
or die (Could not connect);
 $query=select distinct HEI from heronuser;
$result = mysql_query ($query); // I've also tried with ($query,
$link)
  if(mysql_num_rows($result)) {
// show all HEIs as options in select form
while($row = mysql_fetch_row($result))
{
   print(option value=\{$row[0]}\{$row[0]}/option);
}
  }
 mysql_close($link);
 ?

 Any more suggestions (please)?

 George
 - Original Message -
 From: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED]
 To: 'George Pitcher' [EMAIL PROTECTED]; 
 [EMAIL PROTECTED]
 Sent: Wednesday, September 26, 2001 3:17 PM
 Subject: RE: [PHP] Building Dynamic Value list using ohp



 1. this:
 print(option value=\$row[0]\$row[0]/option);
  should be this:
 print(option value=\{$row[0]}\{$row[0]}/option);
  or like this:
 echo 'option value='.$row[0].''.$row[0].'/option');

 The reason for it is that within double quote you can parse for 
 'simple' variables only (es: $var, not $var[]). Otherwise it gives you

 a parse error.

 2. this:
 mysql_connect ('localhost', 'root', 'monty');
  better be this:
 mysql_connect ('localhost', '', ''); // for security reasons 
 obviously, you don't wanna give the password our to the group, even so

 it is your local server (you might not be original with the password 
 on production machines, no?)


 Hope it helps,
 Maxim Maletsky

 PHPBeginner.com




 -Original Message-
 From: George Pitcher [mailto:[EMAIL PROTECTED]]
 Sent: mercoledì 26 settembre 2001 15.31
 To: [EMAIL PROTECTED]
 Subject: [PHP] Building Dynamic Value list using ohp


 Hi all,

 I'm having a problem with dynamically building a value list.

 My code:

 ?php
 mysql_connect ('localhost', 'root', 'monty');
 mysql_select_db ('Heronsql');
$query = (select HEI from heronuser); // LINE 22 on original
script
$result = mysql_query($query, $mysql_link);
  if(mysql_num_rows($result)) {
// show all HEIs as options in select form
while($row = mysql_fetch_row($result))
{
   print(option value=\$row[0]\$row[0]/option);
}
  }
 ?

 But this generates:

 Parse error:  parse error in c:\program files\apache 
 group\apache\htdocs\bizflyers\login.php on line 22

 Any suggestions?

 Regards

 George



 _

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





**
This e-mail (and any attachment) is intended only for the attention of
the addressee(s). Its unauthorised use, disclosure, storage or copying
is not permitted. If you are not the intended recipient, please destroy
all copies 

Re: [PHP] Extract. Was Re: Feature?

2001-09-26 Thread Alister

On Wed, 26 Sep 2001 09:47:57 -0500, you wrote:

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?

As http://www.php.net/manual/en/function.extract.php says:
This function is used to import variables from an array into 
   the current symbol table.
   

You might want to try declaring the variables that are to be extracted
as global - and see what happens, but I tend to prefer keeping things
to large configuration arrays and then local vars only where I can.

  $foodefault = array(
  'foo_fred'= 'strongdefault fred/strong',
  'foo_banana' = 'strongdefault bananananana/strong',
  );

Caveat Programmer:  don't name the default array foo_default (or
'{PREFIX}_') - if you had a parameter called 'default', the first
extract would overwrite it, and the second would probably fail (or if
it was an array, extract it - but still not what you wanted).

Caveat Programmer 2:  You have to name the default variables in the
array the full and proper post-prefixed name, extract does not appear
to be able to (currently) EXTR_PREFIX_ALL _and_ EXTR_SKIP.

Alister

Please don't send the mailing lists and CC me - 
getting two copies just bugs me.

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

2001-09-26 Thread Maxim Maletsky \(PHPBeginner.com\)


Try to browse hotscripts.com, it has a plenty of them for you to choose.

Maxim Maletsky
www.PHPBeginner.com


-Original Message-
From: Tom Beidler [mailto:[EMAIL PROTECTED]] 
Sent: mercoledi 26 settembre 2001 17.06
To: php list
Subject: [PHP] PHP Chat recommendations


Does anyone have a recommendation on a PHP based Chat system. I'm
looking for an easy to install and reliable system.

Thanks,
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] Building Dynamic Value list using php [SOLVED]

2001-09-26 Thread George Pitcher

Derek,

That worked a treat - not to try and get the flatness out of my head - that
wall was hard!

What still has me stumped is that as far as the query-building goes, both
methods are pretty much the same yet yours doesn't generate the error yet
mine does

Prepare yourselves as this is the login page to a system which at present
runs to 45 pages of Lasso?Filemaker coding which I'm hoping to convert to
PHP/MySQL (or MS-SQL as we have that and DB2 too).

Thanks again

George
- Original Message -
From: Derek Mailer [EMAIL PROTECTED]
To: George Pitcher [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 4:14 PM
Subject: Re: [PHP] Building Dynamic Value list using ohp


 what's the error you're getting now?

 if you aren't getting any error, but it just isn't working try something
 like...(note that I haven't tested this code).

  $drop_down_list = select name=\select\;

 $link = mysql_connect ('localhost', '', '')
 or die (Could not select db);
 mysql_select_db ('Heronsql')
 or die (Could not connect);
 $query=select distinct HEI from heronuser;
 $result = mysql_query ($query);
 $num = mysql_num_rows($result);
 for ($i = 0; $i  $num; $i++) {
 $HEI = mysql_result($result, $i, HEI);
 $drop_down_list .= option value=\$HEI\$HEI/option;
 }
 mysql_close($link);

 $drop_down_list .= /select;

 echo $drop_down_list;


 Cheers the noo,

 Derek

 - Original Message -
 From: George Pitcher [EMAIL PROTECTED]
 To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Wednesday, September 26, 2001 3:42 PM
 Subject: Re: [PHP] Building Dynamic Value list using ohp


  Thanks for everyone's help but this is still failing to work.
 
  Revised code is:
 
  ?php
  $link = mysql_connect ('localhost', '', '')
 or die (Could not select db);
  mysql_select_db ('Heronsql')
 or die (Could not connect);
  $query=select distinct HEI from heronuser;
 $result = mysql_query ($query); // I've also tried with ($query,
$link)
   if(mysql_num_rows($result)) {
 // show all HEIs as options in select form
 while($row = mysql_fetch_row($result))
 {
print(option value=\{$row[0]}\{$row[0]}/option);
 }
   }
  mysql_close($link);
  ?
 
  Any more suggestions (please)?
 
  George
  - Original Message -
  From: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED]
  To: 'George Pitcher' [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Wednesday, September 26, 2001 3:17 PM
  Subject: RE: [PHP] Building Dynamic Value list using ohp
 
 
 
  1. this:
  print(option value=\$row[0]\$row[0]/option);
   should be this:
  print(option value=\{$row[0]}\{$row[0]}/option);
   or like this:
  echo 'option value='.$row[0].''.$row[0].'/option');
 
  The reason for it is that within double quote you can parse for 'simple'
  variables only (es: $var, not $var[]). Otherwise it gives you a parse
  error.
 
  2. this:
  mysql_connect ('localhost', 'root', 'monty');
   better be this:
  mysql_connect ('localhost', '', ''); // for security
  reasons obviously, you don't wanna give the password our to the group,
  even so it is your local server (you might not be original with the
  password on production machines, no?)
 
 
  Hope it helps,
  Maxim Maletsky
 
  PHPBeginner.com
 
 
 
 
  -Original Message-
  From: George Pitcher [mailto:[EMAIL PROTECTED]]
  Sent: mercoledì 26 settembre 2001 15.31
  To: [EMAIL PROTECTED]
  Subject: [PHP] Building Dynamic Value list using ohp
 
 
  Hi all,
 
  I'm having a problem with dynamically building a value list.
 
  My code:
 
  ?php
  mysql_connect ('localhost', 'root', 'monty');
  mysql_select_db ('Heronsql');
 $query = (select HEI from heronuser); // LINE 22 on original script
 $result = mysql_query($query, $mysql_link);
   if(mysql_num_rows($result)) {
 // show all HEIs as options in select form
 while($row = mysql_fetch_row($result))
 {
print(option value=\$row[0]\$row[0]/option);
 }
   }
  ?
 
  But this generates:
 
  Parse error:  parse error in c:\program files\apache
  group\apache\htdocs\bizflyers\login.php on line 22
 
  Any suggestions?
 
  Regards
 
  George
 
 
 
  _
 
  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 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 

RE: [PHP] Site Hosting

2001-09-26 Thread Jeff Pearson

My friend owns a hosting company that supports php and MySQL along with a
ton of other things.and they are VERY inexpensive. You can check them
out at http://www.eaccounts.net/ref/jp52950052/?referer=emaillink

Jeff Pearson

Disclaimer: Yes the link tracks the referrals.No. I don't make any money
from it. I do beta testing for them and use the referral info to test
features for them.

 -Original Message-
 From: Darren Henderson [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, September 26, 2001 7:30 AM
 To: vishal khialani
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Site Hosting


 On Fri, 21 Sep 2001, vishal khialani wrote:

  Hi,
I am searching companies who will host my site. Presently I
 am looking out
  for php, mysql and ssl support. So does anyone know a good company ?
  Vishal

 Something to consider... perhaps supporting those companies that
 support PHP
 might be a good idea, take a look at www.php.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]



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

2001-09-26 Thread Tom Beidler

I did, that's why I'm asking for a recommendation. There are quite a few.

 From: Maxim Maletsky \(PHPBeginner.com\) [EMAIL PROTECTED]
 Organization: PHPBeginner.com
 Date: Wed, 26 Sep 2001 17:18:15 +0200
 To: 'Tom Beidler' [EMAIL PROTECTED], 'php list'
 [EMAIL PROTECTED]
 Subject: RE: [PHP] PHP Chat recommendations
 
 
 Try to browse hotscripts.com, it has a plenty of them for you to choose.
 
 Maxim Maletsky
 www.PHPBeginner.com
 
 
 -Original Message-
 From: Tom Beidler [mailto:[EMAIL PROTECTED]]
 Sent: mercoledi 26 settembre 2001 17.06
 To: php list
 Subject: [PHP] PHP Chat recommendations
 
 
 Does anyone have a recommendation on a PHP based Chat system. I'm
 looking for an easy to install and reliable system.
 
 Thanks,
 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]




[PHP] quick question.

2001-09-26 Thread Jay Paulson

I was just wondering if I could call some functions out side of the class
I'm making?  The reason why I want to do this is so that I don't have to
rewrite the functions as methods in the class and I don't want to get too
far into what I'm doing before I find out it doesn't work.

Thanks,
Jay


-- 
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] OOP Yea you know me... OOP yea you know me...

2001-09-26 Thread Joel Ricker

Hey all,

I've been working on my first OPP driven PHP code and wanted to see what
everyone thought and any ideas anybody can add to the code that I'm working
on.  I've had to make some concessions due to the limitations of PHP's OOP
model and the fact that I'm using PHP3 which doesn't functions like
get_class or get_parent so I'll have to explicity add those myself.  In my
example here, I've provided a Base Class which everything inherits from.  It
provides Methods for Getting and Setting variables, which checking to making
sure those variables exist in the object declaration before setting them.
Please let me know you think.

Thanks
Joel

---
/*  BaseClass.inc */
?php

class BaseClass {
 var $_Class;

 function BaseClass() {
  $this-Set(_Class, BaseClass);
 }

function Get($VarName) {
  return $this-$VarName;
 }

 function AddVar($VarName, $Value = ) {
  $this-$VarName = ;
 }

 function Set($VarName, $Value) {
  if (!isset($this-$VarName)) {
   new Error(?, ?, Invalid Variable Name at method call  .
$this-Get(_Class) . -Set($VarName, $Value).);
  } else {
   $this-$VarName = $Value;
  }
 }
}

?

/* Math.inc */
?php

class _Math extends BaseClass {

 var $_Seed;

 /* Math (private) */
 /*   A series of math related functions needed for the performance of other
objects */
 /* Parameters: */
 /*   None */

 function _Math() {
  $this-Set(_Class, Math);
  $this-Set(_Seed, (double) microtime() * 100);
 }

 /* SeedRandomNumbers (private) */
 /*   Seeds the Random Number Generator */
 /* Parameters: */
 /*   None
 /* Returns: */
 /*   None */
 function _SeedRandomNumbers() {
  mt_srand($this-Get(_Seed));
 }

 /* RangeOfRandomNumbers (private) */
 /*   Returns a random number between a high and low number inclusive */
 /* Parameters: */
 /*   Low - Lowest possible number of Random Number */
 /*   High - Highest possible number of Random Number */
 /* Returns: */
 /*   (Integer) Random Number between two numbers inclusive */

 function _RangeOfRandomNumbers($Low = 1, $High = 6) {
  return mt_rand($Low, $High);
 }

 function _GCD($m,$n) {
  if ($n==0) {
   return $m;
  } else {
   return ($this-_GCD($n,($m%$n)));
  }
}

} //End Math

/* Fraction.inc */

?php

class Fraction extends _Math {

 var $_WholePart;
 var $_Numerator;
 var $_Denominator;

 function Fraction ($Whole, $Numerator=0, $Denominator=0) {
  $this-Set(_Class, Fraction);
  $this-Set(_WholePart, $Whole);
  $this-Set(_Numerator, $Numerator);
  $this-Set(_Denominator, $Denominator);
 }

 function Add ($AddTo) {
  $Num = ($this-Get(_Numerator) * $AddTo-Get(_Denominator)) +
($AddTo-Get(_Numerator) * $this-Get(_Denominator));
  $Den = ($this-Get(_Denominator) * $AddTo-Get(_Denominator));
  if ($Num != 0  $Den != 0) {
   $GCD = $this-_GCD($Num, $Den);
   $Num = $Num / $GCD;
   $Den = $Den / $GCD;
   $Whole = floor($Num / $Den);
   $Num = $Num % $Den;
  }
  $NewFraction = ($Num != 0) ? new Fraction($this-Get(_WholePart) +
$AddTo-Get(_WholePart) + $Whole, $Num, $Den) : new
Fraction($this-Get(_WholePart) + $AddTo-Get(_WholePart) + $Whole);

  return $NewFraction;
 }

 function Fetch() {
  $frac = ;
  if ($this-Get(_WholePart)) {
   $frac .= $this-Get(_WholePart) .  ;
  }
  if ($this-Get(_Numerator)) {
   $frac .= $this-Get(_Numerator) . / . $this-Get(_Denominator);
  }
  $frac = chop($frac);
  if (empty($frac)) {
   $frac = 0;
  }
  return $frac;
 }

 function Show() {
  print $this-Fetch();
 }

}

---
There are worlds out there where the sky is burning, the seas
sleep, and the rivers dream; people made of smoke, and cities made of
song.  Somewhere there's danger; somewhere there's injustice, and somewhere
else the tea is getting cold!  Come on Ace, we've got work to do!



-- 
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] Help - error loading PHP into Apache

2001-09-26 Thread Michael Champagne

Help!

I'm trying to install a development Apache + PHP environment on the same
machine as our test environment (Apache + mod_SSL + PHP).  I followed the same
procedure that I used to set up our test system (which works fine) and
everything compiles and builds fine.  However when I try to start up Apache I
get:

Syntax error on line 236 of /usr/local/apache/dev/conf/httpd.conf:
Cannot load /usr/local/apache/dev/libexec/libphp4.so into server:
/usr/local/apache/dev/libexec/libphp4.so: undefined symbol: mm_create
./apachectl start: httpd could not be started

The mm library was configured like this:
./configure --disable-shared --prefix=/usr/local/mm
make
make test
make install

Apache was configured like this:
EAPI_MM=/usr/local/mm \
./configure --prefix=/usr/local/apache/dev  --enable-module=most \
  --enable-shared=max

PHP was installed like this:
./configure --with-apxs=/usr/local/apache/dev/bin/apxs --without-mysql \
  --with-oci8=/oracle --with-gd --with-mm=/usr/local/mm

I have tried recompiling this several times with the same error message.  The
only difference between this setup and the other Apache setup on this machine
is the other (working) one has mod_SSL installed and enabled.  Does anyone see
what my problem is here?

Thanks in advance for any replies,

-- 
Michael Champagne, Software Engineer
Capital Institutional Services, Inc.
wk: [EMAIL PROTECTED]
hm: [EMAIL PROTECTED]



**
This communication is for informational purposes only.  It is not
intended as an offer or solicitation for the purchase or sale of 
any financial instrument or as an official confirmation of any 
transaction, unless specifically agreed otherwise.  All market 
prices, data and other information are not warranted as to 
completeness or accuracy and are subject to change without
notice.  Any comments or statements made herein do not 
necessarily reflect the views or opinions of Capital Institutional
Services, Inc.  Capital Institutional Services, Inc. accepts no
liability for any errors or omissions arising as a result of
transmission.  Use of this communication by other than intended
recipients is prohibited.
**

-- 
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] quick question.

2001-09-26 Thread Joel Ricker


: I was just wondering if I could call some functions out side of the class
: I'm making?  The reason why I want to do this is so that I don't have to
: rewrite the functions as methods in the class and I don't want to get too
: far into what I'm doing before I find out it doesn't work.

Sure you can.  All functions in the Global scope can be called from inside
the class.

Joel



-- 
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] handling errors

2001-09-26 Thread Joseph Bannon

How do I turn off the error messages that appear at the top of the page?  I
have this function below that if an image is not there for $url, it give a
warning.

$size = GetImageSize($url);



Example error message below...

Warning: getimagesize: Unable to open 'http://www.yahoo.com' for reading.
line 28


Joseph














-- 
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] handling errors

2001-09-26 Thread Boget, Chris

 How do I turn off the error messages that appear at the top 
 of the page?  I have this function below that if an image is 
 not there for $url, it give a warning.
 $size = GetImageSize($url);
 Example error message below...
 Warning: getimagesize: Unable to open 'http://www.yahoo.com' 
 for reading. line 28

This should do it:

$size = @GetImageSize($url);

The @ symbol suppresses errors.

Chris



RE: [PHP] Building Dynamic Value list using ohp

2001-09-26 Thread Philip Olson


 The reason for it is that within double quote you can parse for 'simple'
 variables only (es: $var, not $var[]). Otherwise it gives you a parse
 error.

Just a quick note, this is partially true.  The following works :

  error_reporting(E_ALL);

  $arr  = array ('a' = 'apple','b' = 'banana');

  print I'd like an $arr[a] today, and a {$arr['b']} too;

I used to assume foo $arr[a] would give a Warning but it doesn't as the
constant 'a' isn't looked for in the string, but :

  print $arr[a];   // apple and a Warning
   // Warning: Use of undefined constant a - assumed 'a'

  define('a','b'); // define  a  as a constant with value of  b

  print $arr[a];   // banana and no Warning
  print $arr['a']; // apple  and no Warning (quotes are good)

Numerical arrays work fine in a string, such as foo $array[0].

Maxim is referring to foo $arr['a'] creating a parse error, one that
looks like :

  Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
  `T_NUM_STRING' in /www/htdocs/test.php on line 4

As it does.  The Warnings shown above refer to the E_NOTICE level.  Have
fun and yes, this is a digression and off-topic :)

Regards,
Philip Olson


 1. this:
   print(option value=\$row[0]\$row[0]/option);
  should be this:
   print(option value=\{$row[0]}\{$row[0]}/option);
  or like this:
   echo 'option value='.$row[0].''.$row[0].'/option');
 
 The reason for it is that within double quote you can parse for 'simple'
 variables only (es: $var, not $var[]). Otherwise it gives you a parse
 error.



-- 
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] display query results at random

2001-09-26 Thread Jerry Lake

I'm not positive on this, but I think I catch your drift.
when you get the results of your query...

place 1 = $results[2]
place 2 = $results[0]
place 5 = $results[4]

Later,

Jerry Lake
Interface Engineering Technician



-Original Message-
From: Matthew Delmarter [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 25, 2001 9:15 PM
To: [EMAIL PROTECTED]
Cc: PHP Mailing List
Subject: RE: [PHP] display query results at random


Hi Lawrence,

Thanks for your reply.

I should clarify that I want to control where I output the result.

Place 1 - show details for record 3 //I specifically want record 3
details here
Place 2 - show details for record 1 //I specifically want record 1
details here
Place 5 - show details for record 5 //I specifically want record 5
details here

What I meant by 'random' was that it's not in the order returned by
the mysql query.

Matthew

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 26, 2001 3:56 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] display query results at random


Return into an array, then loop through the array or shuffle it
(easier)?.

Note if you have nulls in DB, you will have to do something different.

n'est pas?



e.g. (untested)

mysql_fetch_array

?php
mysql_connect ($host, $user, $password);
$result = mysql_db_query (database,select user_id, fullname from
table);
$j=0;
while ($row[$j] = mysql_fetch_array ($result)) {
$j++;
}
mysql_free_result ($result);

srand ((float)microtime()*100);
shuffle ($row);

//do output stuff with array

?

-Original Message-
From: Matthew Delmarter [mailto:[EMAIL PROTECTED]]
Sent: September 26, 2001 12:01 PM
To: PHP Mailing List
Subject: [PHP] display query results at random


How do I return a specific record from a db outside of the query?

Let's say I select * from table (using mysql_fetch_object) and get 5
results. I want to display the 5 results in different / random places
on the page.

Place 1 - show details for record 3
Place 2 - show details for record 1
Place 5 - show details for record 5

How do I do this?

I know how to loop thru a mysql result - but what if want to display
things in a random order around the page? I could have multiple select
statements - but this would increase the load on the server and is
unnecessary as all the data was returned from the query - it's just a
matter of knowing how to get it!

Can anyone help?

I am sorry if the question is confusing, but I can't think of a better
way to explain it at the moment (i'm tired)...

Matthew


--
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]session and frames: please HELP!!!!!

2001-09-26 Thread Michael . Thanry


Ok, I now feel stupid because it still don't work or I still don't get it.
Here are the filez please feel free to comment and advise.

(See attached file: index.php)(See attached file: TESTAD~1.PHP)(See
attached file: index2.php)(See attached file: menu.php)

Regards,
Michael


   
 
Marian Vasile
 
marian@schnecker.To: [EMAIL PROTECTED]
 
rdsnet.rocc:  
 
  Subject: Re: [PHP]session and 
frames: please HELP!
26/09/2001 16:26   
 
   
 
   
 




You can't send from outside, something that is INSIDE... I mean a session
variable.

If that could be done than probably I will seriously have security
problems.

Now what you've written it's correct in my opinion and it should work.
What are you trying to do exactly? to save a session variable, or the
current session name ?

I think this is the problem you got it wrong.
The best way for you, to forward a password (because this was the example
you said) is to do like this:

in the current file you'll have:
session_start(); session_register(session_password);
session_register(session_value);
$password=session_password; $value=session_value;
then
frame src=menu.php?? echo session_name().=.session_id(); ?

and in the menu.php you need to have that:
session_start();

(to start the sessions and create the sessions variable... :)

Yours,
M

Michael Thanry [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hello everyone!

 I've a quick question I've been working on for a few days, look into the
 archive of the mailing-list but found nothing relevant:

 How to forward a session variable such as a password to a page containing
 frames?
 I tried something like frame src=menu.php?? echo session_name().
 =.session_id(); ? but it didn't seem to work.

 Any idea or suggestion?

 Regards,

 Michael Thanry




--
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] Variable declaration

2001-09-26 Thread Alberto

I want PHP parser to warn/fail when I try to use a variable not declared
before. Like Option Explicit on ASP/VBA.

Thnx in advance :)



-- 
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 and frames: please HELP!!!!!

2001-09-26 Thread Michael . Thanry


Ok, I now feel stupid because it still don't work or I still don't get it.
Here are the filez please feel free to comment and advise.
(See attached file: testadmin.php)(See attached file: index2.php)(See
attached file: menu.php)(See attached file: index.php)


   
 
Marian Vasile
 
marian@schnecker.To: [EMAIL PROTECTED]
 
rdsnet.rocc:  
 
  Subject: Re: [PHP]session and 
frames: please HELP!
26/09/2001 16:26   
 
   
 
   
 




You can't send from outside, something that is INSIDE... I mean a session
variable.

If that could be done than probably I will seriously have security
problems.

Now what you've written it's correct in my opinion and it should work.
What are you trying to do exactly? to save a session variable, or the
current session name ?

I think this is the problem you got it wrong.
The best way for you, to forward a password (because this was the example
you said) is to do like this:

in the current file you'll have:
session_start(); session_register(session_password);
session_register(session_value);
$password=session_password; $value=session_value;
then
frame src=menu.php?? echo session_name().=.session_id(); ?

and in the menu.php you need to have that:
session_start();

(to start the sessions and create the sessions variable... :)

Yours,
M

Michael Thanry [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hello everyone!

 I've a quick question I've been working on for a few days, look into the
 archive of the mailing-list but found nothing relevant:

 How to forward a session variable such as a password to a page containing
 frames?
 I tried something like frame src=menu.php?? echo session_name().
 =.session_id(); ? but it didn't seem to work.

 Any idea or suggestion?

 Regards,

 Michael Thanry




--
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] Variable declaration

2001-09-26 Thread Boget, Chris

 I want PHP parser to warn/fail when I try to use a variable 
 not declared before. Like Option Explicit on ASP/VBA.

Look here:

http://www.php.net/manual/en/function.error-reporting.php

Chris



[PHP] 2D array from file

2001-09-26 Thread John Frenzel

I have created a 2D array, then written it into a tet file. The file is
written such that all the secondary array elements (the rows) are seperate
lines, with the columns tab-delimited. Now I'd like to read this file back
into a 2D array. I thought this should work:


$array_file = file (array.dat);
for ($k=0; $k = 63; $k++)
{
$array[$k] = explode( \t, $array_file[$k] );
}

I know that $array[$k] is a valid variable, and that explode returns an
array, so I'm not clear why this isn't working. If I use $array = explode(
\t, $array_file[$k] ); I get the line without any trouble. What am I
missing?

Thanks

--- John Frenzel



-- 
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] select based on time/date

2001-09-26 Thread Jason Dulberg

You were right! I changed it to a timestamp (14) and the selection is
working great now.

Only problem is that when I logout which UPDATE's the table to clear the
$session field, the $time_in timestamp gets updated because of the NOW()
function. I need that date to stay the same when someone logs out.

current logout.php:
$out = UPDATE logged_in SET session='' WHERE (logged_in.userid='$aid') AND
(logged_in.session='$sessid');

Is there a way to only allow the NOW() to work when a row is added to the
table? Or perhaps another way

Thank you again for your time. I've learned alot from this.

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

 -Original Message-
 From: Sheridan Saint-Michel [mailto:[EMAIL PROTECTED]]
 Sent: September 26, 2001 9:38 AM
 To: Jason Dulberg; [EMAIL PROTECTED]
 Subject: Re: [PHP] select based on time/date


 The reason my query didn't work is you have time_in as a varchar.
 Change it to a datetime field or timestamp field and it should work.

 I would suggest making it a timestamp field.  That way whenever
 you update the row (probably update the session field with a new
 session) MySQL will automatically set time_in to Now().  This will
 avoid a lot of headache for you  =)

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


 - Original Message -
 From: Jason Dulberg [EMAIL PROTECTED]
 To: Sheridan Saint-Michel [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Tuesday, September 25, 2001 5:08 PM
 Subject: RE: [PHP] select based on time/date


  I tried basically what you have but I got an error:
 
  $sql=select * from logged_in where time_in + interval 1 hour = now();
  $result = mysql_query($sql);
 
  If it will help, here's the table structure -- looks like my
 structure is
  bit different from what I orignally posted:
 
  CREATE TABLE logged_in (
 id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
 session varchar(100) DEFAULT '0' NOT NULL,
 time_in varchar(50) NOT NULL,
 KEY id (id)
  );
 
  Thanks again.
 
  __
  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] select based on time/date

2001-09-26 Thread Jason Dulberg

Awesome... Its all working perfectly now! Makes perfect sense why the update
is like that.

thanks again!

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



 -Original Message-
 From: Sheridan Saint-Michel [mailto:[EMAIL PROTECTED]]
 Sent: September 26, 2001 1:59 PM
 To: Jason Dulberg; [EMAIL PROTECTED]
 Subject: Re: [PHP] select based on time/date


 Timestamp only sets itself to Now() if it isn't explicitly set (or set to
 NULL).  So try this:

 $out = UPDATE logged_in SET session='',time_in=time_in WHERE
 (logged_in.userid='$aid') AND (logged_in.session='$sessid');

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


 - Original Message -
 From: Jason Dulberg [EMAIL PROTECTED]
 To: Sheridan Saint-Michel [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Wednesday, September 26, 2001 12:44 PM
 Subject: RE: [PHP] select based on time/date


  You were right! I changed it to a timestamp (14) and the selection is
  working great now.
 
  Only problem is that when I logout which UPDATE's the table to clear the
  $session field, the $time_in timestamp gets updated because of the NOW()
  function. I need that date to stay the same when someone logs out.
 
  current logout.php:
  $out = UPDATE logged_in SET session='' WHERE (logged_in.userid='$aid')
 AND
  (logged_in.session='$sessid');
 
  Is there a way to only allow the NOW() to work when a row is
 added to the
  table? Or perhaps another way
 
  Thank you again for your time. I've learned alot from this.
 
  __
  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]




[PHP] PEAR DB Questions

2001-09-26 Thread Matthew Walker

I've got the docs you all mentioned in response to my earlier questions.
Thanks a ton! They were almost exactly what I needed.
 
There's only one thing that I can't figure out how to do with the
module. In PHP, there's a function 'mysql_insert_id()'. It returns the
Autoincriment ID of the last insert you performed. How do I get that
information with the PEAR DB module? 
 
--
Matthew Walker
Ecommerce Project Manager
Mountain Top Herbs
 
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.281 / Virus Database: 149 - Release Date: 9/18/2001




[PHP] Problem recursively building array

2001-09-26 Thread Chris Hobbs

I'm attempting to build an array of filenames in a sub-directory with 
sub-directories. I'm using a modified version of code found on php.net - 
the function I wrote is here:

function getDirList ($dirName) {
 $dirList=array();
 $d = dir($dirName);
 while ($entry = $d-read()) {
 if ($entry != .  $entry != ..) {
 if (is_dir($dirName./.$entry)) {
 echo bDirectory found: $entry/bbr\n;
 $dirList = $dirList + getDirList($dirName./.$entry);
 } else {
 $temp = $dirName./.$entry;
 $temp = str_replace(/var/www/html/boarddocs/, , $temp);
 echo $temp.br\n;
 $dirList[] = $temp;
 }
 }
 }
 return $dirList;
}

It's called with: $bplist = getDirList($bppath);
$bppath is correct.

The problem is that although my testing of the function shows all of the 
entries correctly (note the 'echo $temp' line), not all of these entries 
are ending up in the array - in fact, large chunks of some directories, 
and all of other directories, are missing.

Sample output is here: http://www.silvervalley.k12.ca.us/boarddocs/bpar.php

Complete code is here: http://www.silvervalley.k12.ca.us/boarddocs/bpar.phps

I'm gonna be real annoyed if I missed something stupid. I built as much 
debugging output into this as I thought I should, but your help will be 
appreciated.

-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] Problem recursively building array

2001-09-26 Thread Chris Hobbs

Chris Hobbs wrote:

 $dirList = $dirList + getDirList($dirName./.$entry);


OK, on a lark I changed the above to use array_merge, and the problem 
went away - that'll teach me to use a shortcut :)

-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] Reading STDIN from within the program

2001-09-26 Thread ashish.natani

Hi,
I wish to read the message string posted by my form into a php program.

I tried to use the environment variable $HTTP_RAW_POST_DATA but this did not contain 
any value. 

Can someone help me with reading the STDIN input from within the php program ?

Thanks and Regards,
Ashish Natani
Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com

 Buy Music, Video, CD-ROM, Audio-Books and Music Accessories from 
http://www.planetm.co.in


-- 
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] Nueva direccion

2001-09-26 Thread Gonzalo Casas

Hola todos..!!
Mi nueva direccion a partir de ahora es [EMAIL PROTECTED] 

Bye!
Gonzalo



[PHP] Re: $this?

2001-09-26 Thread Ming-Chieh Lee

does anyone know what does $this mean?  I saw this on the php.net
 tuturial
  for references inside a constructor.
  I thought that $this is already a reference?
  The way it was used :
  class Foo
  {
  function Foo($name)
  {
  // create a reference inside the global array $globalref
  global $globalref;
  $globalref[] = $this;
  // set name to passed value
  $this-setName($name);
  // and put it out
  $this-echoName();
  }
  thanks for any input!




-- 
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: $this?

2001-09-26 Thread Ming-Chieh Lee

just for clarity, why do we need to reference a variable when the variable
already contain a reference?  Thanks

Ming-Chieh Lee [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 does anyone know what does $this mean?  I saw this on the php.net
  tuturial
   for references inside a constructor.
   I thought that $this is already a reference?
   The way it was used :
   class Foo
   {
   function Foo($name)
   {
   // create a reference inside the global array $globalref
   global $globalref;
   $globalref[] = $this;
   // set name to passed value
   $this-setName($name);
   // and put it out
   $this-echoName();
   }
   thanks for any input!






-- 
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] PEAR DB Questions

2001-09-26 Thread Matthew Walker

Thanks. That will work quite nicely.

-Original Message-
From: Jack Dempsey [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 26, 2001 1:20 PM
To: Matthew Walker; [EMAIL PROTECTED]
Subject: RE: [PHP] PEAR DB Questions

don't know about pear, but in case you can't do it, there's a mysql
version-
LAST_INSERT_ID()
like this:

mysql select last_insert_id();
+--+
| last_insert_id() |
+--+
|  262 |
+--+
1 row in set (0.04 sec)

-jack

-Original Message-
From: Matthew Walker [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 26, 2001 2:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PEAR DB Questions


I've got the docs you all mentioned in response to my earlier questions.
Thanks a ton! They were almost exactly what I needed.

There's only one thing that I can't figure out how to do with the
module. In PHP, there's a function 'mysql_insert_id()'. It returns the
Autoincriment ID of the last insert you performed. How do I get that
information with the PEAR DB module?

--
Matthew Walker
Ecommerce Project Manager
Mountain Top Herbs

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.281 / Virus Database: 149 - Release Date: 9/18/2001



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

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.281 / Virus Database: 149 - Release Date: 9/18/2001



-- 
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] updating a database (mysql)

2001-09-26 Thread Joseph Bannon

When I update my mysql database, is there a way with PHP to know what or if
any records where updated?

Joseph



-- 
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: showing wrong php version after install

2001-09-26 Thread Geir Eivind Mork

Caleb Carvalho wrote:

 just finished installing php-4.0.6, now when writing the test.php page with
 the ?phpinfo();?

Try again after you restarted apache ;)
 
-- 
PHP Developer, home: http://www.moijk.net | work: http://www.coretrek.com
tan: Tangent | http://www.php.net/manual/en/function.tan.php

-- 
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: handling errors

2001-09-26 Thread Geir Eivind Mork

Joseph Bannon wrote:

 have this function below that if an image is not there for $url, it give a
 warning.
 
 $size = GetImageSize($url);

Just use 
 $size = @GetImageSize($url);
 
but to stop display of error for all functions:
error_reporting (0);

the opposite, reports EVERYTHING, even bad code (like undeclared variables 
which is quite a security issue ;)

error_reporting (E_ALL ^ E_NOTICE);

-- 
PHP Developer, home: http://www.moijk.net | work: http://www.coretrek.com
symlink: Creates a symbolic link | 
http://www.php.net/manual/en/function.symlink.php

-- 
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] Variable variables

2001-09-26 Thread Richard Baskett

I can not figure out why this is not working!

for ($j=0; $j$resultNum; $j++) {
  $newvar = finalresult.$a;
  $$newvar[$a][name] = $resultRow[name];
  $$newvar[$a][title]= $resultRow[title];
  $$newvar[$a][descript] = $resultRow[descript];
  $$newvar[$a][countkey] = substr_count($resultRow[keywords], $keyword);
  a++;
}

This is how you use variable variables, is it not?  Is it because it's a
multidimensional array?  or am I missing something else?

Rick


-- 
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] updating a database (mysql)

2001-09-26 Thread Sheridan Saint-Michel

I think this is what you are looking for
http://www.php.net/manual/en/function.mysql-affected-rows.php

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


- Original Message -
From: Joseph Bannon [EMAIL PROTECTED]
To: PHP (E-mail) [EMAIL PROTECTED]
Sent: Wednesday, September 26, 2001 2:47 PM
Subject: [PHP] updating a database (mysql)


 When I update my mysql database, is there a way with PHP to know what or
if
 any records where updated?

 Joseph



 --
 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: 2D array from file

2001-09-26 Thread Chris Lee

have you thought of just using

http://www.php.net/manual/en/function.serialize.php
http://www.php.net/manual/en/function.unserialize.php

its alot easier.

--

  Chris Lee
  [EMAIL PROTECTED]


John Frenzel [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have created a 2D array, then written it into a tet file. The file is
 written such that all the secondary array elements (the rows) are seperate
 lines, with the columns tab-delimited. Now I'd like to read this file
back
 into a 2D array. I thought this should work:


 $array_file = file (array.dat);
 for ($k=0; $k = 63; $k++)
 {
 $array[$k] = explode( \t, $array_file[$k] );
 }

 I know that $array[$k] is a valid variable, and that explode returns an
 array, so I'm not clear why this isn't working. If I use $array = explode(
 \t, $array_file[$k] ); I get the line without any trouble. What am I
 missing?

 Thanks

 --- John Frenzel





-- 
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 would you code: $r = func() or return 0?

2001-09-26 Thread scott [gts]

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I thought i'd ask for your comments on how you'd code this
common perl code with PHP:

$value = some_function() or return 0;

i usually code my functions to return 0 or  on error, but
have to use the following code to handle it... neither seem
like a good solution to me.

this way decreses the readability of the code:
if (!$value = some_function)
return 0;

and this way adds an unnecessary if() statement:
$value = some_function()
if (!$value) {
return 0;
}

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com

iQA/AwUBO7I+l8aXTGgZdrSUEQLW3wCbBhH8w+P+EgJxvs46H9JUtx9q0iUAoKeg
pRwrJ6NH230r0EQZl3Wvc5Wl
=sUof
-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]




  1   2   >