php-general Digest 17 Apr 2001 18:43:15 -0000 Issue 633

Topics (messages 48903 through 49020):

Re: baffled :<:<
        48903 by: Seung-woo Nam
        48904 by: Mark Maggelet
        48906 by: Chris Fry
        48907 by: Romulo Roberto Pereira
        48909 by: Romulo Roberto Pereira
        48910 by: Chris Fry
        48911 by: Romulo Roberto Pereira
        48917 by: Plutarck
        48945 by: Christian Reiniger
        48953 by: John Lim

Dynamic built web pages administration
        48905 by: Romulo Roberto Pereira
        48924 by: Maxim Maletsky
        48931 by: Dean Hall
        48973 by: Plutarck
        48991 by: Romulo Roberto Pereira

Re: fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14
        48908 by: CC Zona

Re: is it safe to stripslashes() on all form variables?
        48912 by: Yasuo Ohgaki
        48913 by: Jason Murray

Re: Populating HTML List boxes From DB
        48914 by: Alexander Skwar
        48915 by: Alexander Skwar
        48916 by: Jason Murray
        48981 by: Plutarck

How to unsubscribe
        48918 by: Joachim Fuchs
        48921 by: Maxim Maletsky
        48922 by: Felix Kronlage
        48925 by: B. van Ouwerkerk

Re: ZOPE PHP
        48919 by: elias
        48929 by: Felix Kronlage
        48930 by: Moody

Time needed for a SQL-statement
        48920 by: B. Tenhumberg
        48923 by: Maxim Maletsky
        49006 by: Ulf Wendel

Re: A slightly amusing, though mostly dangerous, endless loop
        48926 by: Greig, Euan
        48994 by: Plutarck

'Embedding' a PDF file
        48927 by: Alexis Antonakis
        48928 by: Henrik Johansson

Re: array_push but with key, value pairs
        48932 by: Dean Hall

Re: set_error_handler()
        48933 by: Dean Hall
        48942 by: Boget, Chris

highlighting search results (revisited)
        48934 by: Matt Williams

Is this kind of code safe?
        48935 by: Greig, Euan
        48936 by: Jason Murray
        48937 by: Greig, Euan
        48968 by: Plutarck

Re: Storing User Info
        48938 by: Christian Reiniger
        48987 by: Plutarck

variables empty
        48939 by: Dennis Haller
        48972 by: phpman
        49007 by: Ulf Wendel

Re: php like cgi
        48940 by: Christian Reiniger
        49018 by: Ulysses Almeida

Re: Speed of MySQL connections - Socket vs. Non-Socket
        48941 by: Christian Reiniger

php equivalent for `command`
        48943 by: Greig, Euan
        48967 by: Plutarck

Re: cgi vs. module
        48944 by: Christian Reiniger
        48980 by: Plutarck
        48982 by: Jack Dempsey
        49004 by: Dan Lowe

Running php as a CGI
        48946 by: Boget, Chris
        48952 by: Knut H. Hassel Nielsen

Mail help!!!!!
        48947 by: Bruno Freire
        48948 by: Johannes Janson

Re: Job in Whistler, BC
        48949 by: Pierre-Yves Lemaire
        48984 by: Plutarck

Re: cookies
        48950 by: Grimes, Dean

Re: PHP4.0.4pl1+PdfLib3.03+SCO
        48951 by: Grimes, Dean
        48969 by: Paul Gardiner

Reauthenticate
        48954 by: Marcelo Pereira
        48964 by: Plutarck

Re: How do i include ASP script into PHP...??!
        48955 by: John Lim
        48963 by: Jason Murray

Form Field
        48956 by: Mike
        48958 by: Marcelo Pereira
        48959 by: Picard, Cyril
        48975 by: Mike
        48977 by: Jack Dempsey

Re: Installing PHP Extentions for IIS - W2K - Is it possible?
        48957 by: John Lim

Returning part of a string, ereg..
        48960 by: Chad Day
        48962 by: Morgan Curley
        48979 by: Plutarck

Persistent connection & many scripts ?
        48961 by: Picard, Cyril
        48965 by: Plutarck
        48971 by: Picard, Cyril

Dynamic Pages and Google ???
        48966 by: Jon Shoberg
        48978 by: Jeff Holzfaster
        48983 by: Philip Hallstrom
        48985 by: Michael Kimsal
        48989 by: Plutarck
        49015 by: Philip Olson

working with SSL
        48970 by: phpman

HTML and slashes.
        48974 by: Dddogbruce \(.home.com\)
        48976 by: Johannes Janson
        48986 by: Dddogbruce \(.home.com\)
        48988 by: Jack Dempsey
        48990 by: Johannes Janson
        48992 by: Plutarck

Javascript mailing list
        48993 by: Boget, Chris
        48995 by: Plutarck
        48996 by: Seung-woo Nam
        48997 by: Andy Woolley

OT - cyber squatting?
        48998 by: Kurth Bemis
        49002 by: Plutarck
        49003 by: Kurth Bemis

Session Variables & Cookies
        48999 by: Bob Clingan

Re: PHP3 and PHP_SELF
        49000 by: Dan Lowe

get_class()
        49001 by: Boget, Chris
        49008 by: Plutarck

PHP and a C++ application
        49005 by: Xinkun Wang

Is there such an array like $array[][]?
        49009 by: Scott Fletcher
        49010 by: Jack Dempsey
        49011 by: Plutarck

Re: Site Sessions: Online/Offline - help?
        49012 by: Plutarck

Help with a php Registration Form
        49013 by: Michael Leone
        49014 by: Kurth Bemis
        49016 by: Kurth Bemis

Finding Duplicate Numbers?
        49017 by: Devin Atencio
        49019 by: Colin Putney
        49020 by: Plutarck

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------


You didn't really say that in your initial post :-) So, what you mean is
that the db line is not what you actually have in your script? The what
do you really have? Just by looking at the script you posted, the reason
it doesn't work certainly seems to be the invalid database handler. If
you have a function that returns a handler, the syntax would be
something like:

include "connect.inc";
$db = db_connect(); 

This is assuming you have a function called db_connect() that returns a
database handler in your 'connect.inc' file.

Seung-woo Nam

Peter Houchin wrote:
> 
> yes i know it was mearly there to show i had it in my script as i said in my initial 
>post i could get info from the db, just not in the while loop
> 
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 17, 2001 4:08 PM
> To: Peter Houchin
> Cc: Php-General@Lists. Php. Net
> Subject: Re: [PHP] baffled :<:<
> 
> > $db = include"connect.inc";
> 
> includes do not return anything useful, so this is a bogus statement.
> 
> > $foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";
> >
> >  $result = mysql_query($foo,$db);
> 
> An include certainly cannot return a database handle.  Included files
> operate in the same variable scope as the script doing the inclusion.  So
> simply set $db in your connect.inc file and it will automatically be
> available to you after the include.
> 
> -Rasmus




On Tue, 17 Apr 2001 15:59:37 +1000, Peter Houchin
([EMAIL PROTECTED]) wrote:
>can any one see a problem with this loop?
>
>  <?
>$db = include"connect.inc";
>$foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";
>
> $result = mysql_query($foo,$db);
>
>
>while ( ($myrow = mysql_fetch_array($result) ) ) {
>
>$id = $myrow["id"];
>$card = $myrow["card"];
>$serial = $myrow["serial"];
>$avail = $myrow["avail"];
>$pn = $myrow["pn"];
>$cat = $myrow["cat"];
>$box = $myrow["box"];
>$quote = $myrow["quote"];
>}
>?>
>
>if i call say just $card it only displays the one record (the last
>one)

if you call it after the loop you mean? thats what i would expect to
be there.

>the minute i try to call $myrow["card"]; i get nothing at
>all... any idea's?

outside the loop again? well if the last call to mysql_fetch_array()
returns false, then that sounds right too. you probably mean to do
something inside the loop. here's another tip, use extract:

while ( ($myrow = mysql_fetch_array($result) ) ) {
  extract($myrow);
  echo $card."<br>\n";
}




>I have script identical to this that works perfectly .. only
>difference is this one has different names for the values
>
>Peter Houchin
>[EMAIL PROTECTED]
>=========================================================
>     _____                              __   /\
>    /_/_/_\                            /  |_/  \
>   /_/_/_    __  __  __   __          /         \
>   \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
> ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
> \_//_/_/ /_/_/_/ /_/ \/_/                    v
>     ________   ________________________________________
>    /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>   /_/_ _/_/ ______  __   __  /_/ ____      __     ______
>  /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
> /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
>/_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
>=========================================================
>Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
>************* We rent the dot in .COM!  **************
>






This loop will only return the last record from the db as the variables are
getting overwritten each time through the loop. It would make more sense to
make each variable an array eg:

$id[$i] = $myrow["id"];

or do something with each set of info inside the loop.

Chris

Mark Maggelet wrote:

> On Tue, 17 Apr 2001 15:59:37 +1000, Peter Houchin
> ([EMAIL PROTECTED]) wrote:
> >can any one see a problem with this loop?
> >
> >  <?
> >$db = include"connect.inc";
> >$foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";
> >
> > $result = mysql_query($foo,$db);
> >
> >
> >while ( ($myrow = mysql_fetch_array($result) ) ) {
> >
> >$id = $myrow["id"];
> >$card = $myrow["card"];
> >$serial = $myrow["serial"];
> >$avail = $myrow["avail"];
> >$pn = $myrow["pn"];
> >$cat = $myrow["cat"];
> >$box = $myrow["box"];
> >$quote = $myrow["quote"];
> >}
> >?>
> >
> >if i call say just $card it only displays the one record (the last
> >one)
>
> if you call it after the loop you mean? thats what i would expect to
> be there.
>
> >the minute i try to call $myrow["card"]; i get nothing at
> >all... any idea's?
>
> outside the loop again? well if the last call to mysql_fetch_array()
> returns false, then that sounds right too. you probably mean to do
> something inside the loop. here's another tip, use extract:
>
> while ( ($myrow = mysql_fetch_array($result) ) ) {
>   extract($myrow);
>   echo $card."<br>\n";
> }
>
> >I have script identical to this that works perfectly .. only
> >difference is this one has different names for the values
> >
> >Peter Houchin
> >[EMAIL PROTECTED]
> >=========================================================
> >     _____                              __   /\
> >    /_/_/_\                            /  |_/  \
> >   /_/_/_    __  __  __   __          /         \
> >   \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
> > ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
> > \_//_/_/ /_/_/_/ /_/ \/_/                    v
> >     ________   ________________________________________
> >    /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> >   /_/_ _/_/ ______  __   __  /_/ ____      __     ______
> >  /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
> > /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
> >/_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
> >=========================================================
> >Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
> >************* We rent the dot in .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]

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**********************************************************************

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.






Even better,

$id[] = $myrow["id"];

then count them:

for ($i=0;$i < count($id);$i++) {
..
}

Rom
-----Original Message-----
From: Chris Fry [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 3:00 AM
To: Mark Maggelet
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] baffled :<:<


This loop will only return the last record from the db as the variables are
getting overwritten each time through the loop. It would make more sense to
make each variable an array eg:

$id[$i] = $myrow["id"];

or do something with each set of info inside the loop.

Chris

Mark Maggelet wrote:

> On Tue, 17 Apr 2001 15:59:37 +1000, Peter Houchin
> ([EMAIL PROTECTED]) wrote:
> >can any one see a problem with this loop?
> >
> >  <?
> >$db = include"connect.inc";
> >$foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";
> >
> > $result = mysql_query($foo,$db);
> >
> >
> >while ( ($myrow = mysql_fetch_array($result) ) ) {
> >
> >$id = $myrow["id"];
> >$card = $myrow["card"];
> >$serial = $myrow["serial"];
> >$avail = $myrow["avail"];
> >$pn = $myrow["pn"];
> >$cat = $myrow["cat"];
> >$box = $myrow["box"];
> >$quote = $myrow["quote"];
> >}
> >?>
> >
> >if i call say just $card it only displays the one record (the last
> >one)
>
> if you call it after the loop you mean? thats what i would expect to
> be there.
>
> >the minute i try to call $myrow["card"]; i get nothing at
> >all... any idea's?
>
> outside the loop again? well if the last call to mysql_fetch_array()
> returns false, then that sounds right too. you probably mean to do
> something inside the loop. here's another tip, use extract:
>
> while ( ($myrow = mysql_fetch_array($result) ) ) {
>   extract($myrow);
>   echo $card."<br>\n";
> }
>
> >I have script identical to this that works perfectly .. only
> >difference is this one has different names for the values
> >
> >Peter Houchin
> >[EMAIL PROTECTED]
> >=========================================================
> >     _____                              __   /\
> >    /_/_/_\                            /  |_/  \
> >   /_/_/_    __  __  __   __          /         \
> >   \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
> > ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
> > \_//_/_/ /_/_/_/ /_/ \/_/                    v
> >     ________   ________________________________________
> >    /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> >   /_/_ _/_/ ______  __   __  /_/ ____      __     ______
> >  /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
> > /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
> >/_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
> >=========================================================
> >Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
> >************* We rent the dot in .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]

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**********************************************************************

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.



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





even better:

use foreach!

$id = $myrow["id"];
..
foreach ($id as $loop) {
..
}

-----Original Message-----
From: Chris Fry [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 3:00 AM
To: Mark Maggelet
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] baffled :<:<


This loop will only return the last record from the db as the variables are
getting overwritten each time through the loop. It would make more sense to
make each variable an array eg:

$id[$i] = $myrow["id"];

or do something with each set of info inside the loop.

Chris

Mark Maggelet wrote:

> On Tue, 17 Apr 2001 15:59:37 +1000, Peter Houchin
> ([EMAIL PROTECTED]) wrote:
> >can any one see a problem with this loop?
> >
> >  <?
> >$db = include"connect.inc";
> >$foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";
> >
> > $result = mysql_query($foo,$db);
> >
> >
> >while ( ($myrow = mysql_fetch_array($result) ) ) {
> >
> >$id = $myrow["id"];
> >$card = $myrow["card"];
> >$serial = $myrow["serial"];
> >$avail = $myrow["avail"];
> >$pn = $myrow["pn"];
> >$cat = $myrow["cat"];
> >$box = $myrow["box"];
> >$quote = $myrow["quote"];
> >}
> >?>
> >
> >if i call say just $card it only displays the one record (the last
> >one)
>
> if you call it after the loop you mean? thats what i would expect to
> be there.
>
> >the minute i try to call $myrow["card"]; i get nothing at
> >all... any idea's?
>
> outside the loop again? well if the last call to mysql_fetch_array()
> returns false, then that sounds right too. you probably mean to do
> something inside the loop. here's another tip, use extract:
>
> while ( ($myrow = mysql_fetch_array($result) ) ) {
>   extract($myrow);
>   echo $card."<br>\n";
> }
>
> >I have script identical to this that works perfectly .. only
> >difference is this one has different names for the values
> >
> >Peter Houchin
> >[EMAIL PROTECTED]
> >=========================================================
> >     _____                              __   /\
> >    /_/_/_\                            /  |_/  \
> >   /_/_/_    __  __  __   __          /         \
> >   \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
> > ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
> > \_//_/_/ /_/_/_/ /_/ \/_/                    v
> >     ________   ________________________________________
> >    /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> >   /_/_ _/_/ ______  __   __  /_/ ____      __     ______
> >  /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
> > /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
> >/_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
> >=========================================================
> >Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
> >************* We rent the dot in .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]

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**********************************************************************

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.



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





