php-general Digest 1 Jun 2002 10:39:18 -0000 Issue 1379

Topics (messages 100184 through 100215):

Re: Speed comparison of PHP vs. PERL (not conclusive)
        100184 by: Ilia A.
        100186 by: Manuel Lemos
        100206 by: Jason Wong
        100209 by: Dan Lowe

Finding what headers and content were already been sent
        100185 by: Noor Dawod
        100187 by: Rasmus Lerdorf
        100188 by: Noor Dawod
        100190 by: Rasmus Lerdorf
        100191 by: Noor Dawod
        100192 by: Rasmus Lerdorf

seesion_register() with arrays
        100189 by: Douglas - IG
        100195 by: John Holmes

cache control and cookies...
        100193 by: Gerard Samuel

Re: diplaying the path
        100194 by: Philip Olson

Re: Writing Files (Unix, Apache, PHP 4.0.X) [Newbie Alert]
        100196 by: John Holmes
        100210 by: Jason Teagle

Re: Form content type missing, how to fetch variables?
        100197 by: Simon Troup
        100198 by: John Holmes
        100199 by: Simon Troup

Apache, html, php and global variables
        100200 by: Peter Goggin
        100201 by: Stuart Dallas
        100204 by: Peter Goggin
        100205 by: John Holmes

Folio Infobase Parser/Converter
        100202 by: Richard Lynch

Re: Parsing file's
        100203 by: Scott

Not sure how to loop this...(Newbie)
        100207 by: webmaster.tececo.com
        100211 by: Jason Teagle

Re: MS SQL Problem
        100208 by: Justin Felker

Variables - Using The Contents Of A Varibale Name Built Dynamically
        100212 by: Jason Teagle

Affiliate PHP program project - Please help
        100213 by: r

Re: PHP Decisions and Issues
        100214 by: Justin Felker

Re: Hi all & Help :D
        100215 by: Anthony

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 ---
I agree that in most cases it makes more sence at seing the webpages per 
second benchmark rather then a timing of some artibtrary benchmarks that for 
example seeing how long it take to pick prime numbers. Since in the end it 
matters how quickly you can get the data to the user, in case of perl 
programs there would be the overhead of spawning a cgi program, (unless 
mod_perl is used) which would negate much of the speed improvment gained by 
Perl.
All that said, loops are very very common in PHP, and are used with virtually 
in any script that uses a database wether it be SQL or flatfile to loop 
through the result set. 
Since this appears to be a known performance issue, perphaps it is something 
the PHP Development team could consider improving for PHP 5.0

Ilia

On May 31, 2002 06:00 pm, Rasmus Lerdorf wrote:
> Sure, you could put it that way.  When benchmarking something you really
> should benchmark stuff that you actually care about.  Benchmark PHP
> spewing out a web page after making a couple of SQL queries, for example.
> That's typical usage, so that is what you should benchmark.  Very few PHP
> scripts are going to loop a couple of hundred thousand times to do
> something.
>
> -Rasmus
>
> On Fri, 31 May 2002, Ilia A. wrote:
> > Does this mean that running a comparison benchmarks between PHP and any
> > other language would in many cases show PHP to be slower simply because
> > it's looping code is slow? Unless, timing is done on a speed of PHP being
> > able to spew out webpages via the webserver with a webserver benchmark
> > tool such as apachebench?
> >
> > Wouldn't that cause any benchmarks trying to guage the speed of PHP
> > virtually meaningless because of the 'loop' overhead, which is clearly
> > great enough to make PHP way slower in comparison to Perl for example?
> >
> > Ilia
> >
> > On May 31, 2002 05:38 pm, Rasmus Lerdorf wrote:
> > > Not very surprising.  Perl's looping code has always ben faster than
> > > PHP's.  Highly iterative loops is really not what PHP is geared for. 
> > > You are not going to write a Mandelbrot algorithm in PHP.  You write it
> > > in C and drop in a super-quick extension into PHP and call
> > > mandelbrot().
> > >
> > > -Rasmus
> > >
> > > On Fri, 31 May 2002, Daniel Grace wrote:
> > > > This all started in a little debate between me and a friend of mine
> > > > who I think is as much a PERL zealot as I am a PHP zealot (I was
> > > > briefly pondering the idea of a Win32 API extension for PHP), and the
> > > > results were rather surprising -- to me, at least..
> > > >
> > > > It all started when I asked him what PERL had that PHP didn't in
> > > > terms of language (not taking community, modules, etc. into an
> > > > account). We both believed that the two would be very similiar in
> > > > speed -- he thought PERL would be a little faster but not enough to
> > > > be noticeable. For the first test, I went with a program that
> > > > computed prime numbers between 2 and 10000, using no form of caching
> > > > or anything like that. I gave him the PHP source with the task of
> > > > writing something in PERL as close to the original PHP source as
> > > > possible. The results:
> > > >
> > > > (note: I didn't know if PERL had PHP's continue(2), hence why I used
> > > > the slightly less efficient method here:)
> > > >
> > > > prime.php:
> > > > #!/usr/bin/php -q
> > > > <?php
> > > >
> > > > echo "2\n";
> > > >
> > > > for($check = 3 ; $check < 10000 ; $check += 2) {
> > > >         $prime = 1;
> > > >         $half = (int) $check / 2;
> > > >         for($against = 2 ; $against <= $half ; ++$against) {
> > > >                 if(!($check % $against)) {
> > > >                         $prime = 0;
> > > >                         break;
> > > >                 }
> > > >         }
> > > >         if($prime) echo "$check\n";
> > > > }
> > > >
> > > >
> > > > prime.pl:
> > > > #!/usr/bin/perl
> > > > # print "2\n";
> > > > my $num;
> > > > for ($num = 3; $num < 10000; $num+=2)
> > > > {
> > > >         my $prime = 1;
> > > >         for $check ( 2 .. int($num/2) )
> > > >         {
> > > >                 if ($num % $check == 0)
> > > >                 {
> > > >                         $prime = 0;
> > > >                         last;
> > > >                 }
> > > >         }
> > > > #        print "$num\n" if $prime;
> > > > }
> > > >
> > > >
> > > > The test machine is an AMD Duron 700 MHz using an a-bit KT7A
> > > > motherboard with 256 MB of PC100 SDRAM. uname -a reports "Linux
> > > > ulysses.venura.net 2.4.17-ulysses1 #1 Sat Dec 29 14:44:46 PST 2001
> > > > i686 unknown", PHP 4.2.1 was configured with
> > > > --enable-inline-optimization --prefix=[somepath], PERL 5.6.1 was
> > > > configured with -O3 (among other options) (PHP compiles with -g -O2
> > > > with no 'easy' (at-configure-time) way to change that, to my
> > > > knowledge).
> > > >
> > > > Both programs were ran once normally to verify they actually
> > > > generated prime numbers, and then the bash "time" command was used to
> > > > time them, piping their output to /dev/null to prevent that from
> > > > being a factor. I re-ran the tests a few times with results
> > > > consistently similiar to those listed here:
> > > >
> > > > The results:
> > > >
> > > > [dewin@ulysses profiling]$ time ./prime.php > /dev/null
> > > >
> > > > real    0m14.465s
> > > > user    0m8.610s
> > > > sys     0m0.070s
> > > >
> > > > [dewin@ulysses profiling]$ time ./prime.pl > /dev/null
> > > >
> > > > real    0m5.302s
> > > > user    0m3.180s
> > > > sys     0m0.000s
> > > >
> > > >
> > > >
> > > > A second system, with PHP compiled the same way and a PERL 5.6.1
> > > > binary distributed by Red Hat, 1.2 ghz with 442 MB of RAM:
> > > >
> > > > [root@mrr-016 law]# time ./prime.pl > /dev/null
> > > > real 0m2.078s
> > > > user 0m2.040s
> > > > sys 0m0.010s
> > > >
> > > > [root@mrr-016 law]# time ./prime.php > /dev/null
> > > > real 0m5.512s
> > > > user 0m5.430s
> > > > sys 0m0.010s
> > > >
> > > >
> > > > Comments? I was expecting the numbers to be very similiar -- rather
> > > > shocked that the PERL ended up being about 2.5x as fast as PHP was.
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php

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

