php-general Digest 26 Feb 2005 16:42:01 -0000 Issue 3307

Topics (messages 209491 through 209508):

Re: how to increase maximum upload file size
        209491 by: Srinadh Sannidhanam

Re: FTP info in a variable
        209492 by: Warren Vail

Re: What's up with the list?
        209493 by: Rasmus Lerdorf

Re: adodb paging problem
        209494 by: Lester Caine

Re: PHP slowness
        209495 by: Gerard
        209496 by: Gerard
        209497 by: Gerard
        209501 by: Bostjan Skufca . domenca.com
        209502 by: Randy Johnson

Re: PHP and Access
        209498 by: pete M
        209500 by: Bruno Santos

Re: help with adding
        209499 by: pete M
        209504 by: Jamie Alessio

Re: Web Browser Timeout on Upload Script
        209503 by: zzapper

Quoting and $_POST['Name']  problem
        209505 by: zzapper

source code protection
        209506 by: shabanip

convert MS DOC -> PDF
        209507 by: mbneto

Re: Difficulty with  SQL LIKE clause
        209508 by: Stan F

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:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Even if I change that in php.ini it doesn't work. I changed LimitRequestBody 
value in <FILE> directive of php.conf located in  /etc/httpd/conf.d.  Now it is 
working fine. 
 
But, I am not sure how post_nax_size effects file uploads. In my server it is 
set to 8M and upload_max_filesize is 32M. I successfully uploaded a file with 
size 13M .
 
--Srinadh
Bret Hughes <[EMAIL PROTECTED]> wrote:

On Thu, 2005-02-24 at 06:32, Srinadh Sannidhanam wrote:
> Hi,
> In my application I need to allow the user to upload a file with size more 
> than 2M.
> I came to know that by default php will allow only 2M. How can change it.
> I changed, that in php.ini file and restarted apache. but still not working.
> How to solve this problem?
> 
> Thanks,

Seems like I had to change post_nax_size also. It is set to the same as
upload_max_size in my php.ini.

Bret


                
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - Helps protect you from nasty viruses.

--- End Message ---
--- Begin Message ---
Good stuff Jamie.

Steve, I believe it may even be possible to compress the file on the fly, or
send it using SSL if that is desirable;

http://www.php.net/manual/en/ref.stream.php describes how to use stream
wrappers.

good luck,

Warren Vail

> -----Original Message-----
> From: Jamie Alessio [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 25, 2005 9:13 AM
> To: php-general@lists.php.net
> Subject: [PHP] Re: FTP info in a variable
>
>
> > I have to write a little program that pulls information from a
> > database, formats it into csv format for importing into excel and ftps
> > it to another server.  I have everything worked out except for the
> > ftping.  I have read through http://us4.php.net/manual/en/ref.ftp.php
> > and I know I can get the data from the database, save it to a file and
> > ftp it.  Does anybody know if I can skip the step of saving it
> to a file
> > and ftp/stream it directly to a filename on another server?
> >
> Steve,
> You should be able to skip the step of writing the CSV file out to disk
> by using PHP's Filsystem functions along with FTP wrappers. I think
> something like this will work:
>
> $handle = fopen("ftp://user:[EMAIL PROTECTED]/somefile.csv", "w");
> fwrite($handle, $yourCSVdata);
>
> The FTP wrappers allow you to (almost) treat the file as though it were
> on your local filesystem.
>
> Check the man pages for details on how to do this properly and check for
> errors:
> http://us4.php.net/manual/en/function.fopen.php
> http://us4.php.net/manual/en/function.fwrite.php
> http://us4.php.net/manual/en/wrappers.ftp.php
>
> - Jamie
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message --- Our mailing list server has been getting bogged down so we are experimenting with some new code. That code got stuck last night. No mail was lost, but it did get held up until we woke up to fix it.

-Rasmus
--- End Message ---
--- Begin Message ---
pURbA wrote:

i've searched on the internet about my problem that i
have, and ended up with nothing. i believe some of u
guys have faced this problem before.

here is the problem:
i have a table for books, and want to display it using
adodb-pager.

Try http://phplens.com/lens/lensforum/topics.php?id=4

I can remember having a niggle with getting it set up, but not what the solution was ;)

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services