That's too easy!

Chris

Romulo Roberto Pereira wrote:

> Even better,
>
> $id[] = $myrow["id"];
>
> then count them:
>
> for ($i=0;$i < count($id);$i++) {
> ..
> }
>
> Rom
> -----Original Message-----
> From: Chris Fry [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 17, 2001 3:00 AM
> To: Mark Maggelet
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] baffled :<:<
>
> This loop will only return the last record from the db as the variables are
> getting overwritten each time through the loop. It would make more sense to
> make each variable an array eg:
>
> $id[$i] = $myrow["id"];
>
> or do something with each set of info inside the loop.
>
> Chris
>
> Mark Maggelet wrote:
>
> > On Tue, 17 Apr 2001 15:59:37 +1000, Peter Houchin
> > ([EMAIL PROTECTED]) wrote:
> > >can any one see a problem with this loop?
> > >
> > >  <?
> > >$db = include"connect.inc";
> > >$foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";
> > >
> > > $result = mysql_query($foo,$db);
> > >
> > >
> > >while ( ($myrow = mysql_fetch_array($result) ) ) {
> > >
> > >$id = $myrow["id"];
> > >$card = $myrow["card"];
> > >$serial = $myrow["serial"];
> > >$avail = $myrow["avail"];
> > >$pn = $myrow["pn"];
> > >$cat = $myrow["cat"];
> > >$box = $myrow["box"];
> > >$quote = $myrow["quote"];
> > >}
> > >?>
> > >
> > >if i call say just $card it only displays the one record (the last
> > >one)
> >
> > if you call it after the loop you mean? thats what i would expect to
> > be there.
> >
> > >the minute i try to call $myrow["card"]; i get nothing at
> > >all... any idea's?
> >
> > outside the loop again? well if the last call to mysql_fetch_array()
> > returns false, then that sounds right too. you probably mean to do
> > something inside the loop. here's another tip, use extract:
> >
> > while ( ($myrow = mysql_fetch_array($result) ) ) {
> >   extract($myrow);
> >   echo $card."<br>\n";
> > }
> >
> > >I have script identical to this that works perfectly .. only
> > >difference is this one has different names for the values
> > >
> > >Peter Houchin
> > >[EMAIL PROTECTED]
> > >=========================================================
> > >     _____                              __   /\
> > >    /_/_/_\                            /  |_/  \
> > >   /_/_/_    __  __  __   __          /         \
> > >   \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
> > > ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
> > > \_//_/_/ /_/_/_/ /_/ \/_/                    v
> > >     ________   ________________________________________
> > >    /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> > >   /_/_ _/_/ ______  __   __  /_/ ____      __     ______
> > >  /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
> > > /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
> > >/_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
> > >=========================================================
> > >Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
> > >************* We rent the dot in .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]
>
> --
> Chris Fry
> Quillsoft Pty Ltd
> Specialists in Secure Internet Services and E-Commerce Solutions
> 10 Gray Street
> Kogarah
> NSW  2217
> Australia
>
> Phone: +61 2 9553 1691
> Fax: +61 2 9553 1692
> Mobile: 0419 414 323
> eMail: [EMAIL PROTECTED]
> http://www.quillsoft.com.au
>
> You can download our Public CA Certificate from:-
> https://ca.secureanywhere.com/htdocs/cacert.crt
>
> **********************************************************************
>
> This information contains confidential information intended only for
> the use of the authorised recipient.  If you are not an authorised
> recipient of this e-mail, please contact Quillsoft Pty Ltd by return
> e-mail.
> In this case, you should not read, print, re-transmit, store or act
> in reliance on this e-mail or any attachments, and should destroy all
> copies of them.
> This e-mail and any attachments may also contain copyright material
> belonging to Quillsoft Pty Ltd.
> The views expressed in this e-mail or attachments are the views of
> the author and not the views of Quillsoft Pty Ltd.
> You should only deal with the material contained in this e-mail if
> you are authorised to do so.
>
> This notice should not be removed.
>
> --
> PHP General Mailing List (http://www.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]

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**********************************************************************

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.






I made a mistake:

$id = $myrow["id"];

should read:

$id[] = $myrow["id"];

-----Original Message-----
From: Romulo Roberto Pereira [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 3:04 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] baffled :<:<


even better:

use foreach!

$id = $myrow["id"];
.
foreach ($id as $loop) {
.
}

-----Original Message-----
From: Chris Fry [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 3:00 AM
To: Mark Maggelet
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] baffled :<:<


This loop will only return the last record from the db as the variables are
getting overwritten each time through the loop. It would make more sense to
make each variable an array eg:

$id[$i] = $myrow["id"];

or do something with each set of info inside the loop.

Chris

Mark Maggelet wrote:

> On Tue, 17 Apr 2001 15:59:37 +1000, Peter Houchin
> ([EMAIL PROTECTED]) wrote:
> >can any one see a problem with this loop?
> >
> >  <?
> >$db = include"connect.inc";
> >$foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";
> >
> > $result = mysql_query($foo,$db);
> >
> >
> >while ( ($myrow = mysql_fetch_array($result) ) ) {
> >
> >$id = $myrow["id"];
> >$card = $myrow["card"];
> >$serial = $myrow["serial"];
> >$avail = $myrow["avail"];
> >$pn = $myrow["pn"];
> >$cat = $myrow["cat"];
> >$box = $myrow["box"];
> >$quote = $myrow["quote"];
> >}
> >?>
> >
> >if i call say just $card it only displays the one record (the last
> >one)
>
> if you call it after the loop you mean? thats what i would expect to
> be there.
>
> >the minute i try to call $myrow["card"]; i get nothing at
> >all... any idea's?
>
> outside the loop again? well if the last call to mysql_fetch_array()
> returns false, then that sounds right too. you probably mean to do
> something inside the loop. here's another tip, use extract:
>
> while ( ($myrow = mysql_fetch_array($result) ) ) {
>   extract($myrow);
>   echo $card."<br>\n";
> }
>
> >I have script identical to this that works perfectly .. only
> >difference is this one has different names for the values
> >
> >Peter Houchin
> >[EMAIL PROTECTED]
> >=========================================================
> >     _____                              __   /\
> >    /_/_/_\                            /  |_/  \
> >   /_/_/_    __  __  __   __          /         \
> >   \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
> > ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
> > \_//_/_/ /_/_/_/ /_/ \/_/                    v
> >     ________   ________________________________________
> >    /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> >   /_/_ _/_/ ______  __   __  /_/ ____      __     ______
> >  /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
> > /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
> >/_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
> >=========================================================
> >Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
> >************* We rent the dot in .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]

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**********************************************************************

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.