On 05/31/2002 06:36 PM, Daniel Grace wrote:
> The results:
> 
> [dewin@ulysses profiling]$ time ./prime.php > /dev/null
> 
> real    0m14.465s
> user    0m8.610s
> sys     0m0.070s
> 
> [dewin@ulysses profiling]$ time ./prime.pl > /dev/null
> 
> real    0m5.302s
> user    0m3.180s
> sys     0m0.000s

Your measures do not distinguish between the compile time and execute time.

I don't know about Perl, but since PHP 4, Zend engine first compiles PHP 
code into opcodes and only then it executes the code.


-- 

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
On Saturday 01 June 2002 06:20, Daniel Grace wrote:
> > > language would in many cases show PHP to be slower simply because it's
> > > looping code is slow? [...]
>
> It is typical usage, yes, but the conversation that gave me the idea to do
> the quick speed comparison was the idea that PHP can be used for more than
> just web-scripting. I have a couple maintenance PHP scripts that run
> command-line (usually management/maintenance programs for a large PHP+MySQL
> app), and there is the entire php-gtk project as well. (The whole
> conversation started because I pondered the idea of maybe writing a Win32
> API extension for PHP)
>
> And a loop in PHP isn't exactly non-typical. I'd need more fingers and toes
> to count how many times I've wrote "while($row =
> mysql_fetch_assoc($result)) { ... }"

I would have thought that any inherent 'slowness' of looping code is 
insignificant compared to the time it takes to retrieve a row from a db.

Try comparing reading 10K rows from a DB using Perl and PHP would be a more 
useful benchmark.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Thank God a million billion times you live in Texas.
*/

--- End Message ---
--- Begin Message ---
Previously, Manuel Lemos wrote:
>
> Your measures do not distinguish between the compile time and execute time.
> 
> I don't know about Perl, but since PHP 4, Zend engine first compiles PHP 
> code into opcodes and only then it executes the code.
 
Perl is compiled internally prior to execution.

-- 
The process for understanding customers primarily involves sitting around
with other marketing people and talking about what you would to if you were
dumb enough to be a customer.
                                -Scott Adams, "The Dilbert Principle"
--- End Message ---
--- Begin Message ---
Hello,

I need to find out, at any point in a PHP script, which headers and what
content (HTML or other) have been sent already. I know I can use output
buffering, but in my case, this is not going to work.

By the way, I know that PHP's phpinfo() function lists headers received
and headers sent, but I couldn't find how can I access them in PHP. In
addition, how do I know what content has been sent at any point in a
script?

Thanks in advance for your help.

Noor

P.S.: Output buffer is not an option, so no solution there.

--- End Message ---
--- Begin Message ---
> I need to find out, at any point in a PHP script, which headers and what
> content (HTML or other) have been sent already. I know I can use output
> buffering, but in my case, this is not going to work.

You really have no way of knowing since it is the web server that decides
which http headers to ultimately send.

> By the way, I know that PHP's phpinfo() function lists headers received
> and headers sent, but I couldn't find how can I access them in PHP. In
> addition, how do I know what content has been sent at any point in a
> script?

$HTTP_* has them all.

-Rasmus

--- End Message ---
--- Begin Message ---
And how do I KNOW which $HTTP_ variables are being set?
Also, does $HTTP_ACCEPT_LANGUAGE mean that "Accept-Language" command has
been sent by the browser?
In my Windows configuration, using CGI version for example, I don't see
also the headers sent by the server...

Noor


-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: ? 01 ???? 2002 00:34
To: Noor Dawod
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Finding what headers and content were already been
sent

> By the way, I know that PHP's phpinfo() function lists headers
received
> and headers sent, but I couldn't find how can I access them in PHP. In
> addition, how do I know what content has been sent at any point in a
> script?

$HTTP_* has them all.

-Rasmus


--- End Message ---
--- Begin Message ---
You can loop through $GLOBALS and check for vars that start with "HTTP_",
but yes, you typically know which things you are interested in.

And no, $HTTP_* are only the request headers.  For the Apache module
version there is of course also getallheaders()

-Rasmus

On Sat, 1 Jun 2002, Noor Dawod wrote:

