php-general Digest 22 Feb 2002 15:49:40 -0000 Issue 1187

Topics (messages 85810 through 85856):

Transparent sid
        85810 by: Richard Baskett

Any way to display a changing value?
        85811 by: Leif K-Brooks
        85843 by: bvr

Referencing a parent class' variables
        85812 by: Bradley Goldsmith
        85814 by: Bradley Goldsmith

not recognizing changes
        85813 by: sean.interconnect.is.it

Telnet
        85815 by: Uma Shankari T.
        85828 by: DrouetL.ldnegoce.com
        85840 by: bvr

Re: phpmyadmin
        85816 by: Ray Hunter

overwriting PHP_SELF and PHP_AUTH_xxxx
        85817 by: K.Tomono
        85818 by: Lars Torben Wilson
        85821 by: K.Tomono
        85823 by: Rasmus Lerdorf
        85841 by: Michael Romagnoli

pulling text to insert in table
        85819 by: Administration.myclassguide
        85825 by: Nick Wilson
        85834 by: Administration.myclassguide
        85837 by: Nick Wilson

foreach not in reach
        85820 by: jtjohnston
        85830 by: Niklas Lampén
        85831 by: David Robley

How do you setup cacheing?
        85822 by: Ed Lazor
        85824 by: Rasmus Lerdorf

Re: Apache 2.0.32 + PHP from CVS not working
        85826 by: Rasmus Lerdorf
        85856 by: Tyler Longren

Re: Creating methods runtime
        85827 by: Mika Tuupola
        85829 by: Rasmus Lerdorf

header problem
        85832 by: Michael P. Carel
        85833 by: Rasmus Lerdorf

Zend
        85835 by: Ornella Fasolo

Win32 compilation problems...
        85836 by: Frédéric Vissault

function that extracts numbers from a string
        85838 by: DigitalKoala
        85839 by: Andrey Hristov

Getting the data for MySQL and then putting it back with PHP - at a loss!
        85842 by: Michael Romagnoli
        85844 by: george Pitcher
        85845 by: Andrey Hristov
        85848 by: Michael Romagnoli
        85849 by: Michael Romagnoli

Bad char Translation
        85846 by: -oOo HONU oOo-

Re: XML compliance with forms and trans_sid when        using   sessions
        85847 by: James Nord

Next and Preview Row
        85850 by: Mark Lo
        85851 by: Chris Boget
        85853 by: Andrey Hristov
        85854 by: Raymond Gubala
        85855 by: Chris Boget

sanity check - apache/php module safe implementation
        85852 by: Dave

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]


----------------------------------------------------------------------
--- Begin Message ---
Ok not really a problem, but more of a.. Well I will let you judge :)

When cookies are disabled in a browser my site shows the url:

http://www.whatever.com/index.php?sname=3432432432432432432 etc etc

but when I have cookies enabled it shows

http://www.whatever.com/index.php?

Which is fine and it works great, but I don't care much for the '?' at the
end of the url just for aesthetics sake :)  Anyone know a workaround for
this?  

Cheers!

Rick

"I haven't failed, I've found 10,000 ways that don't work." - Ben Franklin

--- End Message ---
--- Begin Message ---
I was wondering if there's any way to display a value to the user that keeps
changing?  I know about flush(), but that just prints it out before the
script ends, but doesn't display it in one place.  Is there a way? 
--- End Message ---
--- Begin Message ---


Hi!

You  could use a plain form and JavaScript to do this.

It's fairly simple and it makes for nice little progress bars and graphs and other 
'realtime' info.

A few tips:

- first output the form (completely)
- use *implicit* flushing when outputting your JS.
- use a new <SCRIPT> .. </SCRIPT> part every time you sent commands (for Netscape)
- do all calculations and stuff in PHP, minimize your JS code to something like 
echo("document.myform.mytext.value = '" . addslashes($newval) . "';\n");
- try to do updates 'smartly', i.e. on when the values *really* change, and not with 
infinite speed.


bvr.




On Thu, 21 Feb 2002 23:00:30 -0500, Leif K-Brooks wrote:

>I was wondering if there's any way to display a value to the user that keeps
>changing?  I know about flush(), but that just prints it out before the
>script ends, but doesn't display it in one place.  Is there a way? 



--- End Message ---
--- Begin Message ---
Hi All,

        I am able to call parent functions ok, but can't seem to be able to
reference its variables from a child class. 

        How does a child call a member variable of it's parent in php?

Cheers,
Brad
--- End Message ---
--- Begin Message ---
How about I answer my own question :)

Same as you reference a member variable when its declared within the child.

I had another problem that was causing me to think differently.

Amazing what a little RTFM time can do.

Sorry to annoy.

Cheers,
Brad



-----Original Message-----
From: Bradley Goldsmith [mailto:[EMAIL PROTECTED]]
Sent: Friday, 22 February 2002 3:02 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Referencing a parent class' variables 


Hi All,

        I am able to call parent functions ok, but can't seem to be able to
reference its variables from a child class. 

        How does a child call a member variable of it's parent in php?

Cheers,
Brad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I have a .txt file that's holding some log files generated by a php script.  There is 
then another script that parses the logs and displays results.

* This is what's really strange:

when new logs are generated (meaning that the .txt file now has new lines with log 
data) the php parser is reading the old version.  Only if I leave the script alone for 
a while (I haven't figured out how long) will it recognize the changes.

* Gets stranger:

When I ask: $unixtimestamp = filemtime ('logs/file.txt');
the time is marching forward, but some how something is cashing the content.

This happens to be on a shared Unix machine at Hostway.com - and I'm working from the 
house with the lovely connection of AOL (yuck!).

Thanks for any input,

Sean 

--- End Message ---
--- Begin Message ---

 Hello,


  By using telnet option how i will send a mail from my machine using 
 php..If any one came to know this plz tell me how to do it...


-Uma

--- End Message ---
--- Begin Message ---

Hi,

you can find all what you want on the following url :
http://phpclasses.upperdesign.com/browse.html/class/2/

Personnaly I use the SMTP class from Richard Heyes

Laurent



                                                                                       
                                      
                    "Uma Shankari T."                                                  
                                      
                    <[EMAIL PROTECTED]       To:     [EMAIL PROTECTED]   
                                      
                    et.res.in>                     cc:                                 
                                      
                                                   Subject:     [PHP] Telnet           
                                      
                    22/02/02 05:17                                                     
                                      
                                                                                       
                                      
                                                                                       
                                      





 Hello,


  By using telnet option how i will send a mail from my machine using
 php..If any one came to know this plz tell me how to do it...


-Uma


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--- End Message ---
--- Begin Message ---


You can send mail using PHP's  mail() function.

On windows this works with regular SMTP (mail server), 
on UNIX it executes a binary (local delivery agent) that 
may handle the message as desired.

If you really want to sent through a  telnet service, you can
fsockopen() to the telnet server and regular file functions 
to send login stuff and run the appropiatemail software on 
the server ('sendmail'?).

Ofcourse this is not recommended, because it has unnecessary
overhead and you'd be better off using an SMTP script or class
(as noted before) or make one yourself according to the 'SMTP RFC'
(put that in google).


bvr.


On Fri, 22 Feb 2002 09:47:08 +0530 (IST), Uma Shankari T. wrote:

>
> Hello,
>
>
>  By using telnet option how i will send a mail from my machine using 
> php..If any one came to know this plz tell me how to do it...
>
>
>-Uma
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--- End Message ---
--- Begin Message ---
You might want to try phpbuilder, they have some great articles.  phpMyAdmin
is housed on sourceforge.net.  You can check them out there...



"Jtjohnston" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I know this is a bit off the wall for most, but for what purpose do you
> use phpmyadmin & mysql?
> What are your projects?
> Does anyone know of any good articles that discuss databasing, PHP,
> MySQL and or PHPMyAdmin for academic purposes?
> I'm a university researcher and want to collect some data.
>
> John Taylor-Johnston
> --------------------------------------------------------------------------
---
>
>   ' ' '   Université de Sherbrooke:
>  ô¿ô   http://compcanlit.ca/
>    -
>


--- End Message ---
--- Begin Message ---
Hi there.

This must be a curious question,  but I want to know...

Recently I've checked several globals, how it is overwritten.

the globals are $PHP_SELF and $PHP_AUTH_USER.

the first time, $PHP_AUTH_USER.
This is overwritten by the http GET values when such a following uri. (and
Post will be so.)
http://foo.bar.com/test.php3?PHP_AUTH_USER=CRACK

This case is tested under PHP Version 3.0.18-i18n-ja-2.

but is not overwritten under  PHP Version 4.0.3pl1


the second, $PHP_SELF.
This is not overwritten by the http GET values when such a following uri.
http://foo.bar.com/test.php3?PHP_SELF=CRACK.php

This is true both under PHP Version 4.0.3pl1 and PHP Version
3.0.18-i18n-ja-2


the difference is probably that PHP_AUTH_USER is value from http request
originally
 (="Authorization" header), but PHP_SELF is server side, I think.

though, such above behavior with each global is the intended spec of PHP?
Or Simply by the order of the evaluation in internal for these values?


I tested with my test servers.
my test server configuration, php.ini is defined with each

PHP3: register_globals (none. not defined.)
PHP4: register_globals = on

I've cheked with phpinfo() also.


Any opinion will be appreciated.
Thanks.

-----------------------
K.Tomono
--- End Message ---
--- Begin Message ---
On Thu, 2002-02-21 at 22:31, K.Tomono wrote:
> Hi there.
> 
> This must be a curious question,  but I want to know...

Globals, and register_globals = on, are insecure for exactly this
reason. This is why new versions of PHP will default to register_globals
= off, and why it's a good idea to use register_globals = off in any
case.

For more discussion of this issue, please read the following:

  http://www.php.net/release_4_1_0.php


Cheers,

Torben

> Recently I've checked several globals, how it is overwritten.
> 
> the globals are $PHP_SELF and $PHP_AUTH_USER.
> 
> the first time, $PHP_AUTH_USER.
> This is overwritten by the http GET values when such a following uri. (and
> Post will be so.)
> http://foo.bar.com/test.php3?PHP_AUTH_USER=CRACK
> 
> This case is tested under PHP Version 3.0.18-i18n-ja-2.
> 
> but is not overwritten under  PHP Version 4.0.3pl1
> 
> 
> the second, $PHP_SELF.
> This is not overwritten by the http GET values when such a following uri.
> http://foo.bar.com/test.php3?PHP_SELF=CRACK.php
> 
> This is true both under PHP Version 4.0.3pl1 and PHP Version
> 3.0.18-i18n-ja-2
> 
> 
> the difference is probably that PHP_AUTH_USER is value from http request
> originally
>  (="Authorization" header), but PHP_SELF is server side, I think.
> 
> though, such above behavior with each global is the intended spec of PHP?
> Or Simply by the order of the evaluation in internal for these values?
> 
> 
> I tested with my test servers.
> my test server configuration, php.ini is defined with each
> 
> PHP3: register_globals (none. not defined.)
> PHP4: register_globals = on
> 
> I've cheked with phpinfo() also.
> 
> 
> Any opinion will be appreciated.
> Thanks.
> 
> -----------------------
> K.Tomono
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506

--- End Message ---
--- Begin Message ---
> For more discussion of this issue, please read the following:
> 
>   http://www.php.net/release_4_1_0.php
> 
Thanks Lars Torben,
but one more question please.

There is "variables_order" in php.ini,
Is this very important thing concerned with this issue?

Regards :)

K.Tomono

> -----Original Message-----
> From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]]On Behalf Of Lars
> Torben Wilson
> Sent: Friday, February 22, 2002 3:40 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] overwriting PHP_SELF and PHP_AUTH_xxxx
> 
> 
> On Thu, 2002-02-21 at 22:31, K.Tomono wrote:
> > Hi there.
> > 
> > This must be a curious question,  but I want to know...
> 
> Globals, and register_globals = on, are insecure for exactly this
> reason. This is why new versions of PHP will default to 
> register_globals
> = off, and why it's a good idea to use register_globals = off in any
> case.
> 
> For more discussion of this issue, please read the following:
> 
>   http://www.php.net/release_4_1_0.php
> 
> 
> Cheers,
> 
> Torben
> 
> > Recently I've checked several globals, how it is overwritten.
> > 
> > the globals are $PHP_SELF and $PHP_AUTH_USER.
> > 
> > the first time, $PHP_AUTH_USER.
> > This is overwritten by the http GET values when such a 
> following uri. (and
> > Post will be so.)
> > http://foo.bar.com/test.php3?PHP_AUTH_USER=CRACK
> > 
> > This case is tested under PHP Version 3.0.18-i18n-ja-2.
> > 
> > but is not overwritten under  PHP Version 4.0.3pl1
> > 
> > 
> > the second, $PHP_SELF.
> > This is not overwritten by the http GET values when such a 
> following uri.
> > http://foo.bar.com/test.php3?PHP_SELF=CRACK.php
> > 
> > This is true both under PHP Version 4.0.3pl1 and PHP Version
> > 3.0.18-i18n-ja-2
> > 
> > 
> > the difference is probably that PHP_AUTH_USER is value from 
> http request
> > originally
> >  (="Authorization" header), but PHP_SELF is server side, I think.
> > 
> > though, such above behavior with each global is the 
> intended spec of PHP?
> > Or Simply by the order of the evaluation in internal for 
> these values?
> > 
> > 
> > I tested with my test servers.
> > my test server configuration, php.ini is defined with each
> > 
> > PHP3: register_globals (none. not defined.)
> > PHP4: register_globals = on
> > 
> > I've cheked with phpinfo() also.
> > 
> > 
> > Any opinion will be appreciated.
> > Thanks.
> > 
> > -----------------------
> > K.Tomono
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> -- 
>  Torben Wilson <[EMAIL PROTECTED]>
>  http://www.thebuttlesschaps.com
>  http://www.hybrid17.com
>  http://www.inflatableeye.com
>  +1.604.709.0506
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
Well, in this particular case it really makes no difference as
PHP_AUTH_* is data that comes from the user anyway.  Whether it is sent in
the GET-method data or in the Authenticate header is completely irrelevant
and turning register_globals off does not make any difference whatsoever.