-- 
PHP General Mailing List (http://www.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]





In the loop, try using print_r($myarray) in the loop to see if the data is
in there at all.

Other than that, switch the while loop to:

while ($myrow = mysql_fetch_assoc($result)) {


That should fix it...


--
Plutarck
Should be working on something...
...but forgot what it was.


""Peter Houchin"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> can any one see a problem with this loop?
>
>   <?
> $db = include"connect.inc";
> $foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";
>
>  $result = mysql_query($foo,$db);
>
>
> while ( ($myrow = mysql_fetch_array($result) ) ) {
>
> $id = $myrow["id"];
> $card = $myrow["card"];
> $serial = $myrow["serial"];
> $avail = $myrow["avail"];
> $pn = $myrow["pn"];
> $cat = $myrow["cat"];
> $box = $myrow["box"];
> $quote = $myrow["quote"];
> }
> ?>
>
> if i call say just $card it only displays the one record (the last one),
the minute i try to call $myrow["card"]; i get nothing at all... any idea's?
>
> I have script identical to this that works perfectly .. only difference is
this one has different names for the values
>
> Peter Houchin
> [EMAIL PROTECTED]
> =========================================================
>      _____                              __   /\
>     /_/_/_\                            /  |_/  \
>    /_/_/_    __  __  __   __          /         \
>    \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
>  ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
>  \_//_/_/ /_/_/_/ /_/ \/_/                    v
>      ________   ________________________________________
>     /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>    /_/_ _/_/ ______  __   __  /_/ ____      __     ______
>   /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
>  /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
> /_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
> =========================================================
> Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
> ************* We rent the dot in .COM!  **************
>






On Tuesday 17 April 2001 07:59, you wrote:
> can any one see a problem with this loop?

> while ( ($myrow = mysql_fetch_array($result) ) ) {
> 
> $id = $myrow["id"];
> $card = $myrow["card"];
> $serial = $myrow["serial"];
> $avail = $myrow["avail"];
> $pn = $myrow["pn"];
> $cat = $myrow["cat"];
> $box = $myrow["box"];
> $quote = $myrow["quote"];
> }
> ?>
> 
> if i call say just $card it only displays the one record (the last
> one), the minute i try to call $myrow["card"]; i get nothing at all...
> any idea's?
 

Sure. Let's say you pull 4 records from the DB, with the "card" field set 
to "A", "B", "C" and "D" respectively. Now you loop over the records, 
setting $card to "A", then setting $card to "B", then to "C" and finally 
to "D". In other words: in each iteration you overwrite all previous 
values

> I have script identical to this that works perfectly .. only difference
> is this one has different names for the values
 

I don't believe that, sorry :)

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

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead





""Peter Houchin"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> can any one see a problem with this loop?
>
>   <?
> $db = include"connect.inc";
> $foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";
>
>  $result = mysql_query($foo,$db);
>
>
> while ( ($myrow = mysql_fetch_array($result) ) ) {
>
> $id = $myrow["id"];
> $card = $myrow["card"];
> $serial = $myrow["serial"];
> $avail = $myrow["avail"];
> $pn = $myrow["pn"];
> $cat = $myrow["cat"];
> $box = $myrow["box"];
> $quote = $myrow["quote"];
> }

If you are doing print $myrow["card"] here, $myrow at this point is false,
so that's why you see nothing. It's reset to false by the final $myrow =
mysql_fetch_array($result).

Here's wishing you more sleep and less debugging next time :-)

Regards, John

> ?>
>
> if i call say just $card it only displays the one record (the last one),
the minute i try to call $myrow["card"]; i get nothing at all... any idea's?
>
> I have script identical to this that works perfectly .. only difference is
this one has different names for the values
>
> Peter Houchin
> [EMAIL PROTECTED]
> =========================================================
>      _____                              __   /\
>     /_/_/_\                            /  |_/  \
>    /_/_/_    __  __  __   __          /         \
>    \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
>  ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
>  \_//_/_/ /_/_/_/ /_/ \/_/                    v
>      ________   ________________________________________
>     /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>    /_/_ _/_/ ______  __   __  /_/ ____      __     ______
>   /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
>  /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
> /_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
> =========================================================
> Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
> ************* We rent the dot in .COM!  **************
>






Hello,

I was wondering if anybody have developed something related to dynamic web
pages building and administration. I need to store the content of the site
in the database and later as the user navigate, mount the content using
templates. This part is easy, since PHP is very powerfull in this area. My
problem would be to let the user modify the actual page content... how? any
ideas?

TIA,

Rom





We all are working on something like this.

Search Source Forge to get some better ideas.

Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-----Original Message-----
From: Romulo Roberto Pereira [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 3:53 PM
To: Php-General
Subject: [PHP] Dynamic built web pages administration


Hello,

I was wondering if anybody have developed something related to dynamic web
pages building and administration. I need to store the content of the site
in the database and later as the user navigate, mount the content using
templates. This part is easy, since PHP is very powerfull in this area. My
problem would be to let the user modify the actual page content... how? any
ideas?

TIA,

Rom


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




Rom.

""Romulo Roberto Pereira"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I was wondering if anybody have developed something related to dynamic web
> pages building and administration. I need to store the content of the site
> in the database and later as the user navigate, mount the content using
> templates. This part is easy, since PHP is very powerfull in this area. My
> problem would be to let the user modify the actual page content... how?
any
> ideas?
>
> TIA,
>
> Rom

I don't know if I can answer your question thoroughly in a short space, but
suffice it to say that you'd have to provide web pages (hopefully properly
configured for proper access restrictions) where your users can edit content
in a text area (for instance) that, when submitted, updates the content in
the database.

I'm sure there are some good projects (content management systems) that do
this on SourceForge. I'm writing a web application platform (not on
Sourceforge yet) called WunSite, but content management like this is
optional in mine and is not the focus of WunSite.

Dean.
http://hall.apt7.com






If you are storing the content in a database, your job is a ton easier.

Just add an edit link on the page you want people to be able to edit. It
will link over to an edit page with the value of the current page sent in
the URL via get.

Get the content from the database pointed to by the url, and stick it in a
variable.

On the edit page have a text area. Set the "value" to the content the person
can edit.

When someone clicks submit, just take the content they submit and stuff it
into the database using UPDATE.

Of course you will need to do safety features like stripslashes() or the
special character functions before storing the data, just to be safe. You
will also want to have the option only available for registered users, and
you probably want to limit it to users you know won't be malicious.

There are many little tricks like using a little piece of javascript to
execute a file on the hard drive that shouldn't be executed, malicious
ActiveX controls, java applets, etc, that you don't want users writing to
the page.

But for administration used by only trusted people, it's actually pretty
simple to put together. For use by people who aren't trusted...


--
Plutarck
Should be working on something...
...but forgot what it was.


""Romulo Roberto Pereira"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I was wondering if anybody have developed something related to dynamic web
> pages building and administration. I need to store the content of the site
> in the database and later as the user navigate, mount the content using
> templates. This part is easy, since PHP is very powerfull in this area. My
> problem would be to let the user modify the actual page content... how?
any
> ideas?
>
> TIA,
>
> Rom
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






dear Plutark,

Thank you for your input.

But, let's say that I have the following:

<span class="textdisplayplain">
 some text some text some text some text some text some text some text some
text
 some text some text some text some text some text some text some text some
text
 some text some text <b>some text</b> some text some text some text some
text
 some text some text some text some text some text some text some text some
text
</span>
<br><br>
<span class="textdisplayplain">
 some text some text some text some text some text some text some text some
text
 some text some text some text some text some text some text some text some
text
 some text some text <b>some text</b> some text some text some text some
text
 some text some text some text some text some text some text some text some
text
</span>

My user don't know html. At all... So how do I do to create an edit admin
that let him only modify the text?

I did something like this:

<span class="textdisplayplain">
<!-- text entry start -->
 some text some text some text some text some text some text some text some
text
 some text some text some text some text some text some text some text some
text
 some text some text <b>some text</b> some text some text some text some
text
 some text some text some text some text some text some text some text some
text
<!-- text entry end -->
</span>
<br><br>
<span class="textdisplayplain">
<!-- text entry start -->
 some text some text some text some text some text some text some text some
text
 some text some text some text some text some text some text some text some
text
 some text some text <b>some text</b> some text some text some text some
text
 some text some text some text some text some text some text some text some
text
<!-- text entry end -->
</span>

It works fine, because I identify the edit areas by the comment tags.
The problem with this is that if I put an option like Add New Page to the
admin system, the user would have to surround the tags with the comments, I
mean, he would have to edit the HTML.

Pretty toff thing!!!

Jesus!!

Thank you,

Rom

-----Original Message-----
From: Plutarck [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 10:25 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Dynamic built web pages administration


If you are storing the content in a database, your job is a ton easier.

Just add an edit link on the page you want people to be able to edit. It
will link over to an edit page with the value of the current page sent in
the URL via get.

Get the content from the database pointed to by the url, and stick it in a
variable.

On the edit page have a text area. Set the "value" to the content the person
can edit.

When someone clicks submit, just take the content they submit and stuff it
into the database using UPDATE.

Of course you will need to do safety features like stripslashes() or the
special character functions before storing the data, just to be safe. You
will also want to have the option only available for registered users, and
you probably want to limit it to users you know won't be malicious.

There are many little tricks like using a little piece of javascript to
execute a file on the hard drive that shouldn't be executed, malicious
ActiveX controls, java applets, etc, that you don't want users writing to
the page.

But for administration used by only trusted people, it's actually pretty
simple to put together. For use by people who aren't trusted...


--
Plutarck
Should be working on something...
..but forgot what it was.


""Romulo Roberto Pereira"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I was wondering if anybody have developed something related to dynamic web
> pages building and administration. I need to store the content of the site
> in the database and later as the user navigate, mount the content using
> templates. This part is easy, since PHP is very powerfull in this area. My
> problem would be to let the user modify the actual page content... how?
any
> ideas?
>
> TIA,
>
> Rom
>
>
> --
> PHP General Mailing List (http://www.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]





In article <012101c0c69b$b01b8d00$8b1412d1@null>,
 [EMAIL PROTECTED] ("Chris Anderson") wrote:

> I tried it, even with the byte length identifer it worked perfectly for me.
> As a last ditch effort try changing the w to w+. If not then it sounds like
> a configuration issue for the webserver or php. Dunno what settings though,
> sorry couldn't be of more help.

Thanks for testing.  Was that with v4.0.4pl?  I'd sure like to know whether 
there's any possbility it's bug.  Seems unlikely, but then again so does 
the stubborness of frwite() in choosing its own content to write in place 
of mine.  I've pored over phpinfo and php.ini trying to find a config 
setting that might be causing this weirdness, but so far nothing seems 
obvious.

-- 
CC




Previous post does not address how to avoid making this kind of security hole. Anyway, if anyone want to avoid creating security hole like this. Do not stripslashes() added by magic_quote. If you use stripslashes(), use addslashes() again. If you do not use magic_quote, use addslashes() before feeding to database, shell or whatever that might be dangerous w/o slashes. Disabling magic quote will reduce amount of code and increase performance a little, unless application is very small. Without magic_quote, script does not have to get rid of slashes to use value from browser and add slashes again before feeding to database. Code would be cleaner and easier to read also. (Especially for programmers are not used to PHP.) Hope this helps someone. -- Yasuo Ohgaki ""Yasuo Ohgaki"" <[EMAIL PROTECTED]> wrote in message 9bg8tl$rvl$[EMAIL PROTECTED]">news:9bg8tl$rvl$[EMAIL PROTECTED]... > If you strip slashes, it will make a security hole. > > For example, > > SELECT * FROM tablename WHERE name = '$name'; > what if $name is > \'garbage\';DROP TABLE tablename;SELECT \'something > > After stripslashes($name) > SELECT * FROM table WHERE name = 'garbage';DROP TABLE tablename;SELECT > 'something'; > > Regards, > -- > Yasuo Ohgaki > > > ""Noah Spitzer-Williams"" <[EMAIL PROTECTED]> wrote in message > 9bf7ec$m1m$[EMAIL PROTECTED]">news:9bf7ec$m1m$[EMAIL PROTECTED]... > > would there be any problems caused if i used the stripslashes() function on > > all posted variables from a form to eliminate sql query errors? > > > > - Noah > > > > > > > > -- > > PHP General Mailing List (http://www.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] >



> Disabling magic quote will reduce amount of code and increase > performance a little, unless application is very small. Without > magic_quote, script does not have to get rid of slashes to use > value from browser and add slashes again before feeding to > database. Code would be cleaner and easier to read also. > (Especially for programmers are not used to PHP.) And, you should never assume magic quotes is on or off. If you're developing for an environment you cannot control, but using an environment that you CAN control, you should code around magic quotes' presence or absence as neccessary: <? if (!get_magic_quotes_gpc()) { // Magic quotes is off $variable = addslashes($variable) } // Now it's safe to do a DB insertion. ?> This code would happily exist on servers both with and without magic quotes enabled. Jason



So sprach Shaun am Mon, Apr 16, 2001 at 06:53:40PM -0500:
> this
> while($row = mysql_fetch_object($rs)){
>      echo '<option value="';
>      echo $device;
>      echo '">'; 
>      echo $device; 
>       echo '</option>\n'; 
>    } 
> 
> should be

while($row = mysql_fetch_object($rs)){  
     echo '<option value="';  
     echo $row->device;
     echo '">';      
     echo $row->device; 
        echo '</option>\n';
   }  
  
*G*

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 10 hours 19 minutes




So sprach Jason Murray am Tue, Apr 17, 2001 at 11:55:44AM +1000:
> Brief correction.
> 
> >   while($row = mysql_fetch_row($rs))
> 
>                              ^^^ should be "array".

Why should it be array and not, let's say, object?

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 10 hours 20 minutes




> > >   while($row = mysql_fetch_row($rs))
> > 
> >                              ^^^ should be "array".
> 
> Why should it be array and not, let's say, object?

Because I went on to use it as if I'd used fetch_array in the rest
of the example code, I'd wager. 

:)

Jason




I had that same problem.

Use the "distinct" keyword in your SQL query.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Peter Houchin"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> One thing I've come across and forgot to mention is
>
> say in my db i have multiple values that are the same as well as different
values... how can i restrict it to showing each value just once?
>
> -----Original Message-----
> From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 17, 2001 10:17 AM
> To: Peter Houchin
> Cc: Php-General@Lists. Php. Net
> Subject: Re: [PHP] Populating HTML List boxes From DB
>
>
> So sprach Peter Houchin am Tue, Apr 17, 2001 at 10:08:36AM +1000:
> > 1: is there a way to populate a list box from a db?
>
> Sure.
>
> >
> > 2: if some one could point me in the right direction, with out actually
giving a example, as to how to go about it as i've
> >    got no idea
>
> Uhm, no example?  I'll try.  ... failed *G*
>
> <select name="Listbox" size="42"><?php
>   $query = "SELECT ListboxText, ListboxValue FROM Table";
>   $rs = mysql_select( $query );
>   while( $row = mysql_fetch_object( $rs ) ){
>     echo '<option value="';
>     echo htmlentities( $row->ListboxValue );
>     echo '">';
>     echo htmlentities( $row->ListboxText );
>   }
> ?></select>
>
> Alexander Skwar
> --
> How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
> Homepage: http://www.digitalprojects.com   |   http://www.iso-top.de
>    iso-top.de - Die günstige Art an Linux Distributionen zu kommen
> Uptime: 2 hours 3 minutes
>






How to unsubscribe?
In typical lists, there is a small info how to unsubscribe. In the
php-general list, this is not the case.
Several effords failed.
Who can unsubscribe "manually"?
Best regards,
Joachim
[EMAIL PROTECTED]
[EMAIL PROTECTED]





See the footer below...


Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-----Original Message-----
From: Joachim Fuchs [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 5:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to unsubscribe


How to unsubscribe?
In typical lists, there is a small info how to unsubscribe. In the
php-general list, this is not the case.
Several effords failed.
Who can unsubscribe "manually"?
Best regards,
Joachim
[EMAIL PROTECTED]
[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]




On Tue, Apr 17, 2001 at 10:40:07AM +0200, Joachim Fuchs wrote:

> In typical lists, there is a small info how to unsubscribe. In the
> php-general list, this is not the case.

take a look at the 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]

-fkr
-- 
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0 
  |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE  |
  |all your base are belong to us  |  shame on me  | fkr@IRCnet | 





At 17:56 17-4-01 +0900, Maxim Maletsky wrote:
>See the footer below...

Yeah, or learn to read headers:
list-help: <mailto:[EMAIL PROTECTED]>
list-unsubscribe: <mailto:[EMAIL PROTECTED]>
list-post: <mailto:[EMAIL PROTECTED]>

You see..

Bye,


B.





what is ZOPE?
can you give me a URL about it?

-elias
""Romulo Roberto Pereira"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello!
>
> Any comments in PHP for Zope? I don't know much thought... Some people
told
> me that Zope is good a while ago... And I saw that know they have a PHP
> layer... How good is this?
>
> Thank you,
>
> Rom
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






On Tue, Apr 17, 2001 at 11:51:52AM -0700, elias wrote:

> what is ZOPE?

Content Management System (CMS) written in python, I believe.

> can you give me a URL about it?

http://www.zope.org/

-fkr
-- 
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0 
  |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE  |
  |all your base are belong to us  |  shame on me  | fkr@IRCnet | 

PGP signature





Look at http://www.zope.org
and http://weblogs.userland.com/zopeNewbies/

have fun :-)

Moody

----- Original Message -----
From: "elias" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2001 7:51 PM
Subject: Re: [PHP] ZOPE PHP


> what is ZOPE?
> can you give me a URL about it?
>
> -elias
> ""Romulo Roberto Pereira"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hello!
> >
> > Any comments in PHP for Zope? I don't know much thought... Some people
> told
> > me that Zope is good a while ago... And I saw that know they have a PHP
> > layer... How good is this?
> >
> > Thank you,
> >
> > Rom
> >
> >
> > --
> > PHP General Mailing List (http://www.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]





Hi!

Is there a way to get the time the database needed for execution a statement?
I use MySQL and PHP...

-- 
Berthold Tenhumberg
 
(live long and prosper...)




Have you tried EXPLAIN ?

EXPLAIN
        SELECT
                *
        FROM 
                tables
        WHERE
                this='this'     AND
                that='that'
        ORDER BY
                this, that
;

A query like this would return you some of the stats. Catch the time it
gives you and vuale...
not sure though, it might be useless if the time taken to do that is
equivalent as to select pulling the results out. (think it is)


Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-----Original Message-----
From: B. Tenhumberg [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 5:44 PM
To: PHP General
Cc: MySQL
Subject: [PHP] Time needed for a SQL-statement


Hi!

Is there a way to get the time the database needed for execution a
statement?
I use MySQL and PHP...

-- 
Berthold Tenhumberg
 
(live long and prosper...)

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






"B. Tenhumberg" schrieb:
> Is there a way to get the time the database needed for execution a statement?
> I use MySQL and PHP...

Hmm, how about metering the overall time required by mysql_query() using
microtime(), http://www.php.net/manual/en/function.microtime.php. As
long as there's no network bottleneck between the database (server) and
the application (server) you should be able to use that time as an
approximate value.

Ulf

-- 
Neu: PEAR Menu 3 - Navigationsstrukturen dynamisch dargestellt
http://www.ulf-wendel.de/projekte/menu/tutorial.php |
http://www.phpdoc.de




Is the anti-recursion feature you mention automatically activated or do you need to 
configure it to take effect?

This error with print_r is documented in the manual, but would still be (have been) an 
easy trap to fall into!

-----Original Message-----
From: Plutarck [mailto:[EMAIL PROTECTED]]
Sent: 14 April 2001 12:59
To: [EMAIL PROTECTED]
Subject: A slightly amusing, though mostly dangerous, endless loop


This is a bug which was apparently fixed in v 4.0.4pl1 at least, but it
still present in 4.0.3

I just found it kind of amusing and it makes a nice warning.

Consider this:

print_r($GLOBALS);


That's it. It prints all the variables available, however part of it is an
array called GLOBALS. Which then prints all available variables, including
an array called GLOBALS...

And it will continue until you hit the Stop button or until the script times
out. But if you have ignore.user.abort on, it will continue till it times
out. If you've screwed with your scripts timeout settings...

...so be wary of that, and ensure you don't try and print out the variables
available in GLOBALS in older versions of PHP. It was fixed with the
anti-recursion feature, which automatically breaks endless loops.



--
Plutarck
Should be working on something...
...but forgot what it was.






**************************************************************************
Any opinions expressed in this email are those of the individual and 
not necessarily the Company. This email and any files transmitted with 
it, including replies and forwarded copies (which may contain alterations) 
subsequently transmitted from the Company, are confidential and solely for 
the use of the intended recipient. If you are not the intended recipient 
or the person responsible for delivering to the intended recipient, be 
advised that you have received this email in error and that any use is 
strictly prohibited.

**************************************************************************




It's automatically enabled, and I don't think it's available for disabling.
I recall hearing something about a feature being added to PHP to help
prevent infinate loops, and it apparently works with print_r.

It should probably be listed more prominately and in any place where
$GLOBALS is mentioned.

The first time I saw it I was thinking, "Geeze, this page sure is taking a
long time to load...and why are so many variables available on this site..."


--
Plutarck
Should be working on something...
...but forgot what it was.


""Greig, Euan"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is the anti-recursion feature you mention automatically activated or do
you need to configure it to take effect?
>
> This error with print_r is documented in the manual, but would still be
(have been) an easy trap to fall into!
>
> -----Original Message-----
> From: Plutarck [mailto:[EMAIL PROTECTED]]
> Sent: 14 April 2001 12:59
> To: [EMAIL PROTECTED]
> Subject: A slightly amusing, though mostly dangerous, endless loop
>
>
> This is a bug which was apparently fixed in v 4.0.4pl1 at least, but it
> still present in 4.0.3
>
> I just found it kind of amusing and it makes a nice warning.
>
> Consider this:
>
> print_r($GLOBALS);
>
>
> That's it. It prints all the variables available, however part of it is an
> array called GLOBALS. Which then prints all available variables, including
> an array called GLOBALS...
>
> And it will continue until you hit the Stop button or until the script
times
> out. But if you have ignore.user.abort on, it will continue till it times
> out. If you've screwed with your scripts timeout settings...
>
> ...so be wary of that, and ensure you don't try and print out the
variables
> available in GLOBALS in older versions of PHP. It was fixed with the
> anti-recursion feature, which automatically breaks endless loops.
>
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
>
>
>
>
> **************************************************************************
> Any opinions expressed in this email are those of the individual and
> not necessarily the Company. This email and any files transmitted with
> it, including replies and forwarded copies (which may contain alterations)
> subsequently transmitted from the Company, are confidential and solely for
> the use of the intended recipient. If you are not the intended recipient
> or the person responsible for delivering to the intended recipient, be
> advised that you have received this email in error and that any use is
> strictly 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]
>






Hi,

I've got a couple of questions relating to PDF files.

Firstly, to display a PDF file in your browser, I presume that you must have
a 'plug-in' installed?

Secondly, is it possible to display a PDF file within a table, as I have
only ever seen them fill up the entire browser?

TIA
Alexis





Hi alexis.

Yes, with Internet Explorer equipped with the shell-integration component in
a Windows
environment, this is possible with the Adobe Acrobat plugin.
For Netscape, this is not currently (to my knowledge) an option.
Further, to display a pdf-document in only a part of IE, the easiest way, i
guess, would be
to use frames as a base for Your HTML/PHP-documents.

Best Regards,
Henrik Johansson! 

> ----------
> From:         Alexis Antonakis[SMTP:[EMAIL PROTECTED]]
> Reply To:     [EMAIL PROTECTED]
> Sent:         den 17 april 2001 11:32
> To:   Php-General@Lists. Php. Net
> Subject:      [PHP] 'Embedding' a PDF file
> 
> Hi,
> 
> I've got a couple of questions relating to PDF files.
> 
> Firstly, to display a PDF file in your browser, I presume that you must
> have
> a 'plug-in' installed?
> 
> Secondly, is it possible to display a PDF file within a table, as I have
> only ever seen them fill up the entire browser?
> 
> TIA
> Alexis
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 




Joseph.

"Joseph Blythe" <[EMAIL PROTECTED]> wrote:
...
> Ok fine, I now have an associative array with a numeric index, but
> hangon I wanted to push the key => value into the array. How would I do
> this, I have tried a couple of things but am having some really crazy
> results ;-)

'array_push' is only useful for numerically-indexed arrays. It's basically a
shortcut for getting the length of the array and putting a value in the last
available spot in an array. It treats the array like a stack.

In an associative array (or hash), the array is indexed by strings, so the
order you input them in is irrelevant (for the most part). I think in PHP
you can actually retrieve the values in the same order as you put them in,
but this does not have to be the case. Hash keys should be arbitrarily
ordered.

> $input = array();
> while ( list($key, $val) = each($HTTP_POST_VARS) ) {
>   if ( $key != "Submit" )  {
>   array_push($input, $val);
>   }
> }

Instead of 'array_push', do this:

$input[$key] = $val;

Dean
http://hall.apt7.com








""Boget, Chris"" <[EMAIL PROTECTED]> wrote:
> Can you use the above function to set the error
> handler to a custom class?  If so, how?  I've been
> having no luck no matter what I do...
>
> Chris

Chris.

I tried doing something like:

set_error_handler("Error::handleError");

myself, and to no avail. It seems that the namespace resolution in PHP is
still very primitive. I know "Error::handleError()" will work in normal
context, but it doesn't seem to work in dynamic evaluations. Perhaps when
PHP gets real namespace support.

Dean.
http://hall.apt7.com






> ""Boget, Chris"" <[EMAIL PROTECTED]> wrote:
> > Can you use the above function to set the error
> > handler to a custom class?  If so, how?  I've been
> > having no luck no matter what I do...
> I tried doing something like:
> set_error_handler("Error::handleError");
> myself, and to no avail. It seems that the namespace 
> resolution in PHP is still very primitive. I know 
> "Error::handleError()" will work in normal context, 
> but it doesn't seem to work in dynamic evaluations. 
> Perhaps when PHP gets real namespace support.

Well, in the mean time, I found a way around it that
seems to work ok. :P  What I did is included in the
last message I sent in this thread.

Chris




I am trying to write a little search script to search a mysql db.

I would like to highlight the search words for the displayed results, like
sourceforge etc...

After a little help, I have got it to hightlight when searching for one
word. The problem is if I do a search for more than one word it repeats the
hightlighting.

here's the code I got so far

$bg = explode("%",$string);
        while($db->next_record())
        {
                $title = $db->f("title");
                $des = $db->f("description");
                for($z=0; $z <  count($bg); $z++)
                {
                        if(next($bg) == false)
                        {
                                reset($bg);
                        }
                $bgstring = current($bg);
                $title = preg_replace("/($bgstring+)/ie", "'<span
class=highlight>\\1</span>'", $title);
                $des = preg_replace ("/($bgstring+)/ie", "'<span
class=highlight>\\1</span>'", $des);
                }
                echo $title.NL;
                echo $des.NL.NL;

        }
The problem is is I search for class or span it screws up the code as it
replaces the span or class in the original tag.

How could I stop this?
I know this another rex ex thing and I'm gonna get the oreilly book when I'm
next in the city but untill then it's driving me bonkers.

TIA

M@





I was playing around with various ways of doing conditional output of text, and I 
tried the following. 

<?php
$test="b";
if ($test=="a"):
?>
   value is a
<?php
else:
?>
   value is not a
<?php
endif;
?>

It seems to work, ie it outputs different text depending on the value of $test. But is 
it safe, can I rely on this behaviour? Maybe I just missed something somewhere, but I 
thought I would have to use echo or print in such circumstances. It'll be nice if I 
was wrong.

Euan Greig
Technical Consultant
BRANN DATA
[EMAIL PROTECTED]
01285 645997





**************************************************************************
Any opinions expressed in this email are those of the individual and 
not necessarily the Company. This email and any files transmitted with 
it, including replies and forwarded copies (which may contain alterations) 
subsequently transmitted from the Company, are confidential and solely for 
the use of the intended recipient. If you are not the intended recipient 
or the person responsible for delivering to the intended recipient, be 
advised that you have received this email in error and that any use is 
strictly prohibited.

**************************************************************************




> <?php
> $test="b";
> if ($test=="a"):
> ?>
>    value is a
> <?php
> else:
> ?>
>    value is not a
> <?php
> endif;
> ?>
> 
> It seems to work, ie it outputs different text depending on 
> the value of $test. But is it safe, can I rely on this 
> behaviour? 

Yes can rely on it, but I just think it's somewhat ugly. If I'm combing
through a file looking for outputs, stepping through multiple ?> and <?php
tags is very annoying.

Jason




Thanks for that Jason (and so quick!). I agree it's ugly, but I can see it being 
useful occasionally.

Euan

-----Original Message-----
From: Jason Murray [mailto:[EMAIL PROTECTED]]
Sent: 17 April 2001 12:38
To: 'Greig, Euan'; [EMAIL PROTECTED]
Subject: RE: [PHP] Is this kind of code safe?


> <?php
> $test="b";
> if ($test=="a"):
> ?>
>    value is a
> <?php
> else:
> ?>
>    value is not a
> <?php
> endif;
> ?>
> 
> It seems to work, ie it outputs different text depending on 
> the value of $test. But is it safe, can I rely on this 
> behaviour? 

Yes can rely on it, but I just think it's somewhat ugly. If I'm combing
through a file looking for outputs, stepping through multiple ?> and <?php
tags is very annoying.

Jason


**************************************************************************
Any opinions expressed in this email are those of the individual and 
not necessarily the Company. This email and any files transmitted with 
it, including replies and forwarded copies (which may contain alterations) 
subsequently transmitted from the Company, are confidential and solely for 
the use of the intended recipient. If you are not the intended recipient 
or the person responsible for delivering to the intended recipient, be 
advised that you have received this email in error and that any use is 
strictly prohibited.

**************************************************************************




Don't use that on such small outputs, simply for the reason that it's really
hard to read and follow. It also screws up Syntax highlighting.

However, it works just like you would hope it would. When you call an ending
tag, PHP just outputs whatever is there without parsing it. But it doesn't
forget what it was doing, and will pick up right where it left off once you
call an opening tag.

But it can be pretty useful so you don't have to use here-doc printing, or
escape a bunch of things inside of a string.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Greig, Euan"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Thanks for that Jason (and so quick!). I agree it's ugly, but I can see it
being useful occasionally.
>
> Euan
>
> -----Original Message-----
> From: Jason Murray [mailto:[EMAIL PROTECTED]]
> Sent: 17 April 2001 12:38
> To: 'Greig, Euan'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Is this kind of code safe?
>
>
> > <?php
> > $test="b";
> > if ($test=="a"):
> > ?>
> >    value is a
> > <?php
> > else:
> > ?>
> >    value is not a
> > <?php
> > endif;
> > ?>
> >
> > It seems to work, ie it outputs different text depending on
> > the value of $test. But is it safe, can I rely on this
> > behaviour?
>
> Yes can rely on it, but I just think it's somewhat ugly. If I'm combing
> through a file looking for outputs, stepping through multiple ?> and <?php
> tags is very annoying.
>
> Jason
>
>
> **************************************************************************
> Any opinions expressed in this email are those of the individual and
> not necessarily the Company. This email and any files transmitted with
> it, including replies and forwarded copies (which may contain alterations)
> subsequently transmitted from the Company, are confidential and solely for
> the use of the intended recipient. If you are not the intended recipient
> or the person responsible for delivering to the intended recipient, be
> advised that you have received this email in error and that any use is
> strictly 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]
>






On Monday 16 April 2001 20:41, you wrote:
>     I'm looking for comments on this one.  I'm developing a site that
> will have user logins on it.  What's the best way to do this?  What to
> store, and how?
>
>     - Are people more inclined to use a username when they need to log
>       in to something, or would asking for an email (as the userID) be
>       better?

Use usernames. Some people have email addresses with about 50 chars 
(students at my uni e.g. get one like 
[EMAIL PROTECTED]). Nobody likes to type that 
each time to log in.

>     - How about storing passwords?  All of this info will be stored in
>       an MySQL DB.  How do admins generally do this type of stuff?
>       Encrypt the password stored in the DB, and decrypt it on the fly
>       to compare?  Store it in plain text?  Or store it encrypted,
>       and when the user logs in, encrypt that passwd (from the form)
>       and compare the strings?  (not sure if the latter would work)

The last one with a one-way encryption function like md5(). That way (1) 
passwords are stored encrypted and (2) encrypted passwords can not be 
decrypted again. And yes, it does work.

>     - What about sending people passwords through email?  Like when
>       someone signs up the first time, they supply a passwd.  How do
>       people feel about sending that login information to the user in
>       plain text via email?  Or do you?

That's ok. At least there are no real alternatives yet.

>     - What about when the user forgets their login?  Just fetch the
>       info from DB and mail it out to the (registered) email address?

Yup

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

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead




As others suggested, use md5 or one of the mhash functions. You can't
retrieve the password, but you shouldn't need to anyway.

When someone looses their password, get rid of their old one and mail them
their randomly created new one. Then just allow them to change it to
whatever they want.

Make sure to tell them to use a valid email address or require a
confirmation, otherwise when people loose their password they can never get
it back.

People tend to email you when they loose their password, so be sure to make
it clear that "once it's gone, it's really gone, and you just have to pick a
new one".


I try to avoid emailing a user with their password with exception to when
they loose it. Then again, there isn't really much of an alternative...


--
Plutarck
Should be working on something...
...but forgot what it was.


""Ashley M. Kirchner"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>     I'm looking for comments on this one.  I'm developing a site that
> will have user logins on it.  What's the best way to do this?  What to
> store, and how?
>
>     - Are people more inclined to use a username when they need to log
>       in to something, or would asking for an email (as the userID) be
>       better?
>
>     - How about storing passwords?  All of this info will be stored in
>       an MySQL DB.  How do admins generally do this type of stuff?
>       Encrypt the password stored in the DB, and decrypt it on the fly
>       to compare?  Store it in plain text?  Or store it encrypted,
>       and when the user logs in, encrypt that passwd (from the form)
>       and compare the strings?  (not sure if the latter would work)
>
>     - What about sending people passwords through email?  Like when
>       someone signs up the first time, they supply a passwd.  How do
>       people feel about sending that login information to the user in
>       plain text via email?  Or do you?
>
>     - What about when the user forgets their login?  Just fetch the
>       info from DB and mail it out to the (registered) email address?
>       Or, generate a new, generic one, mail that one out, and tell the
>       user to login and change it again?
>
>     Suggestions please.
>
>     AMK4
>
> --
> W |
>   |  I haven't lost my mind; it's backed up on tape somewhere.
>   |____________________________________________________________________
>   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
>   SysAdmin / Websmith                           .     800.441.3873 x130
>   Photo Craft Laboratories, Inc.             .        eFax 248.671.0909
>   http://www.pcraft.com                  .         3550 Arapahoe Ave #6
>   .................. .  .  .     .               Boulder, CO 80303, USA
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Hi all,
I've got this problem with variables. In the code below I've got the
variables: $jaar and $vak, if I echo them they r displayed correctly, but if
the function unlink is called it doesnt seem to know what $jaar and $vak
are. If I do $the_path = "/home/H0RNET/ftp/jaar1/PRO/";  then the function
unlink works just fine.
Do I have to declare the 2 variables again? What is the problem here?

Thx,
H0RNET




<?php
$the_path = "/home/H0RNET/ftp/$jaar/$vak/";

if ($d)
{
unlink ("$the_path$d");
}


$handle = dir($the_path);
$upl = $upl."<table width=\"28%\" border=\"0\">";
    while ($file = $handle->read()) {
        if (($file != ".") && ($file != "..")) {
$con = <<<giveup
<tr><td width="13%" height="2">$file</a>
</td><td width="87%" height="2">
<a href="$PHP_SELF?d=$file">DELETE</a></td></tr>
giveup;
$upl = $upl."$con";
          }
    }
$upl = $upl."</table>";

echo $upl;
?>







hey,

try this...

$the_path = "/home/H0RNET/ftp/" . $jaar . "/" . $vak . "/";

unlink ($the_path . $d);



""Dennis Haller"" <[EMAIL PROTECTED]> wrote in message
9bharm$1td$[EMAIL PROTECTED]">news:9bharm$1td$[EMAIL PROTECTED]...
> Hi all,
> I've got this problem with variables. In the code below I've got the
> variables: $jaar and $vak, if I echo them they r displayed correctly, but
if
> the function unlink is called it doesnt seem to know what $jaar and $vak
> are. If I do $the_path = "/home/H0RNET/ftp/jaar1/PRO/";  then the function
> unlink works just fine.
> Do I have to declare the 2 variables again? What is the problem here?
>
> Thx,
> H0RNET
>
>
>
>
> <?php
> $the_path = "/home/H0RNET/ftp/$jaar/$vak/";
>
> if ($d)
> {
> unlink ("$the_path$d");
> }
>
>
> $handle = dir($the_path);
> $upl = $upl."<table width=\"28%\" border=\"0\">";
>     while ($file = $handle->read()) {
>         if (($file != ".") && ($file != "..")) {
> $con = <<<giveup
> <tr><td width="13%" height="2">$file</a>
> </td><td width="87%" height="2">
> <a href="$PHP_SELF?d=$file">DELETE</a></td></tr>
> giveup;
> $upl = $upl."$con";
>           }
>     }
> $upl = $upl."</table>";
>
> echo $upl;
> ?>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>








Dennis Haller schrieb:
> I've got this problem with variables. In the code below I've got the
> variables: $jaar and $vak, if I echo them they r displayed correctly, but if
> the function unlink is called it doesnt seem to know what $jaar and $vak
> are. If I do $the_path = "/home/H0RNET/ftp/jaar1/PRO/";  then the function
> unlink works just fine.
> Do I have to declare the 2 variables again? What is the problem here?
> 
> Thx,
> H0RNET
> 
> <?php
> $the_path = "/home/H0RNET/ftp/$jaar/$vak/";
> 
> if ($d)
> {
> unlink ("$the_path$d");
> }

What's the value of $d is unlink ever executed? Try unlink($the_path .
$d).

Ulf

-- 
Neu: PEAR Menu 3 - Navigationsstrukturen dynamisch dargestellt
http://www.ulf-wendel.de/projekte/menu/tutorial.php |
http://www.phpdoc.de




On Monday 16 April 2001 22:40, you wrote:
> Hi..
>
>   I'm tring to use a php-script like cgi, but the only thing i got is
> "Internal Server Error..."
>
>  That's my test-script..
> -----------------------------------------------------------
> #!/bin/php -q

Are you 100% sure that it's /bin/php ? That's a pretty unusual location 
for PHP to be installed in. /usr/bin/php or /usr/local/bin/php are the 
common ones


>
> <?php
>  echo "Content-type: text/html\n\n";

unneccessary if you leave out the -q

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

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead





On Tue, 17 Apr 2001, Christian Reiniger wrote:
> Are you 100% sure that it's /bin/php ? That's a pretty unusual location 
> for PHP to be installed in. /usr/bin/php or /usr/local/bin/php are the 
> common ones

Yeah, my php interpreter is on /usr/bin/php, i just made a symlink on
/bin...,  but it's not the  problem, i tried with /usr/bin/php too!

> 
> 
> unneccessary if you leave out the -q
> 
  I note this, i was just in test, 'cos without "q" dos not work too...

  I can execute the script on command line, and i get the expected output, 
but when i request it on my browser i get the Internal Server Error...

    .~.  Ulysses Almeida
   / V \  [EMAIL PROTECTED]
 / (   ) \  Seja livre, use GNU/Linux!
   ^^-^^
 





On Tuesday 17 April 2001 02:10, you wrote:
> So sprach Brian Clark am Mon, Apr 16, 2001 at 08:01:04PM -0400:
> > Ahhh, yes, I see that was stupid. Sorry, Alexander. :)
>
> Ah, thanks Joe for clearing up this confusion :))
>
> Now that this is sorted out:  What might be the best way to do some
> benchmarking wrt. this?  (Links are fine)