> And how do I KNOW which $HTTP_ variables are being set?
> Also, does $HTTP_ACCEPT_LANGUAGE mean that "Accept-Language" command has
> been sent by the browser?
> In my Windows configuration, using CGI version for example, I don't see
> also the headers sent by the server...
>
> Noor
>
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: ? 01 ???? 2002 00:34
> To: Noor Dawod
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Finding what headers and content were already been
> sent
>
> > By the way, I know that PHP's phpinfo() function lists headers
> received
> > and headers sent, but I couldn't find how can I access them in PHP. In
> > addition, how do I know what content has been sent at any point in a
> > script?
>
> $HTTP_* has them all.
>
> -Rasmus
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Ok, I understand about the request headers.

While searching the archives, I've seen many requests from many people
asking similar questions. You even answered some. The thing is that
while there's a function to get request headers (getallheaders() or the
$HTTP_ vars), there's no function to list the response headers, although
you can easily see them in a phpinfo() page.

How hard it'll be to do that function? Why no one adds it to PHP
already? I mean, phpinfo() already knows of the response headers, why
not just write a function so that scripts can have access to them. That
of course is better than writing a private header() replacement, and
saving headers there for a later access.

Noor


-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: ? 01 ???? 2002 01:13
To: Noor Dawod
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Finding what headers and content were already been
sent


You can loop through $GLOBALS and check for vars that start with
"HTTP_",
but yes, you typically know which things you are interested in.

And no, $HTTP_* are only the request headers.  For the Apache module
version there is of course also getallheaders()

-Rasmus

On Sat, 1 Jun 2002, Noor Dawod wrote:

> And how do I KNOW which $HTTP_ variables are being set?
> Also, does $HTTP_ACCEPT_LANGUAGE mean that "Accept-Language" command
has
> been sent by the browser?
> In my Windows configuration, using CGI version for example, I don't
see
> also the headers sent by the server...
>
> Noor
>
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: ? 01 ???? 2002 00:34
> To: Noor Dawod
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Finding what headers and content were already been
> sent
>
> > By the way, I know that PHP's phpinfo() function lists headers
> received
> > and headers sent, but I couldn't find how can I access them in PHP.
In
> > addition, how do I know what content has been sent at any point in a
> > script?
>
> $HTTP_* has them all.
>
> -Rasmus
>
>
>
> --
> 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 ---
Ok, I have added apache_response_headers() which returns the current set
of headers that Apache either knows about at this point (before the
headers are sent) or the set of sent headers once they have actually gone
out.  This will be in 4.3

-Rasmus

On Sat, 1 Jun 2002, Noor Dawod wrote:

> Ok, I understand about the request headers.
>
> While searching the archives, I've seen many requests from many people
> asking similar questions. You even answered some. The thing is that
> while there's a function to get request headers (getallheaders() or the
> $HTTP_ vars), there's no function to list the response headers, although
> you can easily see them in a phpinfo() page.
>
> How hard it'll be to do that function? Why no one adds it to PHP
> already? I mean, phpinfo() already knows of the response headers, why
> not just write a function so that scripts can have access to them. That
> of course is better than writing a private header() replacement, and
> saving headers there for a later access.
>
> Noor
>
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: ? 01 ???? 2002 01:13
> To: Noor Dawod
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Finding what headers and content were already been
> sent
>
>
> You can loop through $GLOBALS and check for vars that start with
> "HTTP_",
> but yes, you typically know which things you are interested in.
>
> And no, $HTTP_* are only the request headers.  For the Apache module
> version there is of course also getallheaders()
>
> -Rasmus
>
> On Sat, 1 Jun 2002, Noor Dawod wrote:
>
> > And how do I KNOW which $HTTP_ variables are being set?
> > Also, does $HTTP_ACCEPT_LANGUAGE mean that "Accept-Language" command
> has
> > been sent by the browser?
> > In my Windows configuration, using CGI version for example, I don't
> see
> > also the headers sent by the server...
> >
> > Noor
> >
> >
> > -----Original Message-----
> > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> > Sent: ? 01 ???? 2002 00:34
> > To: Noor Dawod
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Finding what headers and content were already been
> > sent
> >
> > > By the way, I know that PHP's phpinfo() function lists headers
> > received
> > > and headers sent, but I couldn't find how can I access them in PHP.
> In
> > > addition, how do I know what content has been sent at any point in a
> > > script?
> >
> > $HTTP_* has them all.
> >
> > -Rasmus
> >
> >
> >
> > --
> > 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
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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

I´m trying to register into a session an array which has returned from a 
mysql_fetch_array function. But when I call $array it returns empty or something like 
this.

Do you know how can I do this operation?

Regards!

Here go my scripts:
<?
# script1.php4
session_start();
$sql = "select * from table1";
$result = mysql_query ("$sql");
...
<form name="form1" method="post" action="test.php4?session_id=<?echo session_id();?>">

while ($array = mysql_fetch_array($result))
{...}
session_register ("array");
?>

<?
# script2.php4
session_start($session_id);
if (session_is_registered("array"))
{
  while ($array) {
  echo $array["fieldname"];
  }
}
else { echo "Error<br>"; }
?>

--- End Message ---
--- Begin Message ---
$array only contains one of the result rows, not all of them. At least
it's that way in your script. Try to register the variable before you
start assigning values to it and you'll have to add each row into an
array in order to save the entire result set.

---John Holmes...

> -----Original Message-----
> From: Douglas - IG [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 31, 2002 7:17 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] seesion_register() with arrays
> 
> Hi All,
> 
> I´m trying to register into a session an array which has returned from
a
> mysql_fetch_array function. But when I call $array it returns empty or
> something like this.
> 
> Do you know how can I do this operation?
> 
> Regards!
> 
> Here go my scripts:
> <?
> # script1.php4
> session_start();
> $sql = "select * from table1";
> $result = mysql_query ("$sql");
> ...
> <form name="form1" method="post" action="test.php4?session_id=<?echo
> session_id();?>">
> 
> while ($array = mysql_fetch_array($result))
> {...}
> session_register ("array");
> ?>
> 
> <?
> # script2.php4
> session_start($session_id);
> if (session_is_registered("array"))
> {
>   while ($array) {
>   echo $array["fieldname"];
>   }
> }
> else { echo "Error<br>"; }
> ?>