The reason in this particular case that PHP_SELF could not be overwritten
was that the internal value overwrote the injected one.  For PHP_AUTH_*
you probably didn't provide an Authenticate header so the GET-method
version of the data was taken.  Had you provided the Authenticate header
in the request then that version would have overridden the GET-method
version.  However since both sets come from the user, they are equally
hackable and you'd need to send the correct PHP_AUTH_USER and PHP_AUTH_PWD
values in the GET-method data anyway.  If you know the username and
password, you might as well just log in normally.

But yes, in recent versions of PHP you are not able to overwrite these
values with GET-method data precisely because people overreact to
situations like this without really thinking about it logically.  There
are some built-in variables that, if overwritten, would actually be able
to cause security problems.  Old versions of PHP had an issue related to
this with the file upload vars.  So not all of this is unfounded paranoia.

And in this particular case for built-in variables like this,
variables_order does not really affect anything since there is no entry
for built-in vars in that order.  Of course, if you removed "G" from the
variables_order then you couldn't overwrite anything with GET-method data,
but you could of course inject the same data via any of the other methods.

-Rasmus

On 21 Feb 2002, Lars Torben Wilson wrote:

> On Thu, 2002-02-21 at 22:31, K.Tomono wrote:
> > Hi there.
> >
> > This must be a curious question,  but I want to know...
>
> Globals, and register_globals = on, are insecure for exactly this
> reason. This is why new versions of PHP will default to register_globals
> = off, and why it's a good idea to use register_globals = off in any
> case.
>
> For more discussion of this issue, please read the following:
>
>   http://www.php.net/release_4_1_0.php
>
>
> Cheers,
>
> Torben
>
> > Recently I've checked several globals, how it is overwritten.
> >
> > the globals are $PHP_SELF and $PHP_AUTH_USER.
> >
> > the first time, $PHP_AUTH_USER.
> > This is overwritten by the http GET values when such a following uri. (and
> > Post will be so.)
> > http://foo.bar.com/test.php3?PHP_AUTH_USER=CRACK
> >
> > This case is tested under PHP Version 3.0.18-i18n-ja-2.
> >
> > but is not overwritten under  PHP Version 4.0.3pl1
> >
> >
> > the second, $PHP_SELF.
> > This is not overwritten by the http GET values when such a following uri.
> > http://foo.bar.com/test.php3?PHP_SELF=CRACK.php
> >
> > This is true both under PHP Version 4.0.3pl1 and PHP Version
> > 3.0.18-i18n-ja-2
> >
> >
> > the difference is probably that PHP_AUTH_USER is value from http request
> > originally
> >  (="Authorization" header), but PHP_SELF is server side, I think.
> >
> > though, such above behavior with each global is the intended spec of PHP?
> > Or Simply by the order of the evaluation in internal for these values?
> >
> >
> > I tested with my test servers.
> > my test server configuration, php.ini is defined with each
> >
> > PHP3: register_globals (none. not defined.)
> > PHP4: register_globals = on
> >
> > I've cheked with phpinfo() also.
> >
> >
> > Any opinion will be appreciated.
> > Thanks.
> >
> > -----------------------
> > K.Tomono
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> --
>  Torben Wilson <[EMAIL PROTECTED]>
>  http://www.thebuttlesschaps.com
>  http://www.hybrid17.com
>  http://www.inflatableeye.com
>  +1.604.709.0506
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---

I have a special set of information retrieved from a while loop that I would
like a person to be able to edit and send back into a MySQL table.

I know all of the basic MySQL commands for doing such, but the PHP side to
get the input from the form to go in is really stumping me.

This is what I have:

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

$or = 0;

while($or < $orderidrows) {

$orderinfo = mysql_fetch_row($orderidinfo);
$domain[$or] = $orderinfo[2];
$cancel[$or] = $orderinfo[3];

print "<tr><td><font size=2 face=Arial> $domain[$or]</font></td><td><font
size=2 face=Arial>Cancel This Domain?</font></td><td><font size=2
face=Arial><input type=text name=confirm value='$cancel[$or]'
size=3></font></td>";

$or++;
}

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

The values/data I would normally insert into the MySQL from the form would be
$confirm, based on $domain - however, in this case, I have a number of rows
with the same
name. I've received help as far as distinguishing one row from another -
thanks.  :)

The problem I am really having is trying to insert the data back into one
particular table.  You see, when I select the data, I get multiple
orderid's with multiple domains attached to them.  When I try to UPDATE the
MySQL with the data, only the last orderid seems to be the one getting
updated.  And, to boot, I want to update based on the domain name (since
that is unique) and ignore the orderids.  I only used the orderids to pull
the data out.

So, I've been using a query like this in a loop;

$update = "UPDATE table2 SET cancel='$cancel[$a]' WHERE domain = $domain[$a]

Any suggestions?  I'm getting pretty desparate here!  :\

Thanks,

-Mike

--- End Message ---
--- Begin Message ---
Hi

Is it possible to pull text from a text file and insert it into a table in
an html page using php.

In some cases it would have to pull text from a certain part in the text
file and insert it into a specific cell in the table.

Thanks in advance

Mohamed

--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


* and then Administration@myclassguide declared....
> Hi
> 
> Is it possible to pull text from a text file and insert it into a table in
> an html page using php.

Yes.

> In some cases it would have to pull text from a certain part in the text
> file and insert it into a specific cell in the table.

Check out the regexp functions in the manual, I'm no expert in that
field but you should easily be able to parse your text file and extract
lines/sections based on certern criterion.
- -- 
- -----------------------------------------------------------
 www.explodingnet.com   |    Projects, Forums and
                        +    Articles for website owners 
- -- Nick Wilson --     |    and designers.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8dfaYHpvrrTa6L5oRApV2AJ9j19dxxZDCtuZnyMpQ6ZgP9P9b5QCcDmyB
mM9StS2gzLoowvWrKzCOkUc=
=vI7o
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Hi

Thanks.  In some cases I would have Microsoft Excel files wich I will save
as csv files.  Can content be pulled from a csv in the same method.