run "ab" (comes with apache) on two scripts, one using method A 
repeatedly, the other using method B repeatedly

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

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead




Is there a php equivalent for the use of ` (I think) in Unix/Perl? So for example echo 
"`$x++`" would first evaluate $x++ and then print the resulting value.

Euan Greig
Technical Consultant
BRANN DATA
[EMAIL PROTECTED]
01285 645997





**************************************************************************
Any opinions expressed in this email are those of the individual and 
not necessarily the Company. This email and any files transmitted with 
it, including replies and forwarded copies (which may contain alterations) 
subsequently transmitted from the Company, are confidential and solely for 
the use of the intended recipient. If you are not the intended recipient 
or the person responsible for delivering to the intended recipient, be 
advised that you have received this email in error and that any use is 
strictly prohibited.

**************************************************************************




The backtick operator " ` " is used like an exec() or passthru() function.

But I know what you mean. For instance, try running this in a script:

$n = 1;

echo "The number is: $n++<br>";
echo "The number is: $n++<br>";
echo "The number is: $n++<br>";

PHP will not increment a variable inside of a string. However, now try this:

$n = 1;

echo "The number is: " . $n++ . "<br>";
echo "The number is: " . $n++ . "<br>";
echo "The number is: " . $n++ . "<br>";

But now try this:

$n = 1;

echo "The number is: " . ++$n . "<br>";
echo "The number is: " . ++$n . "<br>";
echo "The number is: " . ++$n . "<br>";


To do what you are wanting to do, just use the post-increment or
pre-increment operators, just like in Perl. Just be aware that PHP will not
do any mathematical functions on variables which are inside of a string.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Greig, Euan"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is there a php equivalent for the use of ` (I think) in Unix/Perl? So for
example echo "`$x++`" would first evaluate $x++ and then print the resulting
value.
>
> Euan Greig
> Technical Consultant
> BRANN DATA
> [EMAIL PROTECTED]
> 01285 645997
>
>
>
>
>
> **************************************************************************
> Any opinions expressed in this email are those of the individual and
> not necessarily the Company. This email and any files transmitted with
> it, including replies and forwarded copies (which may contain alterations)
> subsequently transmitted from the Company, are confidential and solely for
> the use of the intended recipient. If you are not the intended recipient
> or the person responsible for delivering to the intended recipient, be
> advised that you have received this email in error and that any use is
> strictly 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]
>






On Tuesday 17 April 2001 07:10, you wrote:
> RE: PHP as a CGI or Module
>
> This has been discussed some but I am interested to see if one is more
> popular then the other.  My experience has been most people run PHP as
> a apache module but is there a specific benefit to run it as a cgi
> program?  

Modules are *way* faster (I haven't done benchmarks myself, but heard of 
a 10x speed increase compared to CGIs)

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

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead




The only reason I am aware of to use PHP as a CGI is on Windows. Both apache
and the php module for windows apache is considered "beta quality", so most
people don't want to install beta software on their production machine.

But just on my local system I've never had a problem with PHP as CGI. I
honestly thought I had PHP as a module until I re-read my phpinfo, lol. And
I assumed that NuSphere would install it as a module...;)


--
Plutarck
Should be working on something...
...but forgot what it was.


"Franklin Hays" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> RE: PHP as a CGI or Module
>
> This has been discussed some but I am interested to see if one is more
> popular then the other.  My experience has been most people run PHP as a
> apache module but is there a specific benefit to run it as a cgi
> program?  What about very large servers such as web hosts?  I am currently
> wrestling with some issues (apaches global variables) that aren't working
> with php -cgi and wonder if this is a common occurance with php-cgi or
> just a misconfiguration on the hosts end.  Does one version serve the
> pages faster or provide less overhead on the server?
>
> I have read a few FAQ's on this but interested to see what is happening in
> the real world.  Is one form more popular then the other?
>
> //frank
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






If someone wants to run PHP scripts for other purposes then dynamic web
content, say to act like shell scripts, then you'll want to have it be
compiled as a CGI...so, its more than just the windows thing...

-jack

Plutarck wrote:
> 
> The only reason I am aware of to use PHP as a CGI is on Windows. Both apache
> and the php module for windows apache is considered "beta quality", so most
> people don't want to install beta software on their production machine.
> 
> But just on my local system I've never had a problem with PHP as CGI. I
> honestly thought I had PHP as a module until I re-read my phpinfo, lol. And
> I assumed that NuSphere would install it as a module...;)
> 
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
> 
> "Franklin Hays" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > RE: PHP as a CGI or Module
> >
> > This has been discussed some but I am interested to see if one is more
> > popular then the other.  My experience has been most people run PHP as a
> > apache module but is there a specific benefit to run it as a cgi
> > program?  What about very large servers such as web hosts?  I am currently
> > wrestling with some issues (apaches global variables) that aren't working
> > with php -cgi and wonder if this is a common occurance with php-cgi or
> > just a misconfiguration on the hosts end.  Does one version serve the
> > pages faster or provide less overhead on the server?
> >
> > I have read a few FAQ's on this but interested to see what is happening in
> > the real world.  Is one form more popular then the other?
> >
> > //frank
> >
> >
> > --
> > PHP General Mailing List (http://www.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]




Previously, Franklin Hays said:
> 
> RE: PHP as a CGI or Module

Generally people will almost always use the module because it's faster and
simpler, and gives you some IPC kind of advantages that the CGI doesn't
have ("internal" cross-talk with Apache).

Reasons to use the CGI:

1. Windows servers must use CGI form

2. If you want to use command-line PHP scripts you need the CGI form

3. If you want suExec support I believe you need to use the CGI form

 -dan

-- 
If you try to fail, and succeed, which have you done?  -George Carlin




We compiled PHP to be used as a CGI and it's
working great.  However, whenever we run a
php script, the following message gets outputted
at the start of the output:

"X-Powered-By: PHP/4.0.3pl1
Content-type: text/html"

Is there any way we can suppress that message?
I looked all over the docs and missed that info if
it's there.  If the details on how to suppress this
is in the documentation, a link would be most
appreciated (or a link to anywhere else that might
have this info).  Otherwise, any insight would 
be greatly appreciated!

Chris




On Tue, 17 Apr 2001, Boget, Chris wrote:

> We compiled PHP to be used as a CGI and it's
> working great.  However, whenever we run a
> php script, the following message gets outputted
> at the start of the output:
>
> "X-Powered-By: PHP/4.0.3pl1
> Content-type: text/html"
>
> Is there any way we can suppress that message?
> I looked all over the docs and missed that info if
> it's there.  If the details on how to suppress this
> is in the documentation, a link would be most
> appreciated (or a link to anywhere else that might
> have this info).  Otherwise, any insight would
> be greatly appreciated!
>
> Chris
>

Yup!

Just run it with the flag '-q' to QUELL HTML-headers.

Example :

 #! /path/to/php -q
 <?PHP
   print "Hello World!\n";
 ?>

Or just run them with 'php -q script_name'

Good luck

-- 
Knut
------
Knut H. Hassel Nielsen
Principal Engineer / Avdelingsingeniør
Norwegian University of Science and Technology / NTNU
Department of Computer and Information Science / IDI
N-7491 Trondheim, Norway
Phone Office / Telefon jobb : (+47) 73 59 18 46
Fax   Office / Telefax jobb : (+47) 73 59 17 33
Cell. Phone / Mobiltelefon  :       91 59 86 06





Hi! My name is Bruno.

Somebody can tell me how to send the same message to more than one recipient
without repeat de code??

something like

      $corpo.="\n";
      $corpo.="\tData de Saída:\t\t$dt_saida\n\n\n";
      $corpo.="\tClique no link abaixo para visualização da Folha de
Cotação:\n\n";
      $corpo.="\t";
      $remetente="From: [EMAIL PROTECTED]";
      mail(email_one and email_two,$assunto,$corpo,$remetente);


and not 

      $corpo.="\n";
      $corpo.="\tData de Saída:\t\t$dt_saida\n\n\n";
      $corpo.="\tClique no link abaixo para visualização da Folha de
Cotação:\n\n";
      $corpo.="\t";
      $remetente="From: [EMAIL PROTECTED]";
      mail($email_ONE,$assunto,$corpo,$remetente);

      $corpo.="\n";
      $corpo.="\tData de Saída:\t\t$dt_saida\n\n\n";
      $corpo.="\tClique no link abaixo para visualização da Folha de
Cotação:\n\n";
      $corpo.="\t";
      $remetente="From: [EMAIL PROTECTED]";
      mail($email_TWO,$assunto,$corpo,$remetente);




Hi,

I think you can put more than one recipient into the mail-function
by seperating them with a ",". Look in the manual for detailed info.

Johannes

"Bruno Freire" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
454D444FF5C0D211891800A0C98C7D90359A44@SERVIDOR">news:454D444FF5C0D211891800A0C98C7D90359A44@SERVIDOR...
Hi! My name is Bruno.

Somebody can tell me how to send the same message to more than one recipient
without repeat de code??

something like

      $corpo.="\n";
      $corpo.="\tData de Saída:\t\t$dt_saida\n\n\n";
      $corpo.="\tClique no link abaixo para visualização da Folha de
Cotação:\n\n";
      $corpo.="\t";
      $remetente="From: [EMAIL PROTECTED]";
      mail(email_one and email_two,$assunto,$corpo,$remetente);


and not

      $corpo.="\n";
      $corpo.="\tData de Saída:\t\t$dt_saida\n\n\n";
      $corpo.="\tClique no link abaixo para visualização da Folha de
Cotação:\n\n";
      $corpo.="\t";
      $remetente="From: [EMAIL PROTECTED]";
      mail($email_ONE,$assunto,$corpo,$remetente);

      $corpo.="\n";
      $corpo.="\tData de Saída:\t\t$dt_saida\n\n\n";
      $corpo.="\tClique no link abaixo para visualização da Folha de
Cotação:\n\n";
      $corpo.="\t";
      $remetente="From: [EMAIL PROTECTED]";
      mail($email_TWO,$assunto,$corpo,$remetente);







Last time I worked there I had to sleep in my car for a month!
No housing...
Skied like hell tho :)



At 09:33 PM 4/16/01 -0700, you wrote:


>   You'll probably won't get to see the now :-<.
>
>
>__________John Monfort_________________
>_+-----------------------------------+_
>      P E P I E  D E S I G N S
>        www.pepiedesigns.com
>"The world is waiting, are you ready?"
>-+___________________________________+-
>
>On Mon, 16 Apr 2001, Mark Maggelet wrote:
>
> > On Mon, 16 Apr 2001 20:00:27 -0700, Dddogbruce \(@home.com\)
> > ([EMAIL PROTECTED]) wrote:
> > >Whistler's cool!
> >
> > Yeah, and a php job at a ski resort?! Hmm, that's way too good to be
> > true.
> >
> >
> > --
> > PHP General Mailing List (http://www.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]


+ ======================
+ Pierre-Yves Lem@ire
+ E-MedHosting.com
+ (514) 729-8100
+ [EMAIL PROTECTED]
+ ======================





It should be noted that programming facilities are entirely outdoor. But
they do provide those little hand-held vacuums to suck the snow out from
between your keyboard keys.










Nah, I'm just kidding. But it is in Canada, so you will be forced to type
"a\'boot" hundreds of times a day ;)