--- End Message ---
--- Begin Message ---
> Hi there, just for testings sake, you should get a script that figures
> out the page generation time for a php script... As luck would have it,
> I made a class for this not too long ago.  give this a whirl.
>
> First, create a php script with this in it...

<--snip-->

> It will color code it for you and everything, give it a whirl and let us
> know what it tells you.
>

Good one. A simple index gives me this:
0.001297 seconds

Which is normal. All it does is request a counter from the DB and add 1 to
it. However, the page STILL takes 5 seconds to load. Or rather; for 5
seconds it does NOTHING and then it suddenly loads.
This is not the case with .htm and .html files, they load at once...
Somewhere there must be something which slows the execution of .php files
for (exactly) 5 seconds.

I just don't know what to think of this anymore :S

- Gerard

> Gerard wrote:
>
> >Hello people,
> >
> >Recently, one of my webservers became rather slow. At first we thought it
> >was the MySQL backend, but when logged in on MySQL using the command line
> >tool over SSH, it runs as smooth as ever.
> >Static content (normal html pages) also load without delay. It seems that
> >the bottleneck is PHP itself.
> >For the sake of comparison, I created 2 test pages:
> >
> >http://www.debuginc.com/test.html
> >http://www.debuginc.com/test.php
> >
> >Everyone I asked says that the PHP page takes over 5 seconds to
> load while
> >the HTML one instantly displays. The only code in the PHP page is <? echo
> >'hello world'; ?>. No MySQL stuff, so that eliminates the initial idea of
> >MySQL causing the slowness.
> >
> >Nevertheless, it IS slow and I have no idea why or where to
> start looking.
> >The phpinfo() can be found on www.debuginc.com/info.php. Any
> help or hints
> >are highly appreciated.
> >
> >Another interesting note; this problem started a couple of days
> ago without
> >any changes in the config or anything. At first I upped the amount of
> >connections Apache would accept, but it soon turned out that was not the
> >problem.
> >
> >Thanks,
> >- Gerard

--- End Message ---
--- Begin Message ---
> Gerard wrote:
> > Another interesting note; if you click from page to page fast enough, it
> > doesn't take as long to load. For some reason, after the
> initial 5 second
> > startup hic, it loads consequent pages smoothly. If you wait
> for 10 seconds
> > and then click a link, it loads for 5 seconds again.
> >
> > I don't get this, especially since it seems to affect both PHP4
> and PHP5...
>
> strace it and see what is going on.  Compare the syscalls between a php
> request and a static request.  There will be a clue in there somewhere.
>
How would I go about stracing page requests? I never know which apache child
is going to handle which page.

> -Rasmus
>
- Gerard

--- End Message ---
--- Begin Message ---
<--snip-->
>
> I'm no expert on this stuff, but I'd be checking my swap space usage and
> RAM usage with 'top' or any other tools available...  I suppose you
> probably already did that, but...

Top shows that there's still normal non-swap memory available, so I don't
think that's it.

- Gerard

--- End Message ---
--- Begin Message ---
Create profiling information for your application with pear's Timer class or 
something similar.

regards,
Bostjan