Thanks

Mohamed


----- Original Message -----
From: Nick Wilson <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 22, 2002 9:43 AM
Subject: Re: [PHP] pulling text to insert in table


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> * and then Administration@myclassguide declared....
> > Hi
> >
> > Is it possible to pull text from a text file and insert it into a table
in
> > an html page using php.
>
> Yes.
>
> > In some cases it would have to pull text from a certain part in the text
> > file and insert it into a specific cell in the table.
>
> Check out the regexp functions in the manual, I'm no expert in that
> field but you should easily be able to parse your text file and extract
> lines/sections based on certern criterion.
> - --
> - -----------------------------------------------------------
>  www.explodingnet.com   |    Projects, Forums and
>                         +    Articles for website owners
> - -- Nick Wilson --     |    and designers.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE8dfaYHpvrrTa6L5oRApV2AJ9j19dxxZDCtuZnyMpQ6ZgP9P9b5QCcDmyB
> mM9StS2gzLoowvWrKzCOkUc=
> =vI7o
> -----END PGP SIGNATURE-----
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


* and then Administration@myclassguide declared....
> Hi
> 
> Thanks.  In some cases I would have Microsoft Excel files wich I will save
> as csv files.  Can content be pulled from a csv in the same method.

No idea Mohamed but presuming they're basically text I'm sure it can.
- -- 
- -----------------------------------------------------------
 www.explodingnet.com   |    Projects, Forums and
                        +    Articles for website owners 
- -- Nick Wilson --     |    and designers.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8diq2HpvrrTa6L5oRAu9mAJ9qY9wiFb6cI94Xf08e5I/6tgl0wgCZAVdT
oSkFJGDqykp91vSQQ+M6IvA=
=Me6P
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Question 1:
How can I append strings to my authors array?
Me thinks this doesn't work :§) ?
$authors .= explode(";", $mydata->KW);
I'm getting "Invalid argument supplied for foreach()"

Question 2:
Once I get this working, I want to (a) alphabetise the contents of the
array, (b) count repititions, (c) elimintate copies, and create an array
I can print with tow things "$author[i]\t$counter[i]", so I end up with
something like:

Adam    2
Louis    5
John    3
Mary    8

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

$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);
$news = mysql_query("select KW from $table");

while ($mydata = mysql_fetch_object($news))
{
$authors .= explode(";", $mydata->KW);
}

foreach ($authors as $author)
{
echo "$author<br>\n";
}
------------------------------------------------------------------------

I'm learning, slowly but surely Martin :)
J

--- End Message ---
--- Begin Message ---
You didn't supply any information about you foreach() loop, but it works
like

foreach ($array as $string)
        print "$element<br>\n";

And explode() returns an array, so I think you need to do it like this:

$array = explode(";", $string);
array_push($authors, $array); // You could use foreach() here as well


Niklas


-----Original Message-----
From: jtjohnston [mailto:[EMAIL PROTECTED]] 
Sent: 22. helmikuuta 2002 8:48
To: [EMAIL PROTECTED]
Subject: [PHP] foreach not in reach


Question 1:
How can I append strings to my authors array?
Me thinks this doesn't work :§) ?
$authors .= explode(";", $mydata->KW);
I'm getting "Invalid argument supplied for foreach()"

Question 2:
Once I get this working, I want to (a) alphabetise the contents of the
array, (b) count repititions, (c) elimintate copies, and create an array
I can print with tow things "$author[i]\t$counter[i]", so I end up with
something like:

Adam    2
Louis    5
John    3
Mary    8

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

$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);
$news = mysql_query("select KW from $table");

while ($mydata = mysql_fetch_object($news))
{
$authors .= explode(";", $mydata->KW);
}

foreach ($authors as $author)
{
echo "$author<br>\n";
}
------------------------------------------------------------------------

I'm learning, slowly but surely Martin :)
J


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Question 1:
> How can I append strings to my authors array?
> Me thinks this doesn't work :§) ?
> $authors .= explode(";", $mydata->KW);
> I'm getting "Invalid argument supplied for foreach()"
> 
> Question 2:
> Once I get this working, I want to (a) alphabetise the contents of the
> array, (b) count repititions, (c) elimintate copies, and create an array
> I can print with tow things "$author[i]\t$counter[i]", so I end up with
> something like:

See the array handling functions to resolve some of these problems.

> Adam    2
> Louis    5
> John    3
> Mary    8
> 
> ------------------------------------------------------------------------
> 
> $myconnection = mysql_connect($server,$user,$pass);
> mysql_select_db($db,$myconnection);
> $news = mysql_query("select KW from $table");
> 
> while ($mydata = mysql_fetch_object($news))
> {
> $authors .= explode(";", $mydata->KW);

Presumably your error is occurring here; it would seem that the content 
of $mydata->KW is not such that explode will create an array. There may 
be cases perhaps where you do not have a series of authors names 
separated by semicolons? You may have to add a test for the case where 
$authors is not an array.
> }
> 
> foreach ($authors as $author)
> {
> echo "$author<br>\n";
> }
> ------------------------------------------------------------------------
> 
> I'm learning, slowly but surely Martin :)

I think this has already been said, but it seems there is scope to 
restructure your tables in such a manner as to be able to handle a lot of 
these problems with SQL from a properly designed database. Frinstance you 
might have a structure that has a main table with a unique ID, the 
abstract info, title, publisher etc and a separate table with author name 
and ID of the main table entry.

Just at a guess, you are/have imported this information from a 
bibliographic package of some sort?


-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
Hello,

I have been trying to figure this out for a week now, with no luck.  Posts 
to [EMAIL PROTECTED] have gotten no response.  Anyone here happen to 
know how to do this?

I understand that Apache serves database driven web pages more quickly 
using a proxy / cache. Most of the tutorials I have found relating to proxy 
and caching seem to require that users change the configuration of their 
browser's proxy settings. This would be the standard proxy sitting between 
a user and all sites on the Internet, but this is not what I am looking 
for.  I am trying to do the opposite of this. I would like to serve pages 
from one web site to multiple users through a proxy / cache. I also want to 
do this in a way that is transparent to the visitor. They access a web 
site's main URL, for example http://www.someplace.com, and enjoy the 
improved performance without having to know they are going through a proxy 
/ cache.

Please, would you confirm whether this is possible and, if so, what to do to
enable it?

Thanks,
-Ed

--- End Message ---
--- Begin Message ---
What you are looking for is called a "Reverse Proxy".  Do some google
searches on that term.

-Rasmus