(a little poke at our canadian friends. Which I am perfectly willing to do,
because I'm waaaaaaay down here on the gulf of mexico, and they'd have to
come through Georgia, Alabama, or Mississippi to come down and disagree with
me. God isn't willing to go through Georgia, Alabama, or Mississippi, so I
think I'm safe ;)


--
Plutarck
Should be working on something...
...but forgot what it was.


"Mark Maggelet" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Mon, 16 Apr 2001 20:00:27 -0700, Dddogbruce \(@home.com\)
([EMAIL PROTECTED]) wrote:
>Whistler's cool!

Yeah, and a php job at a ski resort?! Hmm, that's way too good to be
true.


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







Are you using IE 5.01 by chance? I was having very strange problems with
cookies and headers. 5.00 and 5.5 both worked without problems, however 5.01
has some real bugs. Some of the problems I was having included: cookies not
deleting, executing headers caused PHP to behave abnormally and other
unexplainable random problems. I had these problems on both Win9x and NT but
after upgrading to 5.5 all of the problems went away. Just for the heck of
it I tested 5.00 as well and had no problems.

Good luck,

Dean




-----Original Message-----
From: Pat Hanna [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 5:13 PM
To: php help
Subject: [PHP] cookies


I'm setting cookies for a shopping cart and they are setting fine but they
will not delete. I've tried every way of deleting them and they just won't
go away. Someone please help.
--
Patrick Hanna
Database integration--E-commerce solutions
The Wentworth Company




I had the exact same problem.... Haven't had time to work it though.

-----Original Message-----
From: Chris Fry [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 3:26 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP4.0.4pl1+PdfLib3.03+SCO


Pdflib 3.03 compiles OK and builds a static library -
/usr/local/lib/libpdf.a.

PHP fails to configure - cannot find PDF_show_boxed in the library -
pdflib extension requires pdflib 3.x.

This command is in the library and the header file. Configure finds my
tiff & jpeg library (--with-tiff-dir=/usr/local
--with-jpeg-dir=/usr/local) but is either not finding the library
(--with-pdflib=/usr/local) or is not able to find PDF_show_boxed in the
library.

Can anyone help??

Chris

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**********************************************************************

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.



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




Hello again Dean, Chris,

Snap I'm afraid. I didn't spend too much time on it but it's on the list of
things to do. If I manage to get any further I'll let you know.

If this is urgent though Chris, let me know your exact configure/build
procedure and which versions you're using of the tiff, jpeg etc and also how
you built these. As there's not as many of us on SCO it maybe better if we
put our heads together to get it sorted - you know what they say :o)

Best regards,
- Paul -

----- Original Message -----
From: "Grimes, Dean" <[EMAIL PROTECTED]>
To: "'Chris Fry'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2001 1:36 PM
Subject: RE: [PHP] PHP4.0.4pl1+PdfLib3.03+SCO


> I had the exact same problem.... Haven't had time to work it though.
>
> -----Original Message-----
> From: Chris Fry [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 16, 2001 3:26 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP4.0.4pl1+PdfLib3.03+SCO
>
>
> Pdflib 3.03 compiles OK and builds a static library -
> /usr/local/lib/libpdf.a.
>
> PHP fails to configure - cannot find PDF_show_boxed in the library -
> pdflib extension requires pdflib 3.x.
>
> This command is in the library and the header file. Configure finds my
> tiff & jpeg library (--with-tiff-dir=/usr/local
> --with-jpeg-dir=/usr/local) but is either not finding the library
> (--with-pdflib=/usr/local) or is not able to find PDF_show_boxed in the
> library.
>
> Can anyone help??
>
> Chris
>
> --
> Chris Fry
> Quillsoft Pty Ltd
> Specialists in Secure Internet Services and E-Commerce Solutions
> 10 Gray Street
> Kogarah
> NSW  2217
> Australia
>
> Phone: +61 2 9553 1691
> Fax: +61 2 9553 1692
> Mobile: 0419 414 323
> eMail: [EMAIL PROTECTED]
> http://www.quillsoft.com.au
>
> You can download our Public CA Certificate from:-
> https://ca.secureanywhere.com/htdocs/cacert.crt
>
> **********************************************************************
>
> This information contains confidential information intended only for
> the use of the authorised recipient.  If you are not an authorised
> recipient of this e-mail, please contact Quillsoft Pty Ltd by return
> e-mail.
> In this case, you should not read, print, re-transmit, store or act
> in reliance on this e-mail or any attachments, and should destroy all
> copies of them.
> This e-mail and any attachments may also contain copyright material
> belonging to Quillsoft Pty Ltd.
> The views expressed in this e-mail or attachments are the views of
> the author and not the views of Quillsoft Pty Ltd.
> You should only deal with the material contained in this e-mail if
> you are authorised to do so.
>
> This notice should not be removed.
>
>
>
> --
> PHP General Mailing List (http://www.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]
>
>





Hi All,

I'm in trouble to authenticate each user (using a database).
When the user sucesfully login on your area the php script send a cookie,
and every php script reads this cookie. So when the user log ou the php
script expires the cookie and then the user cannot bookmark the page and
turn back...... but, if the user clicks the 'logout' button, I expire the
cookie e show the main screen, but, by other side, if the user click at
'back button' then he can see the page....... I would like to:

- Each page look for the cookie, even if the back button is pressed.
- If the cookie isn't there, then a 'expires page' is showed....

Which is the better way to do it ???

Thanks in advance,

Marcelo Pereira
Programmer





When using sessions, which you might want to do, PHP automatically sends
header's that tell the user's browser not to bookmark the page.

The reason they can click the back button and see the page is because their
browser is caching the page. If they press the Refresh key they won't be
able to see the page, as long as you check for their cookie on that page
anyway.


So it's not fool proof (nothing is), but use header to send the Pragma:
No-cache setting.

Note: You can't _force_ the browser not to cache the page. You can only
_request_ that it not be cached.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Marcelo Pereira"" <[EMAIL PROTECTED]> wrote in message
006701c0c742$4b843b60$0b01a8c0@hmmg">news:006701c0c742$4b843b60$0b01a8c0@hmmg...
> Hi All,
>
> I'm in trouble to authenticate each user (using a database).
> When the user sucesfully login on your area the php script send a cookie,
> and every php script reads this cookie. So when the user log ou the php
> script expires the cookie and then the user cannot bookmark the page and
> turn back...... but, if the user clicks the 'logout' button, I expire the
> cookie e show the main screen, but, by other side, if the user click at
> 'back button' then he can see the page....... I would like to:
>
> - Each page look for the cookie, even if the back button is pressed.
> - If the cookie isn't there, then a 'expires page' is showed....
>
> Which is the better way to do it ???
>
> Thanks in advance,
>
> Marcelo Pereira
> Programmer
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Easy. Just use fopen('http://localhost/file.asp')  then fread the data you
want.  I do this technique to read Access tables from a Linux box.


""Joe Truong"" <[EMAIL PROTECTED]> wrote in message
9bfd8q$gum$[EMAIL PROTECTED]">news:9bfd8q$gum$[EMAIL PROTECTED]...
> How can i include ASP scripts into PHP files or is it posible?
> thanxz
> -Joe
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






> Easy. Just use fopen('http://localhost/file.asp')  then fread 
> the data you want.  I do this technique to read Access tables 
> from a Linux box.

But that gives you the RESULTS of the ASP script, not the script
itself.

Jason




Im trying to pass a form variable to anouther page with the following:
 <input type="radio" value=<?php echo ('1'.$row[0][0]); ?> name="R1"><?php
echo ($row[0][0]); ?>

Everything works fine if there are no spaces(Buffalo) but if there are
spaces ( San Francisco) I only get the first word.I've never had this
problem before and I dont know what I did.Any suggestions?
Thanks
Mike P
[EMAIL PROTECTED]







Hi,

How about enclose the parameters with quotes ???

See ya,

Marcelo Pereira
Programmer

----- Original Message -----
From: Mike <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2001 10:17 AM
Subject: [PHP] Form Field


> Im trying to pass a form variable to anouther page with the following:
>  <input type="radio" value=<?php echo ('1'.$row[0][0]); ?> name="R1"><?php
> echo ($row[0][0]); ?>
>
> Everything works fine if there are no spaces(Buffalo) but if there are
> spaces ( San Francisco) I only get the first word.I've never had this
> problem before and I dont know what I did.Any suggestions?
> Thanks
> Mike P
> [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]
>
>





        Try this : 
        $urlrow = htmlentities (urlencode($row[0][0]));
        <input type="radio" value=<?php echo ('1'.$urlrow); ?>
name="R1"><?php echo ($urlrow); ?>

(I'm not sure you need urlencode, but htmlentities should help you)




> -----Message d'origine-----
> De:   Marcelo Pereira [SMTP:[EMAIL PROTECTED]]
> Date: mardi 17 avril 2001 15:35
> À:    Mike
> Cc:   [EMAIL PROTECTED]
> Objet:        Re: [PHP] Form Field
> 
> Hi,
> 
> How about enclose the parameters with quotes ???
> 
> See ya,
> 
> Marcelo Pereira
> Programmer
> 
> ----- Original Message -----
> From: Mike <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 17, 2001 10:17 AM
> Subject: [PHP] Form Field
> 
> 
> > Im trying to pass a form variable to anouther page with the following:
> >  <input type="radio" value=<?php echo ('1'.$row[0][0]); ?>
> name="R1"><?php
> > echo ($row[0][0]); ?>
> >
> > Everything works fine if there are no spaces(Buffalo) but if there are
> > spaces ( San Francisco) I only get the first word.I've never had this
> > problem before and I dont know what I did.Any suggestions?
> > Thanks
> > Mike P
> > [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]





What I need to do is append parenthesis to the front and back of
('1'.$row[0][0]), but when I do that it doesn't parse correctly. What I'm
getting now is:
Value=1San Francisco
What I need is:
Value="1San Francisco"
Thanks
Mike P
[EMAIL PROTECTED]


""Mike"" <[EMAIL PROTECTED]> wrote in message
9bhfma$hma$[EMAIL PROTECTED]">news:9bhfma$hma$[EMAIL PROTECTED]...
> Im trying to pass a form variable to anouther page with the following:
>  <input type="radio" value=<?php echo ('1'.$row[0][0]); ?> name="R1"><?php
> echo ($row[0][0]); ?>
>
> Everything works fine if there are no spaces(Buffalo) but if there are
> spaces ( San Francisco) I only get the first word.I've never had this
> problem before and I dont know what I did.Any suggestions?
> Thanks
> Mike P
> [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]
>






Why don't you just put the quotes outside the php?
<input type="radio" value="<?php echo ('1'.$row[0][0]);?>"
name="R1"><?php echo ($row[0][0]);?>
That will give you
<input type="radio" value="foo" name="R1">foo

-jack

Mike wrote:
> 
> What I need to do is append parenthesis to the front and back of
> ('1'.$row[0][0]), but when I do that it doesn't parse correctly. What I'm
> getting now is:
> Value=1San Francisco
> What I need is:
> Value="1San Francisco"
> Thanks
> Mike P
> [EMAIL PROTECTED]
> 
> ""Mike"" <[EMAIL PROTECTED]> wrote in message
> 9bhfma$hma$[EMAIL PROTECTED]">news:9bhfma$hma$[EMAIL PROTECTED]...
> > Im trying to pass a form variable to anouther page with the following:
> >  <input type="radio" value=<?php echo ('1'.$row[0][0]); ?> name="R1"><?php
> > echo ($row[0][0]); ?>
> >
> > Everything works fine if there are no spaces(Buffalo) but if there are
> > spaces ( San Francisco) I only get the first word.I've never had this
> > problem before and I dont know what I did.Any suggestions?
> > Thanks
> > Mike P
> > [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]




The PHP developers are a diverse and perverse  group. You can get them from
http://php4win.de


""SED"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I was downloading the latest version of PHP (Win32 Binaries) for IIS
server,
> but no external extensions are included. Why? Is it not supported for IIS
> server?
>
> I'm having great difficulty adding those extensions manually (editing the
> PHP.ini), I always get errors like following example shows (the file sure
is
> there):
>
> Unable to load dynamic library 'C:\PHP\extensions\php_gd.dll'
> - The specified procedure could not be found.
>
> This happens for other extensions also (which I copied from Apache
> PHP_4.0.4pl1.zip download).
>
> Has anyone experienced the problem I'm having - and if so, how did you
> overcome it?
>
> Regards,
> Sumarlidi Einar Dadason
>
> SED - Graphic Design
>
> ------------------------------------------
> Phone:       (+354) 4615501
> Mobile:      (+354) 8960376
> Fax:         (+354) 4615503
> E-mail:      [EMAIL PROTECTED]
> Homepage:    www.sed.is <- New Homepage!
> ------------------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






I'm horrible at regex's, maybe someone can help me out.

What I'm trying to do is parse a string in the format:  number-number-number
(ex.  1-23123-312039128)

I need to pull that second number, regardless of length

This code returns nothing:

$part = ereg("([0-9]{1})-([0-9])-", $f, $regs);

but

$part = ereg("([0-9]{1})-([0-9]{1,10})-", $f, $regs);

will return the number, but I don't want to take a chance and limit it to 10
characters.  I thought the first bit of code would work.. any ideas what is
wrong?

Thanks,
Chad





try
$part = ereg("([0-9]{1})-([0-9]*)-", $f, $regs);

your original exp was looking for 1 digit followed by a dash follwed by 1 
digit followed by a dash

the * should match 0 or more occurences of the previous match ( in this 
case 0 or more numbers )

you shouldn't need the {1} in there either.

morgan

At 09:36 AM 4/17/2001 -0400, Chad Day wrote:
>$part = ereg("([0-9]{1})-([0-9]{1,10})-", $f, $regs);





This:

ereg("([0-9]{1})-([0-9])-", $f, $regs);

What that means is "Capture a single occurance of 0-9, then a hyphen, then
capture a single occurance of 0-9 if it is imediately folowing by a hyphen."

Try this instead:

([0-9]{1})-([0-9]+)-

The "+" means "one or more". So "[0-9]+" is the same as "[0-9]{1,}". For
instance, "{x,y}" matches at least x amount of characters, but no more than
y amount of characters. Leave y off to match "x or more of the mentioned
characters". But don't forget that comma.


Regex is incredibly hard until you learn it. Then it doesn't seem hard
anymore :)


--
Plutarck
Should be working on something...
...but forgot what it was.


""Chad Day"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm horrible at regex's, maybe someone can help me out.
>
> What I'm trying to do is parse a string in the format:
number-number-number
> (ex.  1-23123-312039128)
>
> I need to pull that second number, regardless of length
>
> This code returns nothing:
>
> $part = ereg("([0-9]{1})-([0-9])-", $f, $regs);
>
> but
>
> $part = ereg("([0-9]{1})-([0-9]{1,10})-", $f, $regs);
>
> will return the number, but I don't want to take a chance and limit it to
10
> characters.  I thought the first bit of code would work.. any ideas what
is
> wrong?
>
> Thanks,
> Chad
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Hi all
I use PHP to query a PostgreSQL database.
Today I know how to query the database with a PHP script, but I have to
establish a connection to the database in each script.

Is there a way to get the following : 
connect.php : a script where the user enters its login and password, and
connect to the DB by the submit button (submit button which action url is
query.php).
query.php : a script that performs a query using the connection from
connect.php

I know that I could send the login/password to the query.php to establish
the connection ; but it is not what I would like (sometimes - often - the
connection time is bigger than the query time itself !)
Thanks for your help !








Ideally you could use pconnect, then save the connection ID into a session.
Then just try and use the connection like that.

That _should_ work. But you may just want to use pconnect and not bother
with the rest...that might be just as good as what you are trying to do.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Picard, Cyril"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all
> I use PHP to query a PostgreSQL database.
> Today I know how to query the database with a PHP script, but I have to
> establish a connection to the database in each script.
>
> Is there a way to get the following :
> connect.php : a script where the user enters its login and password, and
> connect to the DB by the submit button (submit button which action url is
> query.php).
> query.php : a script that performs a query using the connection from
> connect.php
>
> I know that I could send the login/password to the query.php to establish
> the connection ; but it is not what I would like (sometimes - often - the
> connection time is bigger than the query time itself !)
> Thanks for your help !
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Yes... I'm not familiar with sessions. This should be like this ? : 

In connect.php : 
<?php
session_start();
$connect = pg_pConnect("blablabla");
session_register("connect");
<A HREF="query.php?<?=SID"?>clique ici</?>
?>

In query.php
<?php
session_start();
$connect = $HTTP_SESSION_VARS["connect"];
$result = pg_Exec($connect, "SELECT * FROM xyz");
?>


> -----Message d'origine-----
> De:   Plutarck [SMTP:[EMAIL PROTECTED]]
> Date: mardi 17 avril 2001 16:03
> À:    [EMAIL PROTECTED]
> Objet:        Re: [PHP] Persistent connection & many scripts ?
> 
> Ideally you could use pconnect, then save the connection ID into a
> session.
> Then just try and use the connection like that.
> 
> That _should_ work. But you may just want to use pconnect and not bother
> with the rest...that might be just as good as what you are trying to do.
> 
> 
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
> 
> 
> ""Picard, Cyril"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi all
> > I use PHP to query a PostgreSQL database.
> > Today I know how to query the database with a PHP script, but I have to
> > establish a connection to the database in each script.
> >
> > Is there a way to get the following :
> > connect.php : a script where the user enters its login and password, and
> > connect to the DB by the submit button (submit button which action url
> is
> > query.php).
> > query.php : a script that performs a query using the connection from
> > connect.php
> >
> > I know that I could send the login/password to the query.php to
> establish
> > the connection ; but it is not what I would like (sometimes - often -
> the
> > connection time is bigger than the query time itself !)
> > Thanks for your help !
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





So I was having a conversation with a manager/educator in the IT Industry :)

In a discussion concerning search engines he stated how he dislikes dynamic
web pages (PHP/ASP/JSP/CFM) because search engine spiders 'choke' on dynamic
content or gives those pages a lower ranking.  I can't see this as being
true. I epically can't see the search spider "choking" on dynamic pages
returning well-formed/valid HTML.

Any thoughts?





I too would be interested in learning what others on this list might have to
say about this.  Knowing how a search engine such as Google indexes a site
or a page might be a good starting point in answering this debate: dynamic
vs. static.

Jeff




So I was having a conversation with a manager/educator in the IT Industry :)

In a discussion concerning search engines he stated how he dislikes dynamic
web pages (PHP/ASP/JSP/CFM) because search engine spiders 'choke' on dynamic
content or gives those pages a lower ranking.  I can't see this as being
true. I epically can't see the search spider "choking" on dynamic pages
returning well-formed/valid HTML.

Any thoughts?


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







I'm not an expert in this, but I suspect that some search engines will
probably ignore URL's that look like this:

/path/to/dynamic.php?arg=1&foo=bar

because it sees the ? and knows that it's a dynamic result and perhaps
very likely to change.

I had always assumed that's why many sites (such as amazon) use urls
like this instead:

/path/to/dynamic.php/arg/1/foo/bar

which don't have the ? so perhaps the engine does cache it?

just my 2 cents.

-philip

In article <[EMAIL PROTECTED]> you write:
>
>So I was having a conversation with a manager/educator in the IT Industry :)
>
>In a discussion concerning search engines he stated how he dislikes dynamic
>web pages (PHP/ASP/JSP/CFM) because search engine spiders 'choke' on dynamic
>content or gives those pages a lower ranking.  I can't see this as being
>true. I epically can't see the search spider "choking" on dynamic pages
>returning well-formed/valid HTML.
>
>Any thoughts?