--- End Message ---
--- Begin Message ---
I dont know too much about cache control, but some of the users who use 
my script,
has problems with cookies.  They are able to log in and the cookie is 
set and they click a link and get booted out.
This past week, we noticed that when we commented out

header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");


they had no problems.  Im looking for others who had similar 
experiences, and a fix if possible.
Im not sure if its because the expires time is too far back.  The 
cookie's lifetime is 1 month.
Thanks

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/


--- End Message ---
--- Begin Message ---
> the bad thing about the BTW seciton is, is that it is not true inside of a
> function, that is the reason I refered to it as $GLOBALS['HTTP_REFERER']

That's not bad, it's a feature of PHP :)  All variables 
(even predefined variables) follow standard PHP variable 
scope rules (except superglobals) so 'global' is then 
used inside functions.  For those interested:

  http://www.php.net/manual/en/language.variables.scope.php
  http://www.php.net/manual/en/language.variables.predefined.php

But more importantly, the reason I responded is because 
your words contained no specifics, I felt it was important 
enough to mention some.

Regards,
Philip Olson



> 
> Jim lucas
> ----- Original Message -----
> From: "Philip Olson" <[EMAIL PROTECTED]>
> To: "Jim lucas" <[EMAIL PROTECTED]>
> Cc: "Kris Vose" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Friday, May 31, 2002 11:03 AM
> Subject: Re: [PHP] diplaying the path
> 
> 
> > actually:
> >
> > If the php directive register_globals is on, then
> > $HTTP_REFERER will exist. Otherwise it will not.
> > (or course that assumes a value exists at all).
> >
> > Regardless of the register_globals setting, you
> > can do:
> >
> >   // Works since PHP 3 (forever)*
> >   print $HTTP_SERVER_VARS['HTTP_REFERER'];
> >
> >   // Works since PHP 4.1.0
> >   print $_SERVER['HTTP_REFERER'];
> >
> > Btw, $GLOBALS['HTTP_REFERER'] === $HTTP_REFERER.
> > And lastly, since PHP 4.2.0 the register_globals
> > directive defaults to off, which is what Jim was
> > indirectly referring to.  See also extract().
> >
> > Regards,
> > Philip Olson
> >
> > * For versions older then 4.0.3 see also the
> >   track_vars directive, it should be on.
> >
> >
> > On Fri, 31 May 2002, Jim lucas wrote:
> >
> > > depending on what version of php you are running, you can use
> > > $GLOBALS['HTTP_REFERER'] or on newer versions you can use
> > > $_SERVER['HTTP_REFERER']
> > >
> > > Jim Lucas
> > > ----- Original Message -----
> > > From: "Kris Vose" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Friday, May 31, 2002 9:19 AM
> > > Subject: [PHP] diplaying the path
> > >
> > >
> > > > Is there a variable/function in php that will display the url location
> of
> > > the hyper-link that brought them to the current page.  Thanks in
> advance.
> > > >
> > > > Kris Vose
> > > >
> > >
> > >
> > > --
> > > 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 ---
Does the file already exist? It's not enough to change the directory
permissions, you also have to change it on the file if it exists, and
all of the folders above it, so that apache can get to the file. In
order for PHP to open or create this file, the user that apache runs as
must have permission to the folder and file.

---John Holmes...

> -----Original Message-----
> From: Jason Teagle [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 31, 2002 4:35 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Writing Files (Unix, Apache, PHP 4.0.X) [Newbie Alert]
> 
> I'm trying to open a file for writing using
> 
>             $hOutFile = fopen("filename.tmp","w");
> 
> but I'm getting "Permission denied". The directory has write
permission
> for
> all user levels. Since this is the root www directory, I also tried
> 
> 
>             $hOutFile = fopen("subdir/filename.tmp","w");
> 
> but this also gave the "Permission denied".
> 
> Can anyone suggest any reasons why this might happen? Do some hosts
not
> allow programs to write files like this? Database updates only?
> 
> I see a note at http://www.php.net/manual/en/function.fopen.php saying
> "check your Apache permissions..." - forgive me for being an idiot,
but
> how
> do I do that? {:v)
> 
> 
> --
> --------------------------------------------
> _ _
> o o    Jason Teagle
>  <      [EMAIL PROTECTED]
>  v
> --------------------------------------------
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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

"John Holmes" <[EMAIL PROTECTED]> wrote in message
001701c20901$eecbb4e0$b402a8c0@mango">news:001701c20901$eecbb4e0$b402a8c0@mango...

> Does the file already exist? It's not enough to change the directory
> permissions, you also have to change it on the file if it exists, and
> all of the folders above it, so that apache can get to the file. In
> order for PHP to open or create this file, the user that apache runs as
> must have permission to the folder and file.

Thanks for this answer. It did not already exist, so I tried creating it,
setting permissions manually and then that part worked. However, other
issues popped right up, as follows:

1. I'm trying to 'include' PHP files in my scripts that contain handy
functions I have prepared, like this:

include 'subdir/include_file.php';

When I set the permissions on this file to read only for everybody, the
include failed - I had expected only read permission to be necessary to
include the file - I had to give it execute permission! Why?

2. What are the minimum permissions necessary on files to do the following
with them:
a) 'include' them in other PHP files [PHP] (r?)
b) open them for reading only [PLAIN TEXT] (r?)
c) open a new file for writing only (no prior file) [PLAIN TEXT] (w?)
d) open a file for writing only when it already exists [PLAIN TEXT] (w?)
e) 'unlink' a file [PLAIN TEXT] (w?)
f) 'rename' a file [PLAIN TEXT] (w?)

3. What are the dangers of giving files permissions such as this (does it
make my site insecure by giving too much permission, is what I'm asking)?

4. I have heard that you can impersonate different user levels when doing
such operations so that you give the file different ownership - can you,
should I, how do I, and what dangers are there? Bear in mind this script
will be executed from the Web page as available to all and sundry.

What I'm trying to do is:

a) Read a text file and display contents as Web page
b) Get information from the user
c) Read another text file, building a new temp file as I go, and modifying
the data relevant to the user input
d) Deleting the old file and renaming the new to replace it