> I have been trying to figure this out for a week now, with no luck.  Posts
> to [EMAIL PROTECTED] have gotten no response.  Anyone here happen to
> know how to do this?
>
> I understand that Apache serves database driven web pages more quickly
> using a proxy / cache. Most of the tutorials I have found relating to proxy
> and caching seem to require that users change the configuration of their
> browser's proxy settings. This would be the standard proxy sitting between
> a user and all sites on the Internet, but this is not what I am looking
> for.  I am trying to do the opposite of this. I would like to serve pages
> from one web site to multiple users through a proxy / cache. I also want to
> do this in a way that is transparent to the visitor. They access a web
> site's main URL, for example http://www.someplace.com, and enjoy the
> improved performance without having to know they are going through a proxy
> / cache.
>
> Please, would you confirm whether this is possible and, if so, what to do to
> enable it?
>
> Thanks,
> -Ed
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
It won't work simply because Apache 2.0 is very much in a state of flux.
The API's change constantly.  We are many months away from any sort of
stable Apache2+PHP system.  Unless you are a developer and can help fix
problems, you are much better off sticking with Apache 1.3.x and not
bugging the developers trying to bring you Apache 2.

-Rasmus

On 21 Feb 2002, Austin Gonyou wrote:

> The PHP-Dev list doesn't want to hear it, so I guess I'm *stuck* back
> here.
>
> Will someone please tell me why the latest CVS of PHP won't let Apache
> 2.0.32 work and when a graceful fix will be implemented?
>
> Hmm..this sounds like it should go to the dev list...
> --
> Austin Gonyou
> Systems Architect, CCNA
> Coremetrics, Inc.
> Phone: 512-698-7250
> email: [EMAIL PROTECTED]
>
> "It is the part of a good shepherd to shear his flock, not to skin it."
> Latin Proverb
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I'm running apache 3.0.32 and a version of
http://snaps.php.net/php4-latest.tar.gz just fine on one of my development
boxen.  Just leting you know.  :)

Tyler
----- Original Message -----
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Austin Gonyou" <[EMAIL PROTECTED]>
Cc: "PHP General" <[EMAIL PROTECTED]>
Sent: Friday, February 22, 2002 1:58 AM
Subject: Re: [PHP] Apache 2.0.32 + PHP from CVS not working


> It won't work simply because Apache 2.0 is very much in a state of flux.
> The API's change constantly.  We are many months away from any sort of
> stable Apache2+PHP system.  Unless you are a developer and can help fix
> problems, you are much better off sticking with Apache 1.3.x and not
> bugging the developers trying to bring you Apache 2.
>
> -Rasmus
>
> On 21 Feb 2002, Austin Gonyou wrote:
>
> > The PHP-Dev list doesn't want to hear it, so I guess I'm *stuck* back
> > here.
> >
> > Will someone please tell me why the latest CVS of PHP won't let Apache
> > 2.0.32 work and when a graceful fix will be implemented?
> >
> > Hmm..this sounds like it should go to the dev list...
> > --
> > Austin Gonyou
> > Systems Architect, CCNA
> > Coremetrics, Inc.
> > Phone: 512-698-7250
> > email: [EMAIL PROTECTED]
> >
> > "It is the part of a good shepherd to shear his flock, not to skin it."
> > Latin Proverb
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
On Thu, 21 Feb 2002, Matthew J Gray wrote:

> No there really isn't.  I wrote an extension that does it for me, but
> I am waiting to see what the second zend engine will have for this
> rather that using my hack.  Maybe check the Zend Engine 2 mailing list
> to see what the future may hold.

        Is you extension available somewhere? Having this option
        would save me a lot of coding and AFAIK Zend 2 is not in 
        quite near future yet.

-- 
Mika Tuupola                      http://www.appelsiini.net/~tuupola/

--- End Message ---
--- Begin Message ---
You can sort of fake it using the call handler of the overload extension.

-Rasmus

On Thu, 21 Feb 2002, Mika Tuupola wrote:

>
>       Is there a way to create/add methods runtime to a class via
>       constructor or static factory method? I know it is possible
>       to create functions runtime using eval() or create_function()
>       but I havent been able to make them appear as methods for
>       a class.
>
> --
> Mika Tuupola                      http://www.appelsiini.net/~tuupola/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hi ,

I  have a problem in using the Header() function. I want to automatically
redirect the page into another php script after a form completion but im
receiving this error "Warning: Cannot add header information - headers
already sent by ......"

Heres the script line:

header("Location: 8D_Anaform_Admin.php?action=form");

Please help im stuck here.




Regards,
Mike

--- End Message ---
--- Begin Message ---
You can't redirect after sending output unless you use Javascript or some
other weirdness.  Redirections are done before any output.

-Rasmus

On Fri, 22 Feb 2002, Michael P. Carel wrote:

> Hi ,
>
> I  have a problem in using the Header() function. I want to automatically
> redirect the page into another php script after a form completion but im
> receiving this error "Warning: Cannot add header information - headers
> already sent by ......"
>
> Heres the script line:
>
> header("Location: 8D_Anaform_Admin.php?action=form");
>
> Please help im stuck here.
>
>
>
>
> Regards,
> Mike
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hallo,

I would like to try Zend studio server as possible support
for the development team.
Until now i found only a Zend for php4.0.5, 4.0.6
4.1.0.
Does anybody know where can i find a Zend
server compatible with php4.0.4 ?

thanks
best regards
Ornella Fasolo 

--- End Message ---
--- Begin Message ---
Hello,

I'm new in use of php!
I have some problems to compile Win32 Php!
I want to include socket module in php and i don't because
i have some compilation errors.

Is there anybody who can help me?

cheers!
Fred
--- End Message ---
--- Begin Message ---
Hi folks,

Is there a function that extracts numbers from a string?

I can do this with ereg but it's quite slow when you have a long list of
variables to get through...

thanks!

dk



--- End Message ---
--- Begin Message ---
Try with preg_match_all()
PCRE functions are up to 25% faster than POSIX(ereg).

Best regards,
Andrey Hristov

----- Original Message ----- 
From: "DigitalKoala" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 22, 2002 1:44 PM
Subject: [PHP] function that extracts numbers from a string


> Hi folks,
> 
> Is there a function that extracts numbers from a string?
> 
> I can do this with ereg but it's quite slow when you have a long list of
> variables to get through...
> 
> thanks!
> 
> dk
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---

I have a special set of information retrieved from a while loop that I would
like a person to be able to edit and send back into a MySQL table.

I know all of the basic MySQL commands for doing such, but the PHP side to
get the input from the form to go in is really stumping me.

This is what I have:

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

$or = 0;

while($or < $orderidrows) {

$orderinfo = mysql_fetch_row($orderidinfo);
$domain[$or] = $orderinfo[2];
$cancel[$or] = $orderinfo[3];

print "<tr><td><font size=2 face=Arial> $domain[$or]</font></td><td><font
size=2 face=Arial>Cancel This Domain?</font></td><td><font size=2
face=Arial><input type=text name=confirm value='$cancel[$or]'
size=3></font></td>";

$or++;
}

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