On Saturday 26 February 2005 11:50, Gerard wrote:
> > Hi there, just for testings sake, you should get a script that figures
> > out the page generation time for a php script... As luck would have it,
> > I made a class for this not too long ago.  give this a whirl.
> >
> > First, create a php script with this in it...
>
> <--snip-->
>
> > It will color code it for you and everything, give it a whirl and let us
> > know what it tells you.
>
> Good one. A simple index gives me this:
> 0.001297 seconds
>
> Which is normal. All it does is request a counter from the DB and add 1 to
> it. However, the page STILL takes 5 seconds to load. Or rather; for 5
> seconds it does NOTHING and then it suddenly loads.
> This is not the case with .htm and .html files, they load at once...
> Somewhere there must be something which slows the execution of .php files
> for (exactly) 5 seconds.
>
> I just don't know what to think of this anymore :S
>
> - Gerard
>
> > Gerard wrote:
> > >Hello people,
> > >
> > >Recently, one of my webservers became rather slow. At first we thought
> > > it was the MySQL backend, but when logged in on MySQL using the command
> > > line tool over SSH, it runs as smooth as ever.
> > >Static content (normal html pages) also load without delay. It seems
> > > that the bottleneck is PHP itself.
> > >For the sake of comparison, I created 2 test pages:
> > >
> > >http://www.debuginc.com/test.html
> > >http://www.debuginc.com/test.php
> > >
> > >Everyone I asked says that the PHP page takes over 5 seconds to
> >
> > load while
> >
> > >the HTML one instantly displays. The only code in the PHP page is <?
> > > echo 'hello world'; ?>. No MySQL stuff, so that eliminates the initial
> > > idea of MySQL causing the slowness.
> > >
> > >Nevertheless, it IS slow and I have no idea why or where to
> >
> > start looking.
> >
> > >The phpinfo() can be found on www.debuginc.com/info.php. Any
> >
> > help or hints
> >
> > >are highly appreciated.
> > >
> > >Another interesting note; this problem started a couple of days
> >
> > ago without
> >
> > >any changes in the config or anything. At first I upped the amount of
> > >connections Apache would accept, but it soon turned out that was not the
> > >problem.
> > >
> > >Thanks,
> > >- Gerard

--- End Message ---
--- Begin Message ---
Did you try rotating your logs so your logs are fresh?


Randy

Gerard wrote:
<--snip-->

I'm no expert on this stuff, but I'd be checking my swap space usage and
RAM usage with 'top' or any other tools available...  I suppose you
probably already did that, but...


Top shows that there's still normal non-swap memory available, so I don't
think that's it.

- Gerard


--- End Message ---
--- Begin Message ---
Check this out
http://adodb.sourceforge.net/
http://phplens.com/adodb/code.initialization.html#init

have fun

Pete


Bruno Santos wrote:
Hello.

I need to to an application in PHP with graphics creation.
The database where i need to go and fetch the values is access.
is possible for PHP to fecth values from an access database ??

cheers

Bruno Santos


--- End Message ---
--- Begin Message ---
pete M wrote:

Check this out
http://adodb.sourceforge.net/
http://phplens.com/adodb/code.initialization.html#init

have fun

Pete


Bruno Santos wrote:

Hello.

I need to to an application in PHP with graphics creation.
The database where i need to go and fetch the values is access.
is possible for PHP to fecth values from an access database ??

cheers

Bruno Santos



Hello all. Thanks for all the answeres but i have a small problem. Im using Linux, not windows... Ive heard about unixODBC, can i used it to connect to a access database ??

cheers

--
[EMAIL PROTECTED]
www.feiticeir0.no-ip.org

--

[EMAIL PROTECTED]
www.hal.min-saude.pt

--- End Message ---
--- Begin Message --- Jay Fitzgerald wrote:
I have messed with this for a couple of days and cant get it right. Maybe I
need sleep :-)



The code below is echoing the qty correctly (10, 5, 25)

$total = 0;

for ($i = 1; $i <= $sendnum; $i++)

{

            $qty = $_POST['qty'.$i];

echo $qty . '<br />';
$total += $qty;

}



The question is, how would I take add each of these numbers (10+5+25)?



Any help is appreciated.





--- End Message ---
--- Begin Message ---
I have messed with this for a couple of days and cant get it right. Maybe I
need sleep :-)

The code below is echoing the qty correctly (10, 5, 25)

for ($i = 1; $i <= $sendnum; $i++)

{

            $qty = $_POST['qty'.$i];

            echo $qty . '<br />';

}

The question is, how would I take add each of these numbers (10+5+25)?

Jay,
Maybe I'm missing something here but wouldn't this do the trick?

///////////////
$total = 0;
for ($i = 1; $i <= $sendnum; $i++)
{
  $qty = $_POST['qty'.$i];
  echo $qty . '<br />';
  $total += $qty;
}
echo "Total = {$total}<br>";
///////////////