Sorry for all the questions, trying to get a grip on it. I'm used to C(++)
and local programs, so I don't get this problem {:v)

--
--------------------------------------------
_ _
o o    Jason Teagle
 <      [EMAIL PROTECTED]
 v
--------------------------------------------


--- End Message ---
--- Begin Message ---
Thanks Dan, but I don't think I'm explaining well.

Submitting that form will produce, from most browsers, a request that has in
one of it's headers:

content-type: x-www-form-urlencoded

... the variable $Foo will automatically be available within PHP for use in
any script that form is directed to, however, I have to write a script that
will accept raw data, it's input comes from a server that is not kind enough
to put in the header content-type: x-www-form-urlencoded and so is not
automatically being passed by PHP into the script.

The page content is just raw data like this ...

foo=boo&name=joe&action=jump

... but php does not pass them into variables as content-type is not
x-www-form-urlencoded

The answer could be "tell the people to add the content type" but they say
"by the end of june" and I need to read this stuff today!

Sorry if my explanation inadequate, I'm trying my best.

Thanks

Simon

> Simon:
> 
> <form method="post">
> <input type="submit" name="Foo" value="Boo" />
> </form>
> <?php
> if ( isset($_POST['Foo']) ) {
> echo '<p>' . $_POST['Foo'] . '</p>';
> }
> ?>
> 
> Viewing that the first time will show the form.  Submitting the form
> will show you the form again and then the value of Foo.
> 
> --Dan

--- End Message ---
--- Begin Message ---
So is it even a web page that's returned? Or is it more like a text
file?

Will getallheaders() help you at all?

www.php.net/getallheaders

---John Holmes...