The values/data I would normally insert into the MySQL from the form would be
$confirm, based on $domain - however, in this case, I have a number of rows
with the same
name. I've received help as far as distinguishing one row from another -
thanks.  :)

The problem I am really having is trying to insert the data back into one
particular table.  You see, when I select the data, I get multiple
orderid's with multiple domains attached to them.  When I try to UPDATE the
MySQL with the data, only the last orderid seems to be the one getting
updated.  And, to boot, I want to update based on the domain name (since
that is unique) and ignore the orderids.  I only used the orderids to pull
the data out.

So, I've been using a query like this in a loop;

$update = "UPDATE table2 SET cancel='$cancel[$a]' WHERE domain = $domain[$a]

Any suggestions?  I'm getting pretty desparate here!  :\

Thanks,

-Mike

--- End Message ---
--- Begin Message ---
Michael,

Been there recently!

You want to use variable variables:

$index=0;
for (index=0; $index < $rowcount; $index++){
$formvar='formvar'.$index;
$formvar=$$formvar;

Do the last two lines for each piece of data you want to handle.

Think about how you are isolating the formvars on the submitted page to
make sure that you are sure you are reading the right stuff.

Hope this helps.

George in Edinburgh



On Fri, 2002-02-22 at 12:24, Michael Romagnoli wrote:
> 
> I have a special set of information retrieved from a while loop that I would
> like a person to be able to edit and send back into a MySQL table.
> 
> I know all of the basic MySQL commands for doing such, but the PHP side to
> get the input from the form to go in is really stumping me.
> 
> This is what I have:
> 
> ---------------------
> 
> $or = 0;
> 
> while($or < $orderidrows) {
> 
> $orderinfo = mysql_fetch_row($orderidinfo);
> $domain[$or] = $orderinfo[2];
> $cancel[$or] = $orderinfo[3];
> 
> print "<tr><td><font size=2 face=Arial> $domain[$or]</font></td><td><font
> size=2 face=Arial>Cancel This Domain?</font></td><td><font size=2
> face=Arial><input type=text name=confirm value='$cancel[$or]'
> size=3></font></td>";
> 
> $or++;
> }
> 
> ----------------------
> 
> The values/data I would normally insert into the MySQL from the form would be
> $confirm, based on $domain - however, in this case, I have a number of rows
> with the same
> name. I've received help as far as distinguishing one row from another -
> thanks.  :)
> 
> The problem I am really having is trying to insert the data back into one
> particular table.  You see, when I select the data, I get multiple
> orderid's with multiple domains attached to them.  When I try to UPDATE the
> MySQL with the data, only the last orderid seems to be the one getting
> updated.  And, to boot, I want to update based on the domain name (since
> that is unique) and ignore the orderids.  I only used the orderids to pull
> the data out.
> 
> So, I've been using a query like this in a loop;
> 
> $update = "UPDATE table2 SET cancel='$cancel[$a]' WHERE domain = $domain[$a]
> 
> Any suggestions?  I'm getting pretty desparate here!  :\
> 
> Thanks,
> 
> -Mike
> 
> 



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

--- End Message ---
--- Begin Message ---
Better is:
 $index=0;
 for (index=0; $index < $rowcount; $index++){
 $formvar=${'formvar'.$index};
}
 
----- Original Message ----- 
From: "george Pitcher" <[EMAIL PROTECTED]>
To: "Michael Romagnoli" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 22, 2002 2:40 PM
Subject: Re: [PHP] Getting the data for MySQL and then putting it back withPHP - at a 
loss!


> Michael,
> 
> Been there recently!
> 
> You want to use variable variables:
> 
> $index=0;
> for (index=0; $index < $rowcount; $index++){
> $formvar='formvar'.$index;
> $formvar=$$formvar;
> 
> Do the last two lines for each piece of data you want to handle.
> 
> Think about how you are isolating the formvars on the submitted page to
> make sure that you are sure you are reading the right stuff.
> 
> Hope this helps.
> 
> George in Edinburgh
> 
> 
> 
> On Fri, 2002-02-22 at 12:24, Michael Romagnoli wrote:
> > 
> > I have a special set of information retrieved from a while loop that I would
> > like a person to be able to edit and send back into a MySQL table.
> > 
> > I know all of the basic MySQL commands for doing such, but the PHP side to
> > get the input from the form to go in is really stumping me.
> > 
> > This is what I have:
> > 
> > ---------------------
> > 
> > $or = 0;
> > 
> > while($or < $orderidrows) {
> > 
> > $orderinfo = mysql_fetch_row($orderidinfo);
> > $domain[$or] = $orderinfo[2];
> > $cancel[$or] = $orderinfo[3];
> > 
> > print "<tr><td><font size=2 face=Arial> $domain[$or]</font></td><td><font
> > size=2 face=Arial>Cancel This Domain?</font></td><td><font size=2
> > face=Arial><input type=text name=confirm value='$cancel[$or]'
> > size=3></font></td>";
> > 
> > $or++;
> > }
> > 
> > ----------------------
> > 
> > The values/data I would normally insert into the MySQL from the form would be
> > $confirm, based on $domain - however, in this case, I have a number of rows
> > with the same
> > name. I've received help as far as distinguishing one row from another -
> > thanks.  :)
> > 
> > The problem I am really having is trying to insert the data back into one
> > particular table.  You see, when I select the data, I get multiple
> > orderid's with multiple domains attached to them.  When I try to UPDATE the
> > MySQL with the data, only the last orderid seems to be the one getting
> > updated.  And, to boot, I want to update based on the domain name (since
> > that is unique) and ignore the orderids.  I only used the orderids to pull
> > the data out.
> > 
> > So, I've been using a query like this in a loop;
> > 
> > $update = "UPDATE table2 SET cancel='$cancel[$a]' WHERE domain = $domain[$a]
> > 
> > Any suggestions?  I'm getting pretty desparate here!  :\
> > 
> > Thanks,
> > 
> > -Mike
> > 
> > 
> 
> 
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---


Yeah, but, where does $rowcount come from, $or?  Are you just renaming the
variable?

Thanks for your help!

-Mike