Jon Shoberg wrote:

> So I was having a conversation with a manager/educator in the IT Industry :)
>
> In a discussion concerning search engines he stated how he dislikes dynamic
> web pages (PHP/ASP/JSP/CFM) because search engine spiders 'choke' on dynamic
> content or gives those pages a lower ranking.  I can't see this as being
> true. I epically can't see the search spider "choking" on dynamic pages
> returning well-formed/valid HTML.
>
> Any thoughts?

Each spider is different, and they've changed over time.  Often they don't
index a page that has a ? in it - they definitely won't be able to follow
form input tags and such - the possibilities for input are limitless.

Some can follow
blah.com/index.php?alh=fff

and links of that nature.  If you've got redirects in there,tho, they'll often
choke on those.

Apache has an advantage over IIS because you can normally
pass in parameters in the $PATH_INFO area -
http://www.blah.com/index.php/blag/222/dsfsd/dlkjsdf
calls the index.php with /blag/222/dsfsd/dlkjsdf as parameters you can grab in
your
script.  IIS doesn't allow for this.  :(  (not natively anyway)

Some search engines wouldn't FOLLOW a ? in a link,
but will accept one as a 'submitted page' to index if you submit it manually.

Again, all of this information is necessarily vague.  What works one year
doesn't work the next.

This was all info and experienced gleaned while building keywordcount.com a few
years
ago - the whole landscape has changed, and getting 'indexed' by search engines
is nice,
but imo can be a big waste of time and money given that there are many factors
beyond your control entirely.  SEOs will bash me upside the head for that one,
but it's been my experiences over the past couple years.  :)






Getting listed in search engines really is important. But in the vein of
what you were talking about, people shouldn't really "worry" about it.

Note: Getting listed in directories like Yahoo is way more important than
having any search engine list you. You always receive a far more targeted
user with places like Yahoo, because they really do want to see what you
have to say.


Back on topic, the only search engines worth bothering with can handle
dynamic pages just fine. There is _no_ difference in a static html page and
a dynmically created one.

However, be _very_ careful with sessions. Sessions can force a query string
onto the end of every page on your first page, causing the spider to be
unable to visit any other page in your site!

Also be extremely careful about the use of <noframes> and browser sniffing.
So many sites do something classically stupid so that when someone sees
their site in a search engine, the description is "Your browser does not
support frames. Your browser must support frames to view this site."...I
just want to slap the webmaster every time I see that.


In short, on your index page (which is what you want bookmarked the most) do
not have links with query strings in them, do not use redirects, do not use
frames (period. if you want to use them everywhere else on the site that's
ok, but don't do it on the main page!), do not use session_start(), and do
not complain if the user has disabled javascript- if you want your site to
be well listed in search engines.

With all that taken into effect, I can see why the person you were talking
to disliked dynamic sites. But if the webmaster knows the rules of the
search engines, dynamic sites work just perfectly.


--
Plutarck
Should be working on something...
...but forgot what it was.


"Michael Kimsal" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> Jon Shoberg wrote:
>
> > So I was having a conversation with a manager/educator in the IT
Industry :)
> >
> > In a discussion concerning search engines he stated how he dislikes
dynamic
> > web pages (PHP/ASP/JSP/CFM) because search engine spiders 'choke' on
dynamic
> > content or gives those pages a lower ranking.  I can't see this as being
> > true. I epically can't see the search spider "choking" on dynamic pages
> > returning well-formed/valid HTML.
> >
> > Any thoughts?
>
> Each spider is different, and they've changed over time.  Often they don't
> index a page that has a ? in it - they definitely won't be able to follow
> form input tags and such - the possibilities for input are limitless.
>
> Some can follow
> blah.com/index.php?alh=fff
>
> and links of that nature.  If you've got redirects in there,tho, they'll
often
> choke on those.
>
> Apache has an advantage over IIS because you can normally
> pass in parameters in the $PATH_INFO area -
> http://www.blah.com/index.php/blag/222/dsfsd/dlkjsdf
> calls the index.php with /blag/222/dsfsd/dlkjsdf as parameters you can
grab in
> your
> script.  IIS doesn't allow for this.  :(  (not natively anyway)
>
> Some search engines wouldn't FOLLOW a ? in a link,
> but will accept one as a 'submitted page' to index if you submit it
manually.
>
> Again, all of this information is necessarily vague.  What works one year
> doesn't work the next.
>
> This was all info and experienced gleaned while building keywordcount.com
a few
> years
> ago - the whole landscape has changed, and getting 'indexed' by search
engines
> is nice,
> but imo can be a big waste of time and money given that there are many
factors
> beyond your control entirely.  SEOs will bash me upside the head for that
one,
> but it's been my experiences over the past couple years.  :)
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Check out this article :

  Building Dynamic Pages With Search Engines in Mind :
  ----------------------------------------------------
  http://phpbuilder.com/columns/tim20000526.php3

Also, mod_rewrite related "stuff" has been discussed :

  http://marc.theaimsgroup.com/?l=php-general&s=mod_rewrite

regards,
philip

On Mon, 16 Apr 2001, Jon Shoberg wrote:

> 
> So I was having a conversation with a manager/educator in the IT Industry :)
> 
> In a discussion concerning search engines he stated how he dislikes dynamic
> web pages (PHP/ASP/JSP/CFM) because search engine spiders 'choke' on dynamic
> content or gives those pages a lower ranking.  I can't see this as being
> true. I epically can't see the search spider "choking" on dynamic pages
> returning well-formed/valid HTML.
> 
> Any thoughts?
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





How do I establish an SSL socket connection with PHP?
I have PHP compiled in an Apache Mod_SSL server. Do I need to compile PHP
with
some sort of open_ssl option? I have --enable-sockets in the command line.
Please help!!!

-dave








Hi.

Considering PHP takes " 's " into consideration as part of the script,
and adds a slash infront of them I need a way to overcome this.  And
second of all, I need a way to prevent HTML code from being seen, none
the less used on the output.

<?
$space = " ";
if( $submitfrm )
 {
echo "your entry will be added shortly.";
$submitmsg = file( "gb.txt" );
$fp = fopen( "gb.txt", 'a' );
rewind($fp);
fwrite( $fp, "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr> <td width=\"236\"><p><font size=\"1\"><b>$subject</b> :  <a
href=\"mailto:$email\">$name</a></td> </tr> <tr> <td width=\"236\"><font
size=\"1\"><p>$submition</td> </tr> </table><br>" );
fclose( $fp );
 }
else
 {
include ( "guestbooks.php" );
 }
?>

All help's welcome, since I need it..  :P

-Owen





Hi,

there is NO way of hiding the html from the user.
the browser can't output otherwise. You can only
try to make it difficult to get the source.

Where does the " 's " problem come in? More detail plz.
Is it a part of a text? Then try htmlspecialchars() or
htmlentities().

Johannes


""Dddogbruce (@home.com)"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi.
>
> Considering PHP takes " 's " into consideration as part of the script,
> and adds a slash infront of them I need a way to overcome this.  And
> second of all, I need a way to prevent HTML code from being seen, none
> the less used on the output.
>
> <?
> $space = " ";
> if( $submitfrm )
>  {
> echo "your entry will be added shortly.";
> $submitmsg = file( "gb.txt" );
> $fp = fopen( "gb.txt", 'a' );
> rewind($fp);
> fwrite( $fp, "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
> <tr> <td width=\"236\"><p><font size=\"1\"><b>$subject</b> :  <a
> href=\"mailto:$email\">$name</a></td> </tr> <tr> <td width=\"236\"><font
> size=\"1\"><p>$submition</td> </tr> </table><br>" );
> fclose( $fp );
>  }
> else
>  {
> include ( "guestbooks.php" );
>  }
> ?>
>
> All help's welcome, since I need it..  :P
>
> -Owen
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






> there is NO way of hiding the html from the user.
> the browser can't output otherwise. You can only
> try to make it difficult to get the source.

I want to hide the HTML from the browser.  If someone adds some malicious
code, or even <u></u> I don't want it to underline.

> Where does the " 's " problem come in? More detail plz.
> Is it a part of a text? Then try htmlspecialchars() or
> htmlentities().

Say I right "Hiya, my name's Owen" on the submission part of the form.  It'll
show up as "Hiya, my name\'s Owen" on the output (which is a .txt file.)

HTH,
Owen





<snip>
I want to hide the HTML from the browser.  If someone adds some
malicious
code, or even <u></u> I don't want it to underline.

Could you rephrase this? You want to "hide" the HTML from the browser?
If the browser doesn't see any HTML, good luck getting a web page. 
If you're trying to hide the HTML from the user, you're in for some
fun...you can do things like disable right clicking, but then they can
view source the page. 
You can make the page contain frames and then they'd see the frameset,
and wouldn't be able to click into the source...but then they could
check the page referenced in the url attribute of your
frameset...basically, as said before, you can't completely cut the end
user off from the HTML output...what are you worried about anyway, with
the <u></u> example?

As far as the name\'s problem, check php.net for info about magic
quotes...you probably have them on...if they are on, PHP will
"magically" put a \ in front of ' or " so you don't have to worry about
that when you enter your data into wherever...you can disable it in your
php.ini, or at runtime...

-jack
> 
> > Where does the " 's " problem come in? More detail plz.
> > Is it a part of a text? Then try htmlspecialchars() or
> > htmlentities().
> 
> Say I right "Hiya, my name's Owen" on the submission part of the form.  It'll
> show up as "Hiya, my name\'s Owen" on the output (which is a .txt file.)
> 
> HTH,
> Owen
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




use srtipslashes() before writing it to the
file.

Johannes
""Dddogbruce (@home.com)"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > there is NO way of hiding the html from the user.
> > the browser can't output otherwise. You can only
> > try to make it difficult to get the source.
>
> I want to hide the HTML from the browser.  If someone adds some malicious
> code, or even <u></u> I don't want it to underline.
>
> > Where does the " 's " problem come in? More detail plz.
> > Is it a part of a text? Then try htmlspecialchars() or
> > htmlentities().
>
> Say I right "Hiya, my name's Owen" on the submission part of the form.
It'll
> show up as "Hiya, my name\'s Owen" on the output (which is a .txt file.)
>
> HTH,
> Owen
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Check magic_quotes_runtime in your ini. If it's on, turn it off.

Use the htmlspecialchars() family of functions. They will "hide" HTML in
that the browser will not attempt to parse. so "<B>" will be displayed as
"<B>", and not make all the text turn to bold.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Dddogbruce (@home.com)"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > there is NO way of hiding the html from the user.
> > the browser can't output otherwise. You can only
> > try to make it difficult to get the source.
>
> I want to hide the HTML from the browser.  If someone adds some malicious
> code, or even <u></u> I don't want it to underline.
>
> > Where does the " 's " problem come in? More detail plz.
> > Is it a part of a text? Then try htmlspecialchars() or
> > htmlentities().
>
> Say I right "Hiya, my name's Owen" on the submission part of the form.
It'll
> show up as "Hiya, my name\'s Owen" on the output (which is a .txt file.)
>
> HTH,
> Owen
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






