php-windows Digest 22 Jan 2006 23:02:15 -0000 Issue 2870

Topics (messages 26639 through 26642):

Re: [PHP] odd behavior SOLVED - MORE & IMPORTANT
        26639 by: Jay Blanchard

Re: Page-style data display system
        26640 by: Wayne Khan
        26641 by: Raul IONESCU

Re: exec php.exe in windows
        26642 by: Dave Kennedy

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 ---
[snip]
>From the offices of "You Ain't Gonna' Beleeeve Dis, Inc."

We barked up several trees, but there were no real squirrels.

PHP 4.4.1, the version on the server in question, comes with 2 flavors of
ini file, the dist and the recommended. I had copied the recommended and
renamed it php.ini, which is the one we have been using all day. I am
standing in the data center cursing and swearing and the network admin says,
"Maybe the ini file is hosed somehow." Of course I said that that could not
be the case. What could possibly be bad in the text file to cause this kind
of behavior?

As the afternoon wore on he kept asking if I could water down the ini file
because it was the placement of that file that caused the problem. Even when
I went the route of changing the environment variable I had problems. I told
him that several of the best minds in the world were working on the problem
and that the ini file could not be at fault really. I wanted to prove to him
that this could not be the case, so I renamed the
recommend->php.ini->php.ini.old and copied the dist version which was
renamed to php.ini. I moved it to the WINNT folder. I stopped and started
IIS. Lo' and behold, the php pages loaded fine, with no 404 error. I made a
change to the ini file. It showed up properly in phpinfo(). Dammit he had a
smug look on his faced when I departed the data center.

Apparently there is something wrong with the 'recommended' version. I will
have to compare them to see the differences so that maybe the problem could
be isolated so that furture users do not encounter the several hours of
frustration that I have encountered. You're all to be praised for your
knowledge and insight. Thank you.
[/snip]

I have found that it is not just with the recommended version. After some
more wrangling this morning I have narrowed it down to the doc_root =
directive in the ini file.

When I moved the 'dist' copy yesterday I had not gone through all of the
manual setup steps, so I had not changed doc_root and the extensions
directory. I set doc_root as follows;

doc_root = E:\sitegrp1

and the behaviors that we discussed yesterday reappeared. Here is the text
surrounding the directive

; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues.  The alternate is to use the
; cgi.force_redirect configuration below
doc_root = 

Is this the mystical "security issues" mentioned above (ihaven't located the
documentation it refers to at this point)? e:\sitegrp1 has several
directories below it, so it is not empty. Anyhow, more to chew on. Thanks
again for everyone's help. My php.ini happily resides in c:\php and is
properly located and parsed since PHPRC was added to the environment
variables (shouldn't this be part of the manual installation steps?).

--- End Message ---
--- Begin Message ---
Hi Daniel,
You won't need something so complicated as PEAR or what.

http://www.phpfreaks.com/tutorials/43/0.php 

Try out this tutorial. Its how I got my damned pagination code working. :)

-----Original Message-----
From: El Bekko [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 15, 2006 5:58 AM
To: [email protected]
Subject: [PHP-WIN] Re: Page-style data display system

Daniel Anderson wrote:
> Okay, I have a database table to which contains posts from people.
> I want to retrieve these and post them in a linear format (as I currently
have), but...! I want to have pages, each page has 50 rows from the database
at a time.
> 
> If I have 102 results, I want it to be separated into three pages.
> 
> Page: 1, 2, 3
> 
> The page link I want to be displayed in the URL as a variable: page=1
(example).
> 
> Each row is ordered with a primary key
> 
> page=1    will return the first 50 results (1 - 50)
> page=2    will return the next 50 results (51 - 100)
> page=3    will return the next two results (101 - 102)
> 
> I want a system that will automatically do this. I want the page numbers
to increase along with how many results are in the database. At the moment
there are only three, but in time it will grow. So essentially it should
start off at Page: 1, then increase as I hit the 50th entry.
> 
> Is there anyone who can help me with this?
> If you need more detail, please email me and I'll try to explain more
in-depth!
> 
> Many thanks!
> I hope you can help!
> 
> Thanks for your time all!
> 
>     ~Dan

Try something to the likes of this:

<?php

$pageid         = intval($_GET['page']);
$startlimit = ($pageid - 1) * 50;
$endlimit       =  $pageid * 50;

mysql_query("SELECT * FROM yourtable LIMIT $startlimit , $endlimit");

?>

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

--- End Message ---
--- Begin Message ---
Or just try this: http://www.phpclasses.org/browse/package/2832.html
It's very easy to use.

On 1/20/06, Wayne Khan <[EMAIL PROTECTED]> wrote:
> Hi Daniel,
> You won't need something so complicated as PEAR or what.
>
> http://www.phpfreaks.com/tutorials/43/0.php
>
> Try out this tutorial. Its how I got my damned pagination code working. :)
>
> -----Original Message-----
> From: El Bekko [mailto:[EMAIL PROTECTED]
> Sent: Sunday, January 15, 2006 5:58 AM
> To: [email protected]
> Subject: [PHP-WIN] Re: Page-style data display system
>
> Daniel Anderson wrote:
> > Okay, I have a database table to which contains posts from people.
> > I want to retrieve these and post them in a linear format (as I currently
> have), but...! I want to have pages, each page has 50 rows from the database
> at a time.
> >
> > If I have 102 results, I want it to be separated into three pages.
> >
> > Page: 1, 2, 3
> >
> > The page link I want to be displayed in the URL as a variable: page=1
> (example).
> >
> > Each row is ordered with a primary key
> >
> > page=1    will return the first 50 results (1 - 50)
> > page=2    will return the next 50 results (51 - 100)
> > page=3    will return the next two results (101 - 102)
> >
> > I want a system that will automatically do this. I want the page numbers
> to increase along with how many results are in the database. At the moment
> there are only three, but in time it will grow. So essentially it should
> start off at Page: 1, then increase as I hit the 50th entry.
> >
> > Is there anyone who can help me with this?
> > If you need more detail, please email me and I'll try to explain more
> in-depth!
> >
> > Many thanks!
> > I hope you can help!
> >
> > Thanks for your time all!
> >
> >     ~Dan
>
> Try something to the likes of this:
>
> <?php
>
> $pageid         = intval($_GET['page']);
> $startlimit = ($pageid - 1) * 50;
> $endlimit       =  $pageid * 50;
>
> mysql_query("SELECT * FROM yourtable LIMIT $startlimit , $endlimit");
>
> ?>
>
> --
> PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Env:
Windows XP
PHP 4.3.10 (cgi-fcgi)
 
I am trying to capture the html output of Balance.php to a file:
The code loops over <month> and <branch> to build up a report in
export/Balance.html
 
exec('c:\php\php -q Balance.php export=all branch=<branch> month=<month>
login=admin password=admin >> export/Balance.html');
 
This command works in Linux when called from a web page.
In Windows it works from the command line 
but from a web page it hangs - a cmd and php process are left running in
the Windows Task Manager
 
Any help would be greatly appreciated

--- End Message ---

Reply via email to