> -----Original Message-----
> From: Simon Troup [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 31, 2002 8:23 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Form content type missing, how to fetch variables?
> 
> Thanks Dan, but I don't think I'm explaining well.
> 
> Submitting that form will produce, from most browsers, a request that
has
> in
> one of it's headers:
> 
> content-type: x-www-form-urlencoded
> 
> ... the variable $Foo will automatically be available within PHP for
use
> in
> any script that form is directed to, however, I have to write a script
> that
> will accept raw data, it's input comes from a server that is not kind
> enough
> to put in the header content-type: x-www-form-urlencoded and so is not
> automatically being passed by PHP into the script.
> 
> The page content is just raw data like this ...
> 
> foo=boo&name=joe&action=jump
> 
> ... but php does not pass them into variables as content-type is not
> x-www-form-urlencoded
> 
> The answer could be "tell the people to add the content type" but they
say
> "by the end of june" and I need to read this stuff today!
> 
> Sorry if my explanation inadequate, I'm trying my best.
> 
> Thanks
> 
> Simon
> 
> > Simon:
> >
> > <form method="post">
> > <input type="submit" name="Foo" value="Boo" />
> > </form>
> > <?php
> > if ( isset($_POST['Foo']) ) {
> > echo '<p>' . $_POST['Foo'] . '</p>';
> > }
> > ?>
> >
> > Viewing that the first time will show the form.  Submitting the form
> > will show you the form again and then the value of Foo.
> >
> > --Dan
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
This "non form" is a posted response from a commercial server quoting the
results of various transactions as pretty much a basic text dump. Weird I
know, and it is their problem/fault, however, I'm still left having to work
with it until such a time as they fix it (4 weeks, who knows why!). Also, it
is not a browser calling my script, it's just that, a raw text dump from a
server aimed at myscript.php

Thanks

Simon

> So is it even a web page that's returned? Or is it more like a text
> file?
> 
> Will getallheaders() help you at all?
> 
> www.php.net/getallheaders
> 
> ---John Holmes...
> 
>> -----Original Message-----
>> From: Simon Troup [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, May 31, 2002 8:23 PM
>> To: [EMAIL PROTECTED]
>> Subject: Re: [PHP] Form content type missing, how to fetch variables?
>> 
>> Thanks Dan, but I don't think I'm explaining well.
>> 
>> Submitting that form will produce, from most browsers, a request that
> has
>> in
>> one of it's headers:
>> 
>> content-type: x-www-form-urlencoded
>> 
>> ... the variable $Foo will automatically be available within PHP for
> use
>> in
>> any script that form is directed to, however, I have to write a script
>> that
>> will accept raw data, it's input comes from a server that is not kind
>> enough
>> to put in the header content-type: x-www-form-urlencoded and so is not
>> automatically being passed by PHP into the script.
>> 
>> The page content is just raw data like this ...
>> 
>> foo=boo&name=joe&action=jump
>> 
>> ... but php does not pass them into variables as content-type is not
>> x-www-form-urlencoded
>> 
>> The answer could be "tell the people to add the content type" but they
> say
>> "by the end of june" and I need to read this stuff today!
>> 
>> Sorry if my explanation inadequate, I'm trying my best.
>> 
>> Thanks
>> 
>> Simon
>> 
>>> Simon:
>>> 
>>> <form method="post">
>>> <input type="submit" name="Foo" value="Boo" />
>>> </form>
>>> <?php
>>> if ( isset($_POST['Foo']) ) {
>>> echo '<p>' . $_POST['Foo'] . '</p>';
>>> }
>>> ?>
>>> 
>>> Viewing that the first time will show the form.  Submitting the form
>>> will show you the form again and then the value of Foo.
>>> 
>>> --Dan
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
I do not know whether this is a question for this list, but if not perhaps
someone can tell me where to raise it.

I am designing a web site which has a number of  pages. One of these
provides the facility for the user to log onto a mysql database.  Other web
pages allow the user to query and update different tables in the database.

I used the mysql_pconnect function in the login page and assumed that the
connection would automatically be available to all other pages in the site
as they are invoked, but find that I have to include it in every page that
access the data base.

Is there any way of caryying the login information from one web page to the
next in global variables so that the username and password entered in the
login screen is available to all other web pages in the site or do I have to
ask the user to re-enter this information at every screen?


Regards

Peter Goggin


--- End Message ---
--- Begin Message ---
On Saturday, June 1, 2002 at 2:42:40 AM, you wrote:
> Is there any way of caryying the login information from one web page to the
> next in global variables so that the username and password entered in the
> login screen is available to all other web pages in the site or do I have to
> ask the user to re-enter this information at every screen?

Sessions: http://www.php.net/session

-- 
Stuart

--- End Message ---
--- Begin Message ---
I am not certain how this helps me, since it appears the data is only
carried to pages called directly from where it is set.  The page where the
user logs onto the database does not link to other pages. This is done from
the top frame of the form. The top frame of the inital page contains the
menu, one option of which is to log onto the data base to start a session.
The user will then select another page from the top form.

This new page is displayed in the bottom frame of the intial page, and there
may be futher links within this page on the bottom fram.Generally however
main navigation is from the top frame which remains in place through out.
What I wabt to do is to have the login information available at all times
once the user is logged in, nomattar how the current page is called.

Is this possible?

If so how is this done?


----- Original Message -----
From: "Stuart Dallas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 01, 2002 11:56 AM
Subject: Re: [PHP] Apache, html, php and global variables


> On Saturday, June 1, 2002 at 2:42:40 AM, you wrote:
> > Is there any way of caryying the login information from one web page to
the
> > next in global variables so that the username and password entered in
the
> > login screen is available to all other web pages in the site or do I
have to
> > ask the user to re-enter this information at every screen?
>
> Sessions: http://www.php.net/session
>
> --
> Stuart
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
You still have to connect to a database every time a script is run,
whether it's loaded in a frame or run by itself. If you start a session
and save the username and password in it, then you can use that login
and password on every other page that you call session_start() on. 

---John Holmes...

> -----Original Message-----
> From: Peter Goggin [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 31, 2002 11:12 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Apache, html, php and global variables
> 
> I am not certain how this helps me, since it appears the data is only
> carried to pages called directly from where it is set.  The page where
the
> user logs onto the database does not link to other pages. This is done
> from
> the top frame of the form. The top frame of the inital page contains
the
> menu, one option of which is to log onto the data base to start a
session.
> The user will then select another page from the top form.
> 
> This new page is displayed in the bottom frame of the intial page, and
> there
> may be futher links within this page on the bottom fram.Generally
however
> main navigation is from the top frame which remains in place through
out.
> What I wabt to do is to have the login information available at all
times
> once the user is logged in, nomattar how the current page is called.
> 
> Is this possible?
> 
> If so how is this done?
> 
> 
> ----- Original Message -----
> From: "Stuart Dallas" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, June 01, 2002 11:56 AM
> Subject: Re: [PHP] Apache, html, php and global variables
> 
> 
> > On Saturday, June 1, 2002 at 2:42:40 AM, you wrote:
> > > Is there any way of caryying the login information from one web
page
> to
> the
> > > next in global variables so that the username and password entered
in
> the
> > > login screen is available to all other web pages in the site or do
I
> have to
> > > ask the user to re-enter this information at every screen?
> >
> > Sessions: http://www.php.net/session
> >
> > --
> > Stuart
> >
> >
> > --
> > 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 ---
Please cc me on replies.  Thanks.

Anybody happen to have any leads to a Folio (4.1) 
reader/parser/converter to something PHP integrates with?

folio2xml
folio2CSV
folio2sql
.
.
.


A client's client needs to be able to upload Folio files and have 
them converted/integrated to the web.

They sent me a sample DEF, FFF, and RTF file.  Near as I can figure, 
it would be a few days to hack up a parser for the DEF/FFF files. 
Or, if all the content can survive the RTF output, I'm pretty sure 
there's a *LOT* of RTF readers "out there", right?

There are only about 1000 articles, and I suspect they have only one 
or two layout formats in them, but am not 100% sure that's how Folio 
works, much less that I'm right they didn't go hog-wild in 
formatting, since I've seen one (1) sample file so far.

I am not clear why the "Live Publish Migration Tool" I've seen 
mentioned in my 5-minute Google has not already pre-empted them 
hiring us in the first place...  Anybody know what would be the 
"catch" to that solution?  I'd be more than happy to save the client 
a bundle and have them just use that if it works well...

Disclaimer:  I have no idea how Folio works, its relationship to 
Infobase, if any, nor just how much headache I'm letting myself in 
for.  Any words of wisdom are most welcome.

Please cc me on replies.  Thanks.

-- 
Like Music? http://l-i-e.com/artists.htm
My hard drive crashed on April 28th...  Re-send any critical email.
--- End Message ---
--- Begin Message ---
Mark-

Trying it now, I think I understand what you doing with the code below.
I'll let you know.

Thank you!

-Scott

-----Original Message-----
From: Mark Heintz PHP Mailing Lists [mailto:[EMAIL PROTECTED]] 
Sent: Friday, May 31, 2002 4:43 PM
To: Scott
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Parsing file's

You may have been heading in the right direction originally with
array_slice...  This is off the top of my head, I don't guaruntee it
will
work...

$start = 34;
$interval = 15;
$max = 303;
// hop across orig. array 15 columns at a time
for($offset = $start;
    $offset < $max && isset($array[$offset]);
    $offset += $interval){
  // slice off $interval many columns starting at $offset
  $sub_array = array_slice($array, $i, $interval);
  // handle your $interval many key-value pairs
  foreach ($sub_array as $key => $value){
    $policyWriter = "$quoteKey|$key|$value";
    // ...
  }
}


mh.


On Fri, 31 May 2002, Scott wrote:

> That's what I mean by starring at this too much :)  I tried writting
to a
> seperate file, but is there a way to take an array and split it every
so
> many records within another loop?
>
> Let's say the first row contains the first 18 columns which I already
> parsed, I then want to grab the next 5 15 columns, but need to
seperate
> them in groups of 15.  I tried this:
>
> foreach ($output as $key => $value){
>   $policyWriter = "$quoteKey|$key|$value";
>   fwrite ($policyFile,"$policyWriter\r\n");
> }
>
> Which will take and print the rest of the row, but I needo split the
> columns into groups of 15.
>
> -Scott
>
>
>
>
>
> On Fri, 31 May 2002, Michael Davey wrote:
>
> > You should normalise your data - have a field in the second csv that
links
> > to the first csv and then you can have as many rows as you want
associated
> > with the record in the first file.
> >
> > Mikey
> >
> > "Scott" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I have a csv file that I am parsing, formatting and then writting
to a new
> > > file.  I am currently using an array, but I have some lines that
might
> > > contain more data than others.  I know for sure that columns 0-33
will
> > > always be there, but the customer has the option to add another
set of
> > > columns to the row if needed.  I do know that the addition's will
always
> > > be 18 columns and I do know that they can add up to 15 set's of
18.  So,
> > > the row length could be 0-33 or 0-51 if they add one additional
set or 303
> > > columns if they go up to 15.
> > >
> > > The tricky part is I have to format each column for the new file
that is
> > > created, I do this using sprintf.  I have so far tried to use
array_slice
> > >  for the first 18 columns, then I do another array_slice starting
at 18
> > > and using the column count to get the last column in the row.
Here is the
> > > code:
> > >
> > > array_slice($fields, 18,$lineCount);
> > > foreach ($fields as $key => $value){
> > > print "$key|$value\r\n";
> > > }
> > >
> > > The format of the new file will be this:
> > > 01-Customer information
> > > 02-Other information
> > > 03a Required Info (that can repeat up to 15 times per line)
> > > 03b ""
> > > 04b ""
> > > 04-Close Customer Record
> > >
> > > Repeat cycle for each row.  The inner loop happens between the 02
and 04
> > > records.  Remember, I need to format each individual column, they
are
> > > different format options.
> > >
> > > If you have some thoughts, I would be all ears as I have been
starring at
> > > this too long and too hard.
> > >
> > > Thanks,
> > >
> > > -Scott



--- End Message ---
--- Begin Message ---
I have this code:
 

$end_date = time();

$year = 2002;

$month = 4;

$monthi = $month + 1;

$time = SecondsInMonth($month, $year);

$time_i = SecondsInMonth($monthi, $year);

$query = "SELECT * FROM news WHERE date < $time_i AND date > $time ORDER BY id";

$result = mysql_query($query);

$num_results = mysql_num_rows($result);

 

echo '<tr><td><h3>';

echo date('F', mktime(12, 0, 0, ++$month));

echo '</h3></td>';

echo '<td>';

for ($i=0; $i < $num_results; $i++)

{

$row = mysql_fetch_array($result);

echo '<a href="news_temp.php?id=';

echo $row['id'];

echo '">: ';

echo $row['title'];

if(!$row['date'] == 0){

echo ' - ';

echo date("d-M-y", $row['date']);

}

echo ' :</a><br>';

}

echo '</td></tr>';

if($month == 12){

$year++;

$month = 0;

}

And I am not sure how to loop it.

It Currently prints like this:

May

: A Carbon Based Built Environment? - 21-May-02 :

I am not sure how to get the newest records to display at the top. Rather than the bottom. There is no looping yet as I am not sure how to do it. Can I reverse to results array or something? Every month is in a new set of cells.
 
Thanks,
 
--- End Message ---
--- Begin Message ---

<[EMAIL PROTECTED]> wrote in message
010001c20934$a71ab550$0200a8c0@JohnH">news:010001c20934$a71ab550$0200a8c0@JohnH...

>I am not sure how to get the newest records to display at the top. Rather
than the bottom.
>There is no looping yet as I am not sure how to do it. Can I reverse to
results array or
>something? Every month is in a new set of cells.

You should be able to reverse the order the recordsets are returned by
adding "DESC" after "ORDER BY id".

You say you don't know how to loop it, but you already have a loop ( "for
($i=0; $i < $num_results; $i++)" ) - which part do you feel also needs
looping?


--
--------------------------------------------
_ _
o o    Jason Teagle
 <      [EMAIL PROTECTED]
 v
--------------------------------------------


--- End Message ---
--- Begin Message ---
Thanks for the reply.  Actually, I am using both mssql_free_query and 
mssql_close along with mssql_pconnect.  It still happens however.  I can 
post the code if you are unsure.  Does it have a history of threading 
issues as it only seems to happen when several requests are sent all at 
once or at least in very fast succession.

Justin


At 06:56 PM 5/31/2002 -0700, you wrote:
>Hiya,
>were you using the appropriate free_query & close functions to free up the
>memory & more importantly the socket used to talk to the sql server?
>
>You might want to try using the _pconnect function if it's available instead
>of the usual _connect statement.
>
>I'd guess that PHP ran out of sockets to make outbound connections with.
>Also, I believe that MSSQL is setup to only have around 1000 max connections
>open unless you alter the value in the config.
>
>HTH,
>Dw
>
>
>Sqlcoders.com Dynamic data driven web solutions
>----- Original Message -----
>From: "Justin Felker" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: May 31 2002 08:46 AM
>Subject: [PHP] MS SQL Problem
>
>
> > Last night, I ran into a problem when using the MS SQL support in PHP
>under
> > Apache/PHP module/MS SQL 2000.  Everything worked well enough.  I was able
> > to connect to the server, query data, and a number of other
> > things.  However, I found that if I ran my test page (it connects to,
> > queries and displays 20 rows of data, then disconnects) over and over very
> > quickly (hold CTRL+R down basically) PHP would eventually (after about 6
> > seconds) fail to connect to the MS SQL server.  In fact, the web server
> > would have to be completely restarted before it could connect again.
> >
> > Has anyone run into this?  I mean, if there is no solution to this and is
> > the cause of basically shaky MS SQL support, then the SQL server would be
> > made useless for sites with even a modest amount of traffic (several
> > requests per second).  Is this a known problem?  If so, could anyone help
> > me out?
> >
> > Thanks!
> >
> > Justin
> >
> >
> > --
> > 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 ---
I have found an alternate way of achieving what I want, but I'm wondering if
there was an easier way. I have a PHP file that builds a Web page that
includes forms. The forms are built dynamically based on the contents of a
file, and thus there may be one or two or more forms on the page at any
time. This means that I have controls named $btnChoice1 (first form),
$btnChoice2 (second form), etc. (radio buttons). All of these forms are of a
similar format, and so lead to the same PHP page in their action - a
parameter is passed in the URL to identify which form it came from.

When the form passes to its action file, another PHP file, there are two
ways to get form data: $_POST["control_name"] or $control_name. The problem
is, the control name I need has to be built dynamically based on which form
it came from. So I need this:

$btnName = "btnChoice" . $form_number ;

But now I have the tricky bit - $_POST[$btnName] doesn't work because it
requires nested substitution of variables, and similarly I can't echo
$btnName because that will of course use "btnChoice2" instead of the
_contents_ of the control named btnChoice2.

Is it possible to 'dereference' (whatever the term is) the variable name
twice? I tried

$$btnName

in the stupid hope that it would first interpret that to

$btnChoice2

and then interpret that to the contents of the control, but of course it
failed.

I ended up using foreach on $_POST to pull out control names and their
contents, and comparing the control name to my built-up name - but I was
wondering if there's a more elegant way of doing what I wanted?

Promise my next question to the group will be short {:v)


--
--------------------------------------------
_ _
o o    Jason Teagle
 <      [EMAIL PROTECTED]
 v
--------------------------------------------


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

I'm doing an affiliate program for a small company in PHP, but am stuck a
bit in the logic or thinking process....

I have a table with IdNo,clicks,month,year

the affiliates will get a link like this
http://mysite.com/affiliates/aff.php?IdNo=775

every time I get a click from 775 in the table I am updating the table with
something like clicks=clicks+1 where month=6 and year=2002 and IdNo=775

My question is how do I get the current month/year from php or do I have to
query the database before every update to get month() and month(day)?

will I have to use something like
(for month) $mon=date(m);
(for year ) $yer=date(Y);

plus the main reason I am writing is to ask you gurus if I have the right
idea to make this work or is it done in some other way? Maybe you have done
a similar program and and can give me some valuble info/insight or wise
words? ;-)

OT- do you have any idea on how to contral the cursor in a form with 10
textfields? is it possible without javascript?

Thanks in advance for ANY help on this,
Have a great day,
-Ryan.

--- End Message ---
--- Begin Message ---
I just want to thank everyone for their responses.  I do realize this was 
not exactly a question that could be "answered" as such but I still wanted 
to hear some people that have had personal experiences dealing with similar 
issues.  FYI, I have read many websites that attempt to answer this 
question in one way or another, but I feel that the details I can get from 
places such as this mailing list are much better.

Anyways, to focus on one question I had asked, can anyone provide with 
websites that run using LAMP (large, higly trafficed 
websites)?  http://www.sourceforge.net comes to mind, but I don't know 
really what's going on in the background.  Specific examples would be 
helpful to my case.

Any ideas?

Justin

At 12:46 PM 5/31/2002 -0500, you wrote:
>On Fri, 31 May 2002, Justin Felker wrote:
> > I have spent the last hour pouring over this list's archive.
>
>(Not a flame, but I keep seeing this recently. The word is "poring".)

hehe, thanks.


> > I, along with several other people am starting a business which will 
> depend
> > heavily on its web presence.  Unfortunately, I am in the all too common
> > position of having to make technical decisions that will have 
> repercussions
> > on the future well-being of said business, with little to no 
> budget.  It is
> > crucial that the solution I pick, handle what we hope will become a very
> > large load in the not-to-distant future (whether this happens or not is a
> > question for another day, heh).  To this end, I am very interested in 
> using
> > the LAMP (Linux+Apache+MySQL+PHP) approach.  I have experience with all of
> > these technologies, but I am definitely not in a position to vouch for
> > their worthiness for use in a large scale application running beneath a
> > heavy load.
> >
> > To quantify LAMP's ability, is it appropriate for say, sites that generate
> > on the order of 5 million unique hits per day?  If not, where would you
> > draw the line?  At 500,000?  Or 1 million?  If so, how much higher 
> could it
> > go possibly?  10 million?  20?
> >
> > . . .
> >
> > So, what say you?  Given all that I have said, is LAMP appropriate?  Will
> > PHP and maybe even more importantly, MySQL be able to scale well?  I have
> > no doubt that MySQL is fast, but just how scaleable is it?  Will it die
> > beneath the kind of loads I have described?
>
>It's really difficult to answer this question without knowing a lot more
>about your application. But as a casual guess, if you reach that sort of
>traffic level, I'd say your stumbling block is going to by MySQL. At some
>point - granted, that point can be far away if you design your database
>and queries well - it will buckle under load.
>
>I'm too busy actually working, unfortunately, to pay attention to the
>bleeding edge developments in MySQL. But as it stands, there's no serious
>support for clustering, which means that when you are pushing more
>transactions than can be handled by the most expensive single machine you
>can afford, you've hit a brick wall. And as you know, there is a point
>after which multiple lesser-powered machines are a whole lot cheaper than
>a single mighty one.
>
>If your database transactions are mostly read-only, and you can segregate
>the infrequent write transactions to a separate server, you can do
>jury-rigged replication of the main data store and scale indefinitely.
>
>Otherwise, you'll probably have to plan with an eye to a migration path
>toward Oracle, DB2, or whatever. This doesn't mean you can't start out
>with MySQL, but it does mean you should develop with a database
>abstraction layer and shouldn't depend on features that are fast in MySQL
>but poorly supported by other databases (or emulated in the abstraction
>layer).
>
>As for Linux, Apache, and PHP, there's no limit to the transaction volume
>you can handle with even rudimentary load-balancing tactics, so that's
>nothing to worry about.
>
>miguel
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I have sorted the problem, thanks for all the support


"Adam Voigt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Try reversing the filelocations in your ftp_put, like
> if you have "remotelocation" and "mylocation", switch
> them to say "mylocation" then "remotelocation". Just
> a thought.
>
> Adam Voigt
> [EMAIL PROTECTED]
>
> On Thu, 2002-05-30 at 22:26, Anthony wrote:
> > Hi all, this is my first post on the php news groups, and im sure it
wont be
> > my last so I will first introduce my self, because im sure there are
some
> > regualar posters ;)
> >
> > My name is Anthony.. Im 14 years old and live in england, anything else
you
> > want to know ask :)
> >
> > Im working on a FTP uploader in php, but not for my own site, I want to
> > offer it was a service to so over people can upload to there sites using
my
> > FTP script... but when you put the destonation (once they have
connected) to
> > / it trys to upload to a path in my site.. can any one explain why this
is
> > and how to correct it, It would be aprechiated a lot, thanks
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>


--- End Message ---

Reply via email to