I have a suggestion related to how you are naming elements in your form. Based on the way you are accessing elements in your $_POST array it looks like your form is setup something like this:

<input name="qty1">
<input name="qty2">
...
<input name="qty99">

The problem is that when the form is posted you have no way to easily loop over all the "qty" elements. In your example you are using a for() loop with $sendnum which is a value you had to figure out one way or another. An easier solution might be to do something like this:

<input name="qty[1]">
<input name="qty[2]">
..
<input name="qty[99]">

and then in your PHP code you can easily loop over the values like this:

///////////////
$total = 0;
foreach($_POST['qty'] as $key => $value)
{
  echo "The quantity for {$key} is {$value}<br>";
  $total += $value;
}
echo "Total = {$total}<br>";
///////////////

Actually, now that all your values are now in an array you could remove the $total calculation from the loop and calculate it by doing this:

$total = array_sum($_POST['qty']);

Try using arrays in your forms instead of sticking numbers onto the end of your variable names and I think you'll find things getting much easier for you.

- Jamie
--- End Message ---
--- Begin Message ---
On Wed, 23 Feb 2005 13:01:18 -0800,  wrote:

>Hi,
>
>I am running a simple Upload script in PHP using a HTML Form with a File 
>field.  The user can browse their computer and upload a file.  It works great, 
>except for large files, where the browser will timeout.  The timeout appears 
>to happen after about 5 minutes.  Any ideas on how to get around this?
>
I dont think this is just a PHP problem.
I 've had it with 2 other scripting languages.

AFAIK the client browser timesout rather than the upload application. ie the 
client's broweser
thinks nothings going on and timesout.

I did read of a nasty fix, where you have a simple frameset where the app is in 
the main Frame and
there's a tiny "invisible"  frame where a piece of javaScript periodically 
refreshes or write's a
character to the frame to fool your browser.

I never tried but would like to hear your views

zzapper (vim, cygwin, wiki & zsh)
-- 

vim -c ":%s%s*%CyrnfrTfcbafbeROenzSZbbyranne%|:%s)[R-T]) )Ig|:norm G1VGg?"

http://www.vim.org/tips/tip.php?tip_id=305  Best of Vim Tips

--- End Message ---
--- Begin Message ---
Hi,
It's been a long day, but what's wrong here?.

echo $_POST['Location']; # good
echo "<br>";
echo "$_POST['Location']"; # bad nothing appears


zzapper (vim, cygwin, wiki & zsh)
-- 

vim -c ":%s%s*%CyrnfrTfcbafbeROenzSZbbyranne%|:%s)[R-T]) )Ig|:norm G1VGg?"

http://www.vim.org/tips/tip.php?tip_id=305  Best of Vim Tips

--- End Message ---
--- Begin Message ---
is there any way to protect PHP files source code?
thanks,
Payam Shabanian
shabanip -at- avapajoohesh.com

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

I have a bunch of M$ WORD documents (rtf and doc) that I'd like to
transform to pdf.

It would simple except that I'd like to allow the user to fill a
couple of variables (name, email, telephone) and replace this before
if generates the pdf.

After searching the net I found some classes but in order to use it
seems that I have to rewrite the entire document and some documents
have tables/images.

Any tips ?

- mb

--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "David Freedman" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Friday, February 25, 2005 11:27 PM
Subject: [PHP] Difficulty with SQL LIKE clause


> When I use this query in PHP it works, and I get all things with the YEAR
of
> 1977, as I expected.
>
> $query= "SELECT * FROM my_table WHERE Year LIKE 1977 ";
>
> But, when I use this query it does not work.
>
> $query= "SELECT * FROM my_table WHERE Year LIKE 197* ";
>
> I thought I should get the result of ALL things with the years in the
1970's
> (1970-1979).  But the asterisk in the LIKE clause does not seem to work.
> I have tried various syntax's to try to get the 197* recognized but
without
> any luck.
>
> Can the '*' be used? What am I doing wrong.


AFAIK you cannot. SQL wildcard symbols are % and _.


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

--- End Message ---

Reply via email to