A bit OT, yes, but I don't want to ask an
inappropriate question here (not that this
isn't an inappropriate question :p).
Can someone recommend a good Javascript
mailing list?

Chris




I know of only the one on marc.aimsgroup.com. They list quite a few mailing
lists of all types.

But I still don't know any newsgroups :(


--
Plutarck
Should be working on something...
...but forgot what it was.


""Boget, Chris"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> A bit OT, yes, but I don't want to ask an
> inappropriate question here (not that this
> isn't an inappropriate question :p).
> Can someone recommend a good Javascript
> mailing list?
>
> Chris
>






How about newsgroups instead?
comp.lang.javascript seems to be pretty active.

Seung-woo Nam
"Boget, Chris" wrote:
> 
> A bit OT, yes, but I don't want to ask an
> inappropriate question here (not that this
> isn't an inappropriate question :p).
> Can someone recommend a good Javascript
> mailing list?
> 
> Chris




The JavaScript Weenie is about the best I know of at:

http://webdevelopersjournal.com/subform.html

See you there.

Andy.

----- Original Message ----- 
From: "Boget, Chris" <[EMAIL PROTECTED]>
To: "Php (E-mail)" <[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2001 4:56 PM
Subject: [PHP] Javascript mailing list


> A bit OT, yes, but I don't want to ask an
> inappropriate question here (not that this
> isn't an inappropriate question :p).
> Can someone recommend a good Javascript
> mailing list?
> 
> Chris
> 





this is totally OT - however I don't where else to ask.

i need information on cyber squatting. as in what laws there are against 
it, etc.....i believe that there was a law passed making cyber squatting 
illegal...but i can't find it at the library of congress....any help?

~kurth





I assume you mean registering a web address of a company, just to keep them
from registering it or to try and make them pay you for it?

Check NetworkSolutions "domain name dispute" policies.

InterNIC has a pretty good policy, actually. If someone registers a name
with is copyrighted, trademarked, or is clearly only valuable because it is
familiar to a registered trademark of copyright, they are in violation and
the domain name can be taken away from them and awared to the rightful owner
via arbitration.

To avoid having a domain name taken away they must prove either that they
have made a good-faith effort to build a destinctive trademark of brand
which does not impede upon a pre-existing copyright, and that the name was
not registered for the sole purpose of keeping someone from rightfully
registering it.


Is that what you meant?


--
Plutarck
Should be working on something...
...but forgot what it was.


"Kurth Bemis" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> this is totally OT - however I don't where else to ask.
>
> i need information on cyber squatting. as in what laws there are against
> it, etc.....i believe that there was a law passed making cyber squatting
> illegal...but i can't find it at the library of congress....any help?
>
> ~kurth
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






At 12:21 PM 4/17/2001, Plutarck wrote:

thats is exactly what i'm looking for. :-)

thanks

~kurth

>I assume you mean registering a web address of a company, just to keep them
>from registering it or to try and make them pay you for it?
>
>Check NetworkSolutions "domain name dispute" policies.
>
>InterNIC has a pretty good policy, actually. If someone registers a name
>with is copyrighted, trademarked, or is clearly only valuable because it is
>familiar to a registered trademark of copyright, they are in violation and
>the domain name can be taken away from them and awared to the rightful owner
>via arbitration.
>
>To avoid having a domain name taken away they must prove either that they
>have made a good-faith effort to build a destinctive trademark of brand
>which does not impede upon a pre-existing copyright, and that the name was
>not registered for the sole purpose of keeping someone from rightfully
>registering it.
>
>
>Is that what you meant?
>
>
>--
>Plutarck
>Should be working on something...
>...but forgot what it was.
>
>
>"Kurth Bemis" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > this is totally OT - however I don't where else to ask.
> >
> > i need information on cyber squatting. as in what laws there are against
> > it, etc.....i believe that there was a law passed making cyber squatting
> > illegal...but i can't find it at the library of congress....any help?
> >
> > ~kurth
> >
> >
> > --
> > PHP General Mailing List (http://www.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]





I've tried to follow the example in the online manual, but and I believe my
session/cookie variables are being stored. Is there some specific way I need
to call them? Can anyone provide a brief example?

Thanks.

--Bob
--

  +---------------------------------------------------------------+
  |  Bob Clingan                |     OneStopSite, LLC            |
  |                             |     www.onestopsite.com         |
  |  Web Developer/Programmer   |     Phone: 410-893-9800         |
  |  [EMAIL PROTECTED]        |     Fax:   410-893-8065         |
  +---------------------------------------------------------------+






Tried this on a host running 3.0.16:

    <?php echo $PHP_SELF ?>

Worked just fine.

 -dan

Previously, Alan Ward said:
> Does the variable $php_self work in PHP3? I am helping a friend with some
> forms, and their host still uses PHP3.

-- 
If man evolved from monkeys and apes, why do we still have monkeys and apes?
                                                  -George Carlin




Given the following code:

-----

class myClass {
  function myClass() {
    $classVar = get_class( $this );

  }
}

$thisInstance = new myClass();

-----

What value should $classVar contain?

"myClass"

or

"thisInstance"

?
The documentation leads me to believe that it is the 
latter value, but in practice it contains the former.  
If it is supposed to have the latter value, is there any
way I can get the fomer?  Any way that I can get the 
name "thisInstance"?

Chris




"This function returns the name of the class of which the object obj is an
instance."

The name of the class is "myClass", therefore the behavior is as it should
be.

"thisInstance" is an object, not a class. If you are trying to do something
imparticular you'll have to be more specific.

As for getting the name "thisInstance", I'm not really sure why you'd need
to, so I can't think of a work-around.

Since "thisInstance" is the name of the object, you need some object related
function. I've never had to do it, so I have no clue how, but maybe someone
else will know :)


--
Plutarck
Should be working on something...
...but forgot what it was.


""Boget, Chris"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Given the following code:
>
> -----
>
> class myClass {
>   function myClass() {
>     $classVar = get_class( $this );
>
>   }
> }
>
> $thisInstance = new myClass();
>
> -----
>
> What value should $classVar contain?
>
> "myClass"
>
> or
>
> "thisInstance"
>
> ?
> The documentation leads me to believe that it is the
> latter value, but in practice it contains the former.
> If it is supposed to have the latter value, is there any
> way I can get the fomer?  Any way that I can get the
> name "thisInstance"?
>
> Chris
>






I am doing a project with PHP to a text database. Basically the text
database is created in C++. But I only can use exec() function
to transfer query commands as an array parameter to its interface, and get 
result from a temp file. Not like php directly call mysql function, and I 
want to (if possible) create my function which can do things like mysql 
function. Anyone know how to do it? Or anyone can tell me which is the best 
solution to connect a C++ application from PHP?

Xinkun


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





Hi!  I am wondering if there is such a php array that can take care of the x
and y axis data.  I figure that using this array type, $axis[$x][$y] would
do the trick.  Would it work?  If not, then education me on what would work!
Thanks!

Scott






yes, that's a multi-dimensional array, which is fine in php (and
everything else i can think of =P)...

-jack

Scott Fletcher wrote:
> 
> Hi!  I am wondering if there is such a php array that can take care of the x
> and y axis data.  I figure that using this array type, $axis[$x][$y] would
> do the trick.  Would it work?  If not, then education me on what would work!
> Thanks!
> 
> Scott
> 
> --
> PHP General Mailing List (http://www.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 can be a tad screwy with how it handles multi-dimensional arrays, but
yes PHP handles them. No real speed problems with them either.

But you may just want to use an associative array like:

$loc = array("y" => $y, "x" => $x);

Then just use $loc["y"] and $loc["x"].

Just another option, but feel free to use multi-dimensional arrays. Just be
aware that PHP supports only two dimensions (so $array[][][] will not work),
and if you try and get fancy with sort() and count() you are going to give
yourself a migraine.


--
Plutarck
Should be working on something...
...but forgot what it was.


"Jack Dempsey" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> yes, that's a multi-dimensional array, which is fine in php (and
> everything else i can think of =P)...
>
> -jack
>
> Scott Fletcher wrote:
> >
> > Hi!  I am wondering if there is such a php array that can take care of
the x
> > and y axis data.  I figure that using this array type, $axis[$x][$y]
would
> > do the trick.  Would it work?  If not, then education me on what would
work!
> > Thanks!
> >
> > Scott
> >
> > --
> > PHP General Mailing List (http://www.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]
>






Simplest way to do it IMHO.

When a user logs in (starts their session) register their username into the
session (that session is "bound" to them now).

On every page when a user does anything, update your database with the
current time as a "last_activity" entry for that user.

When showing who is currently logged in, get all the entries out and check
their dates. If the last activity is older than a certain amount of
acceptable time (how long it takes them to be considered "logged out". note:
people rarely use a logout button), then consider that user as not being
logged in.

Delete the entry so your "who's online" function doesn't hugely slow down
the page, and you should be good to go.


The only problem is that you have to do an update every time someone visits
a page, which increases your server load. But to avoid any noticable slow
down you could just use a register_shutdown_function.

I think that should handle your problem...


--
Plutarck
Should be working on something...
...but forgot what it was.


""Richard"" <[EMAIL PROTECTED]> wrote in message
9bfv6n$pds$[EMAIL PROTECTED]">news:9bfv6n$pds$[EMAIL PROTECTED]...
> Greetings.
>
>     Some of you are familiar with my latest project, a smaller community.
I
> have implemented almost everything I need, and I wish to thank those of
you
> who helped me with "which mail is new" and so forth. However, this problem
> is quite worse I suppose, but I hope some of you has done something like
> this before:
>
>     Sessions.
>
> I wish to keep track of every visitor. Not a counter or anything, but more
> of when a person signs in, the users nickname will be bound to this
session
> ID which will keep track of the person is online or offline. I have solved
> it like so:
>
>     Whenever a person loggs in, I add it's name to a online.dat file. When
> the user signs of, I remove the nickname thus the login time from the
file.
>
> PROBLEMS?? First one: User must click on "logout" to remove itself.
Second:
> It does not always remove itself.
>
> Therefore, I ask: How can I create a new session for every visitor (so I
> know how many are online at the time), bind this ID to its nickname (so
one
> row in a file would be: NICKNAME|SESSION_ID|DATE), and how can I make sure
> that whenever the browser is closed or whatever, or after a certain time
of
> inactivity (3 minutes), the user is removed from the file.
>
> All help is greatly appriciated and your name will be on the credits list
> too.
>
> - Richard
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






I am trying to write a Registration form that send an email to a specific 
address.
The source to the page is at http://www.probesnj.org/etownreg.txt
Its 400 lines long and I probably just spelled something wrong or missed a 
semi-colon, but I can't find it and I would appreciate it anyone who has 5 
minutes to spare could take a look at it. Thanks a bunch!

Michael Leone





At 01:35 PM 4/17/2001, Michael Leone wrote:

whats the problem taht you having?

>I am trying to write a Registration form that send an email to a specific 
>address.
>The source to the page is at http://www.probesnj.org/etownreg.txt
>Its 400 lines long and I probably just spelled something wrong or missed a 
>semi-colon, but I can't find it and I would appreciate it anyone who has 5 
>minutes to spare could take a look at it. Thanks a bunch!
>
>Michael Leone
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





At 01:44 PM 4/17/2001, Michael Leone wrote:

double check ALL of your for loops as well as any place that you may have 
used a curly bracket.

~kurth

>Im getting this pesky parse error at line 392 which is the last line of 
>the document.
>At 01:40 PM 4/17/2001 -0400, you wrote:
>>At 01:35 PM 4/17/2001, Michael Leone wrote:
>>
>>whats the problem taht you having?
>>
>>>I am trying to write a Registration form that send an email to a 
>>>specific address.
>>>The source to the page is at http://www.probesnj.org/etownreg.txt
>>>Its 400 lines long and I probably just spelled something wrong or missed 
>>>a semi-colon, but I can't find it and I would appreciate it anyone who 
>>>has 5 minutes to spare could take a look at it. Thanks a bunch!
>>>
>>>Michael Leone
>>>
>>>
>>>--
>>>PHP General Mailing List (http://www.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]
>






I have a SQL Table that has over 1,000 records and I was wanting
to write a script that would find duplicate phone numbers and
then list the duplicate phone numbers. I have been trying to
think on how to do this but I can't think of a way. Can someone
please help me on some code I could write to do this?

Thanks in advance.

                                               /'^'\
                                              ( o o )
------------------------------------------oOOO--(_)--OOOo----
    Devin Atencio
    ArosNet Systems Administration         .oooO
    EMail: [EMAIL PROTECTED]               (   )   Oooo.
--------------------------------------------\ (----(   )-----
                                             \_)    ) /
                                                   (_/
 





On Tuesday, April 17, 2001, at 11:00  AM, Devin Atencio wrote:

> I have a SQL Table that has over 1,000 records and I was wanting
> to write a script that would find duplicate phone numbers and
> then list the duplicate phone numbers. I have been trying to
> think on how to do this but I can't think of a way. Can someone
> please help me on some code I could write to do this?

I think you want something like this (MySQL syntax, YMMV):

SELECT phone_number, count(*) AS instances
FROM my_table
GROUP by phone_number
HAVING instances >= 2
ORDER BY instances DESC


This give you a list of all duplicated phone numbers, the number of 
times they appear in the table, and sorts them with the most-duplicated 
numbers first.

To list them, you just need to loop through the result set echoing the 
phone number.

Cheers,

colin

--------------------------------------
Colin Putney            
Whistler.com




Hm...it's not fast, but it should work.

Do a select statement to take out just the phone numbers, then do something
like:

while ($row = mysql_fetch_row($result))
{
    $array[] = $row[0];
}

$amount = array_count_values($array);

$imax = sizeof($amount);
for ($i = 0; $i < $imax; $i++)
{
    if ($amount[$i] > 1)
        {
            $copys[] = $amount[$i];
        }
}


It ain't pretty, but $copys will be an array filled with the phone numbers
that were entered more than once, so you can do whatever you want with it
other than that.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Devin Atencio"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I have a SQL Table that has over 1,000 records and I was wanting
> to write a script that would find duplicate phone numbers and
> then list the duplicate phone numbers. I have been trying to
> think on how to do this but I can't think of a way. Can someone
> please help me on some code I could write to do this?
>
> Thanks in advance.
>
>                                                /'^'\
>                                               ( o o )
> ------------------------------------------oOOO--(_)--OOOo----
>     Devin Atencio
>     ArosNet Systems Administration         .oooO
>     EMail: [EMAIL PROTECTED]               (   )   Oooo.
> --------------------------------------------\ (----(   )-----
>                                              \_)    ) /
>                                                    (_/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>




Reply via email to