> -----Original Message-----
> From: george Pitcher [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 22, 2002 7:40 AM
> To: Michael Romagnoli
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Getting the data for MySQL and then putting it back
> withPHP - at a loss!
>
>
> Michael,
>
> Been there recently!
>
> You want to use variable variables:
>
> $index=0;
> for (index=0; $index < $rowcount; $index++){
> $formvar='formvar'.$index;
> $formvar=$$formvar;
>
> Do the last two lines for each piece of data you want to handle.
>
> Think about how you are isolating the formvars on the submitted page to
> make sure that you are sure you are reading the right stuff.
>
> Hope this helps.
>
> George in Edinburgh
>
>
>
> On Fri, 2002-02-22 at 12:24, Michael Romagnoli wrote:
> >
> > I have a special set of information retrieved from a while loop
> that I would
> > like a person to be able to edit and send back into a MySQL table.
> >
> > I know all of the basic MySQL commands for doing such, but the
> PHP side to
> > get the input from the form to go in is really stumping me.
> >
> > This is what I have:
> >
> > ---------------------
> >
> > $or = 0;
> >
> > while($or < $orderidrows) {
> >
> > $orderinfo = mysql_fetch_row($orderidinfo);
> > $domain[$or] = $orderinfo[2];
> > $cancel[$or] = $orderinfo[3];
> >
> > print "<tr><td><font size=2 face=Arial>
> $domain[$or]</font></td><td><font
> > size=2 face=Arial>Cancel This Domain?</font></td><td><font size=2
> > face=Arial><input type=text name=confirm value='$cancel[$or]'
> > size=3></font></td>";
> >
> > $or++;
> > }
> >
> > ----------------------
> >
> > The values/data I would normally insert into the MySQL from the
> form would be
> > $confirm, based on $domain - however, in this case, I have a
> number of rows
> > with the same
> > name. I've received help as far as distinguishing one row from another -
> > thanks.  :)
> >
> > The problem I am really having is trying to insert the data
> back into one
> > particular table.  You see, when I select the data, I get multiple
> > orderid's with multiple domains attached to them.  When I try
> to UPDATE the
> > MySQL with the data, only the last orderid seems to be the one getting
> > updated.  And, to boot, I want to update based on the domain name (since
> > that is unique) and ignore the orderids.  I only used the
> orderids to pull
> > the data out.
> >
> > So, I've been using a query like this in a loop;
> >
> > $update = "UPDATE table2 SET cancel='$cancel[$a]' WHERE domain
> = $domain[$a]
> >
> > Any suggestions?  I'm getting pretty desparate here!  :\
> >
> > Thanks,
> >
> > -Mike
> >
> >
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>


--- End Message ---
--- Begin Message ---

So, then I have a sql command for updating the data with $formvar?  I would
work $domain into this because $domain is the unique identifier?

Like this:

$index=0;
  for (index=0; $index < $rowcount; $index++){
  $formvar=${'formvar'.$index};
  $sql = "UPDATE table2 SET domain = '".$domain[$index].'" cancel =
"'.$formvar'"";
 }

?

-Mike



>
> Better is:
>  $index=0;
>  for (index=0; $index < $rowcount; $index++){
>  $formvar=${'formvar'.$index};
> }
>
> ----- Original Message -----
> From: "george Pitcher" <[EMAIL PROTECTED]>
> To: "Michael Romagnoli" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, February 22, 2002 2:40 PM
> Subject: Re: [PHP] Getting the data for MySQL and then putting it
> back withPHP - at a loss!
>
>
> > Michael,
> >
> > Been there recently!
> >
> > You want to use variable variables:
> >
> > $index=0;
> > for (index=0; $index < $rowcount; $index++){
> > $formvar='formvar'.$index;
> > $formvar=$$formvar;
> >
> > Do the last two lines for each piece of data you want to handle.
> >
> > Think about how you are isolating the formvars on the submitted page to
> > make sure that you are sure you are reading the right stuff.
> >
> > Hope this helps.
> >
> > George in Edinburgh
> >
> >
> >
> > On Fri, 2002-02-22 at 12:24, Michael Romagnoli wrote:
> > >
> > > I have a special set of information retrieved from a while
> loop that I would
> > > like a person to be able to edit and send back into a MySQL table.
> > >
> > > I know all of the basic MySQL commands for doing such, but
> the PHP side to
> > > get the input from the form to go in is really stumping me.
> > >
> > > This is what I have:
> > >
> > > ---------------------
> > >
> > > $or = 0;
> > >
> > > while($or < $orderidrows) {
> > >
> > > $orderinfo = mysql_fetch_row($orderidinfo);
> > > $domain[$or] = $orderinfo[2];
> > > $cancel[$or] = $orderinfo[3];
> > >
> > > print "<tr><td><font size=2 face=Arial>
> $domain[$or]</font></td><td><font
> > > size=2 face=Arial>Cancel This Domain?</font></td><td><font size=2
> > > face=Arial><input type=text name=confirm value='$cancel[$or]'
> > > size=3></font></td>";
> > >
> > > $or++;
> > > }
> > >
> > > ----------------------
> > >
> > > The values/data I would normally insert into the MySQL from
> the form would be
> > > $confirm, based on $domain - however, in this case, I have a
> number of rows
> > > with the same
> > > name. I've received help as far as distinguishing one row
> from another -
> > > thanks.  :)
> > >
> > > The problem I am really having is trying to insert the data
> back into one
> > > particular table.  You see, when I select the data, I get multiple
> > > orderid's with multiple domains attached to them.  When I try
> to UPDATE the
> > > MySQL with the data, only the last orderid seems to be the one getting
> > > updated.  And, to boot, I want to update based on the domain
> name (since
> > > that is unique) and ignore the orderids.  I only used the
> orderids to pull
> > > the data out.
> > >
> > > So, I've been using a query like this in a loop;
> > >
> > > $update = "UPDATE table2 SET cancel='$cancel[$a]' WHERE
> domain = $domain[$a]
> > >
> > > Any suggestions?  I'm getting pretty desparate here!  :\
> > >
> > > Thanks,
> > >
> > > -Mike
> > >
> > >
> >
> >
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
Hi,

I've got a text file containing "blés, Châteaux ..."  (without quotes)

I'm reading this file like this

$FileName = "Test.txt";
$FileHand = fopen($FileName, "rb");
$Data = fread($FileHand, filesize($FileName));
fclose($FileHand);
print_r($Data);

Under Linux, by asking the script throught an HTTP server ... i've got the good text
blés, Châteaux ...

But when i launch the script through the console (under windows 2000) ... characters 
are translated :
blùs, Chôteaux ...

what does it means .. .?

Thanks for your help ...
--- End Message ---
--- Begin Message ---
Lars Torben Wilson wrote:

>On Thu, 2002-02-21 at 14:11, James Nord wrote:
>
>>Unfortunatly I know some that need to leave it.
>>
>>>If you would state exactly what the problem with the slash being
>>>there is, perhaps we could help you.
>>>
>>The HTML renderer  that comes with Java (jfc) renders the '>' due to the 
>>'/' being before it.  There may well be others (or older browser 
>>versions too) that choke on it .
>>
>>Oh well - output buffers it is then...
>>
>>/James
>>
>>-- 
>>Technology is a word that describes something that doesn't work yet.
>>      Douglas Adams
>>
>
>What is the actual component which is having a hard time rendering this?
>
The JTextPane

Example below,


import javax.swing.*;
import java.net.*;
import java.awt.*;

public class foo {
  public static void main(String[] args)  throws Exception {
    new foo(args[0]);
  }


 public foo(String url) throws Exception {
   Frame f = new Frame("Trailing Slash bug");
   JTextPane html = new JTextPane();
   f.add(html);
   f.pack();
   f.show();
   html.setPage(new URL(url));
   html.setEditable(false);
 }
}

/James

-- 
Technology is a word that describes something that doesn't work yet.
        Douglas Adams



--- End Message ---
--- Begin Message ---
Dear All,

          I am using PHP + MYSQL.  I have a question that I need some expert
to help.  That is:

How do I find out a next and preview row values by using PHP and MYSQL.  For
examples,

Row 10    ID00010    need this value
Row 11    ID00025    have this value on hand
Row 12    ID00063    need this value

The questions is how do I find out the values in Row 10 and Row 12, if and
only if I only have one data that is "ID00025" (select * from table where
field="ID00025") .  But, the questions is How do I find out the data in Row
10 and Row 12 which is "ID00010" and "ID00063" assume I don't know the
values of "ID00025" is in Row 11.

      Thank you so much for your help.


Mark Lo



--- End Message ---
--- Begin Message ---
> How do I find out a next and preview row values by using PHP and MYSQL.  For
> examples,

Take a look at the function 

mysql_result();

Chris

--- End Message ---
--- Begin Message ---
My dump:
# phpMyAdmin MySQL-Dump
# http://phpwizard.net/phpMyAdmin/
#
# Host: 192.168.1.11:3306 Database : test
# --------------------------------------------------------

#
# Table structure for table 'some'
#

CREATE TABLE some (
   id varchar(6) NOT NULL,
   descr varchar(250) NOT NULL
);

#
# Dumping data for table 'some'
#

INSERT INTO some VALUES ( 'ID0001', 'first line');
INSERT INTO some VALUES ( 'ID0002', 'Second line');
INSERT INTO some VALUES ( 'ID0010', 'Third row');
INSERT INTO some VALUES ( 'ID0015', 'Fourth row');
INSERT INTO some VALUES ( 'ID0023', 'Fifth row');
INSERT INTO some VALUES ( 'ID0026', 'Sixth row');

Try this sql on this table:
select * from some where id<'ID0015' order by id desc limit 0,1;
select * from some where id>'ID0015' order by id limit 0,1;
Best regards,
Andrey Hristov

----- Original Message ----- 
From: "Mark Lo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 22, 2002 5:15 PM
Subject: [PHP] Next and Preview Row


> Dear All,
> 
>           I am using PHP + MYSQL.  I have a question that I need some expert
> to help.  That is:
> 
> How do I find out a next and preview row values by using PHP and MYSQL.  For
> examples,
> 
> Row 10    ID00010    need this value
> Row 11    ID00025    have this value on hand
> Row 12    ID00063    need this value
> 
> The questions is how do I find out the values in Row 10 and Row 12, if and
> only if I only have one data that is "ID00025" (select * from table where
> field="ID00025") .  But, the questions is How do I find out the data in Row
> 10 and Row 12 which is "ID00010" and "ID00063" assume I don't know the
> values of "ID00025" is in Row 11.
> 
>       Thank you so much for your help.
> 
> 
> Mark Lo
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
The solution I have been using is to do three queries similar to the below

SELECT * FROM table WHERE field='ID00025'

SELECT * FROM table WHERE field<'ID00025' ORDER BY field DESC LIMIT 0,1

SELECT * FROM table WHERE field>'ID00025' ORDER BY field ASC LIMIT 0,1

If you whish more row returned change the number in the LIMIT
-- 
Raymond Gubala
Program Coordinator
Multimedia Design and Web Developer
Durham College
mailto:[EMAIL PROTECTED]

> From: "Mark Lo" <[EMAIL PROTECTED]>
> Date: Fri, 22 Feb 2002 23:15:18 +0800
> To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Subject: [PHP] Next and Preview Row
> 
> Dear All,
> 
> I am using PHP + MYSQL.  I have a question that I need some expert
> to help.  That is:
> 
> How do I find out a next and preview row values by using PHP and MYSQL.  For
> examples,
> 
> Row 10    ID00010    need this value
> Row 11    ID00025    have this value on hand
> Row 12    ID00063    need this value
> 
> The questions is how do I find out the values in Row 10 and Row 12, if and
> only if I only have one data that is "ID00025" (select * from table where
> field="ID00025") .  But, the questions is How do I find out the data in Row
> 10 and Row 12 which is "ID00010" and "ID00063" assume I don't know the
> values of "ID00025" is in Row 11.
> 
> Thank you so much for your help.
> 
> 
> Mark Lo
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
> The solution I have been using is to do three queries similar to the below
> SELECT * FROM table WHERE field='ID00025'
> SELECT * FROM table WHERE field<'ID00025' ORDER BY field DESC LIMIT 0,1
> SELECT * FROM table WHERE field>'ID00025' ORDER BY field ASC LIMIT 0,1
> If you whish more row returned change the number in the LIMIT

Why bother with 3 queries?  It's a waste of resources, especially if
you are working with the same record set...

Example (pseudo)code:

<?

    $query = "SELECT * FROM table";
    $result = mysql( $dbname, $query );

   for( $i = 0; $i < mysql_num_rows( $result ); $i++ ) {
     echo "Previous field: " . mysql_result( $result, ( $i - 1 ), "field" );
     echo "Current field: " . mysql_result( $result, $i, "field" );
     echo "Next field: " . mysql_result( $result, ( $i + 1 ), "field" );

    }

?>

Chris

--- End Message ---
--- Begin Message ---
End goals
- avoid using CGI
- restrict PHP programs to user directory
- allow PHP from http to manipulate files/links/uploads/etc...

Apache main config sets user and group to "nobody"
Apache Virtual Host for site contains
        # restrict web pages root in specific sub-directory
  DocumentRoot /www/user1/public
        # have web server run as user for file upload permissions,
        # and link/file set unset
  user user1
        # set group nobody if user belongs to group with permissions
  group nobody
        #set base dir for PHP operations to user "root" directory to allow
        # out of web accessible folder storage of inc files etc...
  php_admin_value open_base_dir /www/user1
        # provide upload directory within the php base directory for
        # permission to upload and move files to final location
  php_admin_value upload_tmp_dir /www/user1/tmp


Logically, this should...
- allow php to manipulate the users area fully but deny access to commands
outside his directory
- allow php to upload files into private tmp directory owned by user, which php
then has permission to relocate as needed
- allow php to create symlinks, delete files, any other such filesystem
operations within his personal tree
- require any executables to be within his directory tree for php to call them


Clarifications, corrections, comments?

Dave

--- End Message ---

Reply via email to