php-general Digest 9 Jun 2009 10:07:30 -0000 Issue 6166
Topics (messages 293765 through 293795):
Re: Show the entire browser request
293765 by: Dotan Cohen
293766 by: Matty Sarro
293768 by: Andrew Ballard
293769 by: Dotan Cohen
PHP running Python script - not waiting for Python script to finish
293767 by: Adrian Price-Whelan
293794 by: Per Jessen
Re: SHOULD I NOT USE "ELSE" IN IF STATEMENTS....?
293770 by: O. Lavell
key for in_array()
293771 by: tedd
293772 by: Andrew Ballard
293773 by: Dee Ayy
293786 by: Daniel Brown
Re: how to get rid of that annoying |
293774 by: PJ
293782 by: Robert Cummings
293783 by: PJ
293788 by: Robert Cummings
293792 by: PJ
Automated form generation?
293775 by: Skip Evans
293776 by: Shawn McKenzie
293777 by: Shawn McKenzie
293778 by: Skip Evans
293780 by: Tony Marston
293781 by: Tony Marston
293791 by: Manuel Lemos
Re: php applications
293779 by: Dee Ayy
293784 by: Larry Garfield
293785 by: Tom Worster
293787 by: Robert Cummings
293789 by: Paul M Foster
293793 by: Manuel Lemos
Strange PHP/Python problem
293790 by: Adrian Price-Whelan
293795 by: Robert Cummings
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 ---
> This should do it, I believe:
>
> <?php
>
> echo $_SERVER['REQUEST_METHOD'], ' ', $_SERVER['REQUEST_URI'], ' ',
> $_SERVER['SERVER_PROTOCOL'];
>
> ?>
>
Thanks, Andrew, I'm sure that works for correctly-formed requests.
However, I am trying to diagnose a web browser that is _not_ correctly
forming it's requests, therefore I need the real request itself, as it
was.
I am starting to realize that PHP is not the language for this, I may
have to look into an Apache module or something lower-level. Thanks!
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
--- End Message ---
--- Begin Message ---
If its the request from the browser, why not just fire up a packet sniffer
and get it that way? Unless it's using SSL/TLS/VPN/something that would
encrypt it, you should be able to see the request in clear text.
On Mon, Jun 8, 2009 at 4:40 PM, Dotan Cohen <[email protected]> wrote:
> > This should do it, I believe:
> >
> > <?php
> >
> > echo $_SERVER['REQUEST_METHOD'], ' ', $_SERVER['REQUEST_URI'], ' ',
> > $_SERVER['SERVER_PROTOCOL'];
> >
> > ?>
> >
>
> Thanks, Andrew, I'm sure that works for correctly-formed requests.
> However, I am trying to diagnose a web browser that is _not_ correctly
> forming it's requests, therefore I need the real request itself, as it
> was.
>
> I am starting to realize that PHP is not the language for this, I may
> have to look into an Apache module or something lower-level. Thanks!
>
> --
> Dotan Cohen
>
> http://what-is-what.com
> http://gibberish.co.il
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On Mon, Jun 8, 2009 at 4:40 PM, Dotan Cohen<[email protected]> wrote:
>> This should do it, I believe:
>>
>> <?php
>>
>> echo $_SERVER['REQUEST_METHOD'], ' ', $_SERVER['REQUEST_URI'], ' ',
>> $_SERVER['SERVER_PROTOCOL'];
>>
>> ?>
>>
>
> Thanks, Andrew, I'm sure that works for correctly-formed requests.
> However, I am trying to diagnose a web browser that is _not_ correctly
> forming it's requests, therefore I need the real request itself, as it
> was.
>
> I am starting to realize that PHP is not the language for this, I may
> have to look into an Apache module or something lower-level. Thanks!
>
> --
> Dotan Cohen
>
> http://what-is-what.com
> http://gibberish.co.il
>
I think you're probably correct. I would imagine the request has to be
at least well formed enough for the $_SERVER variables to be populated
in order for it to even get into PHP. Otherwise, the web server
wouldn't know what to do with it. The request method itself would have
to be something that PHP is told to handle (which from what I've seen
is usually only GET, POST or PUT, though other methods could be
configure); if the request_uri is messed up, it will generally result
in a 404 because the resource can't be found rather than a BAD REQUEST
response. I'm not sure what impact the protocol part of that line has.
For what you want, you probably need to write your own socket server
to listen for the request and echo it back to the client.
Andrew
--- End Message ---
--- Begin Message ---
> If its the request from the browser, why not just fire up a packet sniffer
> and get it that way? Unless it's using SSL/TLS/VPN/something that would
> encrypt it, you should be able to see the request in clear text.
>
The browser is running on a Symbian cellphone.
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
--- End Message ---
--- Begin Message ---
Hey -
Running these on a Linux server with PHP 5 and Python 2.5.
My problem is this: I have a simple php form that executes a long (~3
minutes) Python script using the 'exec' function from php. The issue
is that the browser, I think, 'times out' before the Python script is
finished and therefore kills Python and displays no output from
Python. After some intense googling, I haven't found an answer, but I
found a potential solution that I really want to avoid (manually
opening a process that runs in the background, and checking its status
until it is complete, then refreshing the web page). I'd much rather
find an easier way to do this, and thus I am asking for help either
way. If my only option is to open a job and monitor its status, could
someone help guide me through coding this? I've tried naïvely doing
exec("/path/to/executable arg1 arg2 >> /path/to/logfile 2>&1 &") but
it seems as though even this dies when the browser times out. Thanks!
-Adrian
--- End Message ---
--- Begin Message ---
Adrian Price-Whelan wrote:
> Hey -
>
> Running these on a Linux server with PHP 5 and Python 2.5.
>
> My problem is this: I have a simple php form that executes a long (~3
> minutes) Python script using the 'exec' function from php. The issue
> is that the browser, I think, 'times out' before the Python script is
> finished and therefore kills Python and displays no output from
> Python. After some intense googling, I haven't found an answer,
Can't you just change whichever timeout it is that terminates your
script?
/Per
--
Per Jessen, Zürich (17.2°C)
--- End Message ---
--- Begin Message ---
Dee Ayy wrote:
> It's for better code.
>
> Personally, I'm trying to get away from multiple return/exit paths,
Hurray for you :)
[..]
> At a minimum, I would change this:
>
> function doThisAndThat($bTrueOrFalse) {
> if ($bTrueOrFalse)
> {
> return 'It is true';
> }
>
> /* If the above is true we can be sure it's NOT true here. */ return
> 'It is false';
> }
>
> to this:
>
> function doThisAndThat($bTrueOrFalse) {
> $return_value = 'It is false'; // Set your default state here.
> if ($bTrueOrFalse)
> {
> $return_value = 'It is true'; // Update state.
> }
>
> return $return_value; // Only 1 exit path.
> }
Yes. This is also perfectly compatible with the diagramming method I
mentioned previously.
> I've also noticed that, for the most part, PHP itself codes
> functions_or_variables_like_this, while coming from Java, my PHP code
> looksLikeThis.
>
> Slightly more readable for say do_www_design versus doWWWDesign versus
> do_wwwd_esign for those times when you run into such names.
It shouldn't matter much which style you use, as long as you are
reasonably consistent in it.
--- End Message ---
--- Begin Message ---
Hi gang:
Does anyone have a slick way to determine what the key would be for a
successful find in in_array()?
Such as:
if (in_array($var, $array))
{
// what's they key for *this* successful find?
}
I know I could use:
foreach($array as $key => $value)
{
if ($value == $var)
{
// then I know what the key would be.
}
}
But is there a simpler way using in_array()?
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On Mon, Jun 8, 2009 at 5:29 PM, tedd<[email protected]> wrote:
> Hi gang:
>
> Does anyone have a slick way to determine what the key would be for a
> successful find in in_array()?
>
> Such as:
>
> if (in_array($var, $array))
> {
> // what's they key for *this* successful find?
> }
>
> I know I could use:
>
> foreach($array as $key => $value)
> {
> if ($value == $var)
> {
> // then I know what the key would be.
> }
> }
>
> But is there a simpler way using in_array()?
>
> Cheers,
>
> tedd
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
Try this instead:
http://us3.php.net/manual/en/function.array-search.php
Andrew
--- End Message ---
--- Begin Message ---
array_search
in the See Also section for in_array docs?
--- End Message ---
--- Begin Message ---
On Mon, Jun 8, 2009 at 17:33, Dee Ayy<[email protected]> wrote:
> array_search
> in the See Also section for in_array docs?
You and Andrew are quick today.
--
</Daniel P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000
--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
> PJ wrote:
>> I know this a silly question, but I can't figure out if it's even
>> possible to get rid of that final annoying | in my pagination script.
>>
>> <?echo "<p>Navigation</p>";
>>
>> echo (($page !=1)?"<a href='".build_url("books.php", "page",
>> 1)."'>first</a>":"first")." ... ";
>> echo (($page>1)?"<a href='".build_url("books.php", "page",
>> $page-1)."'>prev</a>":"prev")." | ";
>> for($i=$page; $i<=($page+$records_per_page-2)+1; $i++){
>> if ($i!=$page && $i<ceil($count/$records_per_page))
>> echo "<a href='".build_url("books.php", "page", $i)."'>$i</a>", "
>> | ";
>> elseif ($i>ceil($count/$records_per_page))
>> continue;
>> else echo $i, " | ";
>> }
---------------|
>> echo " | ... ".(($page<$count)?"<a href='".build_url("books.php",
>> "page", $page+1)."'>next</a>":"next");
>> echo " ... ".(($page<$count)?"<a href='".build_url("books.php", "page",
>> ceil($count/$records_per_page))."'>last</a>":"last");
>> //echo "<p>Table Order</p>";
>> echo "<br />Ordered alphabetically by book title : ";
>> echo $dir=="ASC"?"Ascending":"<a href='".build_url("books.php", "dir",
>> "asc")."'>Ascending</a>";
>> echo " | ";
>> echo $dir=="DESC"?"Descending":"<a href='".build_url("books.php", "dir",
>> "desc")."'>Descending</a>";
>> echo "<br />";?>
>>
>> This produces a very nifty pagination - the problem is how to get rid of
>> the final pages that show up as greater than what is available. The
>> script above works fine, except it leaves that final | ...
>> Any simple solutions?
>>
>
>
> Do it differently... build an array of the appropriate entries. When
> done, use implode( ' | ', $yourArray ).
>
> Cheers,
> Rob.
Hate to disappoint you all, but I finally found the errant | .
Ridiculous, really, that I bothered you all.
it's in the line indicated above --- echo " | ... " --- lose the | and
it all works like a charm.
:-) ;-)
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
PJ wrote:
Robert Cummings wrote:
PJ wrote:
I know this a silly question, but I can't figure out if it's even
possible to get rid of that final annoying | in my pagination script.
<?echo "<p>Navigation</p>";
echo (($page !=1)?"<a href='".build_url("books.php", "page",
1)."'>first</a>":"first")." ... ";
echo (($page>1)?"<a href='".build_url("books.php", "page",
$page-1)."'>prev</a>":"prev")." | ";
for($i=$page; $i<=($page+$records_per_page-2)+1; $i++){
if ($i!=$page && $i<ceil($count/$records_per_page))
echo "<a href='".build_url("books.php", "page", $i)."'>$i</a>", "
| ";
elseif ($i>ceil($count/$records_per_page))
continue;
else echo $i, " | ";
}
---------------|
echo " | ... ".(($page<$count)?"<a href='".build_url("books.php",
"page", $page+1)."'>next</a>":"next");
echo " ... ".(($page<$count)?"<a href='".build_url("books.php", "page",
ceil($count/$records_per_page))."'>last</a>":"last");
//echo "<p>Table Order</p>";
echo "<br />Ordered alphabetically by book title : ";
echo $dir=="ASC"?"Ascending":"<a href='".build_url("books.php", "dir",
"asc")."'>Ascending</a>";
echo " | ";
echo $dir=="DESC"?"Descending":"<a href='".build_url("books.php", "dir",
"desc")."'>Descending</a>";
echo "<br />";?>
This produces a very nifty pagination - the problem is how to get rid of
the final pages that show up as greater than what is available. The
script above works fine, except it leaves that final | ...
Any simple solutions?
Do it differently... build an array of the appropriate entries. When
done, use implode( ' | ', $yourArray ).
Cheers,
Rob.
Hate to disappoint you all, but I finally found the errant | .
Ridiculous, really, that I bothered you all.
it's in the line indicated above --- echo " | ... " --- lose the | and
it all works like a charm.
:-) ;-)
You didn't disappoint me... I've seen code like that before, I just
thought you'd benefit from a cleaner approach instead of the above mess.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
> PJ wrote:
>> Robert Cummings wrote:
>>> PJ wrote:
>>>> I know this a silly question, but I can't figure out if it's even
>>>> possible to get rid of that final annoying | in my pagination script.
>>>>
>>>> <?echo "<p>Navigation</p>";
>>>>
>>>> echo (($page !=1)?"<a href='".build_url("books.php", "page",
>>>> 1)."'>first</a>":"first")." ... ";
>>>> echo (($page>1)?"<a href='".build_url("books.php", "page",
>>>> $page-1)."'>prev</a>":"prev")." | ";
>>>> for($i=$page; $i<=($page+$records_per_page-2)+1; $i++){
>>>> if ($i!=$page && $i<ceil($count/$records_per_page))
>>>> echo "<a href='".build_url("books.php", "page", $i)."'>$i</a>", "
>>>> | ";
>>>> elseif ($i>ceil($count/$records_per_page))
>>>> continue;
>>>> else echo $i, " | ";
>>>> }
>> ---------------|
>>>> echo " | ... ".(($page<$count)?"<a href='".build_url("books.php",
>>>> "page", $page+1)."'>next</a>":"next");
>>>> echo " ... ".(($page<$count)?"<a href='".build_url("books.php",
>>>> "page",
>>>> ceil($count/$records_per_page))."'>last</a>":"last");
>>>> //echo "<p>Table Order</p>";
>>>> echo "<br />Ordered alphabetically by book title : ";
>>>> echo $dir=="ASC"?"Ascending":"<a href='".build_url("books.php", "dir",
>>>> "asc")."'>Ascending</a>";
>>>> echo " | ";
>>>> echo $dir=="DESC"?"Descending":"<a href='".build_url("books.php",
>>>> "dir",
>>>> "desc")."'>Descending</a>";
>>>> echo "<br />";?>
>>>>
>>>> This produces a very nifty pagination - the problem is how to get
>>>> rid of
>>>> the final pages that show up as greater than what is available. The
>>>> script above works fine, except it leaves that final | ...
>>>> Any simple solutions?
>>>>
>>>
>>> Do it differently... build an array of the appropriate entries. When
>>> done, use implode( ' | ', $yourArray ).
>>>
>>> Cheers,
>>> Rob.
>> Hate to disappoint you all, but I finally found the errant | .
>> Ridiculous, really, that I bothered you all.
>> it's in the line indicated above --- echo " | ... " --- lose the | and
>> it all works like a charm.
>>
>> :-) ;-)
>
> You didn't disappoint me... I've seen code like that before, I just
> thought you'd benefit from a cleaner approach instead of the above mess.
Actually, as I am new to this, I still have another little glitch which
is a pita. Oh, I know it's a bit of a mess; I have a hard time
following, myself. But, being lazy, I'm trying to fix thigs with a
band-aid. :-(
But I don't understand how I would "build an array of the appropriate
entries"... what entries do you mean?
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
PJ wrote:
Robert Cummings wrote:
PJ wrote:
Robert Cummings wrote:
PJ wrote:
I know this a silly question, but I can't figure out if it's even
possible to get rid of that final annoying | in my pagination script.
<?echo "<p>Navigation</p>";
echo (($page !=1)?"<a href='".build_url("books.php", "page",
1)."'>first</a>":"first")." ... ";
echo (($page>1)?"<a href='".build_url("books.php", "page",
$page-1)."'>prev</a>":"prev")." | ";
for($i=$page; $i<=($page+$records_per_page-2)+1; $i++){
if ($i!=$page && $i<ceil($count/$records_per_page))
echo "<a href='".build_url("books.php", "page", $i)."'>$i</a>", "
| ";
elseif ($i>ceil($count/$records_per_page))
continue;
else echo $i, " | ";
}
---------------|
echo " | ... ".(($page<$count)?"<a href='".build_url("books.php",
"page", $page+1)."'>next</a>":"next");
echo " ... ".(($page<$count)?"<a href='".build_url("books.php",
"page",
ceil($count/$records_per_page))."'>last</a>":"last");
//echo "<p>Table Order</p>";
echo "<br />Ordered alphabetically by book title : ";
echo $dir=="ASC"?"Ascending":"<a href='".build_url("books.php", "dir",
"asc")."'>Ascending</a>";
echo " | ";
echo $dir=="DESC"?"Descending":"<a href='".build_url("books.php",
"dir",
"desc")."'>Descending</a>";
echo "<br />";?>
This produces a very nifty pagination - the problem is how to get
rid of
the final pages that show up as greater than what is available. The
script above works fine, except it leaves that final | ...
Any simple solutions?
Do it differently... build an array of the appropriate entries. When
done, use implode( ' | ', $yourArray ).
Cheers,
Rob.
Hate to disappoint you all, but I finally found the errant | .
Ridiculous, really, that I bothered you all.
it's in the line indicated above --- echo " | ... " --- lose the | and
it all works like a charm.
:-) ;-)
You didn't disappoint me... I've seen code like that before, I just
thought you'd benefit from a cleaner approach instead of the above mess.
Actually, as I am new to this, I still have another little glitch which
is a pita. Oh, I know it's a bit of a mess; I have a hard time
following, myself. But, being lazy, I'm trying to fix thigs with a
band-aid. :-(
But I don't understand how I would "build an array of the appropriate
entries"... what entries do you mean?
You have links, each separated by the pipe '|' character. Add each link
to a links array:
<?php
$links = array();
foreach( $items as $item )
{
$links[] = '<a href="#">'.$item.'</a>';
}
echo implode( ' | ', $links );
?>
Hope that helps.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
>
>
> PJ wrote:
>> Robert Cummings wrote:
>>> PJ wrote:
>>>> Robert Cummings wrote:
>>>>> PJ wrote:
>>>>>> I know this a silly question, but I can't figure out if it's even
>>>>>> possible to get rid of that final annoying | in my pagination
>>>>>> script.
>>>>>>
>>>>>> <?echo "<p>Navigation</p>";
>>>>>>
>>>>>> echo (($page !=1)?"<a href='".build_url("books.php", "page",
>>>>>> 1)."'>first</a>":"first")." ... ";
>>>>>> echo (($page>1)?"<a href='".build_url("books.php", "page",
>>>>>> $page-1)."'>prev</a>":"prev")." | ";
>>>>>> for($i=$page; $i<=($page+$records_per_page-2)+1; $i++){
>>>>>> if ($i!=$page && $i<ceil($count/$records_per_page))
>>>>>> echo "<a href='".build_url("books.php", "page",
>>>>>> $i)."'>$i</a>", "
>>>>>> | ";
>>>>>> elseif ($i>ceil($count/$records_per_page))
>>>>>> continue;
>>>>>> else echo $i, " | ";
>>>>>> }
>>>> ---------------|
>>>>>> echo " | ... ".(($page<$count)?"<a href='".build_url("books.php",
>>>>>> "page", $page+1)."'>next</a>":"next");
>>>>>> echo " ... ".(($page<$count)?"<a href='".build_url("books.php",
>>>>>> "page",
>>>>>> ceil($count/$records_per_page))."'>last</a>":"last");
>>>>>> //echo "<p>Table Order</p>";
>>>>>> echo "<br />Ordered alphabetically by book title : ";
>>>>>> echo $dir=="ASC"?"Ascending":"<a href='".build_url("books.php",
>>>>>> "dir",
>>>>>> "asc")."'>Ascending</a>";
>>>>>> echo " | ";
>>>>>> echo $dir=="DESC"?"Descending":"<a href='".build_url("books.php",
>>>>>> "dir",
>>>>>> "desc")."'>Descending</a>";
>>>>>> echo "<br />";?>
>>>>>>
>>>>>> This produces a very nifty pagination - the problem is how to get
>>>>>> rid of
>>>>>> the final pages that show up as greater than what is available. The
>>>>>> script above works fine, except it leaves that final | ...
>>>>>> Any simple solutions?
>>>>>>
>>>>> Do it differently... build an array of the appropriate entries. When
>>>>> done, use implode( ' | ', $yourArray ).
>>>>>
>>>>> Cheers,
>>>>> Rob.
>>>> Hate to disappoint you all, but I finally found the errant | .
>>>> Ridiculous, really, that I bothered you all.
>>>> it's in the line indicated above --- echo " | ... " --- lose the | and
>>>> it all works like a charm.
>>>>
>>>> :-) ;-)
>>> You didn't disappoint me... I've seen code like that before, I just
>>> thought you'd benefit from a cleaner approach instead of the above
>>> mess.
>> Actually, as I am new to this, I still have another little glitch which
>> is a pita. Oh, I know it's a bit of a mess; I have a hard time
>> following, myself. But, being lazy, I'm trying to fix thigs with a
>> band-aid. :-(
>>
>> But I don't understand how I would "build an array of the appropriate
>> entries"... what entries do you mean?
>
> You have links, each separated by the pipe '|' character. Add each
> link to a links array:
>
> <?php
>
> $links = array();
> foreach( $items as $item )
> {
> $links[] = '<a href="#">'.$item.'</a>';
> }
>
> echo implode( ' | ', $links );
>
> ?>
>
> Hope that helps.
I'm afraid I still don't understand. I think you are seeing something
that I don't see. What do you mean by link in the present context... are
you talking about some snippet of code equaling each page or every page
in the db? This is an ever growing db.
Anyway, I finally found the error of my ways (at least in this code). It
may look sloppy, but then I haven't looked that hard for other examples.
Some I found were too simple, others too bloated.
At least, this one works for what I need and does exactly what I wanted.
:-)
Here's the final fixed code; some obvious (I hope) variables are left
out and precede the code:
echo (($page !=1)?"<a href='".build_url("books.php", "page",
1)."'>first</a>":"first")." ... ";
echo (($page>1)?"<a href='".build_url("books.php", "page",
$page-1)."'>prev</a>":"prev")." | ";
for($i=$page; $i<=($page+$records_per_page-2)+1; $i++){
if ($i>ceil($count/$records_per_page))
continue;
elseif ($i!=$page)
echo "<a href='".build_url("books.php", "page", $i)."'>$i</a>", " | ";
else
echo $i, " | ";
}
echo " ... ".(($page<ceil($count/$records_per_page))?"<a
href='".build_url("books.php", "page", $page+1)."'>next</a>":"next");
if ($page==ceil($count/$records_per_page))
echo " ... last";
elseif ($i!=ceil($count/$records_per_page)) echo " ...
".(($page<ceil($count/$records_per_page)+$records_per_page)?"<a
href='".build_url("books.php", "page",
ceil($count/$records_per_page))."'>last</a>":"last");
else echo " ... ".(($page<$count)?"<a href='".build_url("books.php",
"page", ceil($count/$records_per_page))."'>last</a>":"last");
echo "<br>Ordered alphabetically by book title : ";
echo $dir=="ASC"?"Ascending":"<a href='".build_url("books.php", "dir",
"asc")."'>Ascending</a>";
echo " | ";
echo $dir=="DESC"?"Descending":"<a href='".build_url("books.php", "dir",
"desc")."'>Descending</a>";
If there is a way to simplify things, please do let me know (with an
example, please)
PJ
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
Hey guys & gals & all ships at sea,
We've been approached by a central office of a relatively
large religious denomination that collects data from their
member churches in the form of an 11 page questionnaire with a
diverse set of questions ranging from multiple choice, essay
type, to financial statements.
It's currently all hand filled out and then hand typed in to a
MS Access database (shudder...).
They want to webify it so I'm wondering if anyone has any
recommendations on PHP based form generation tools that would
speed up the process of form creation and perhaps even the
inserts into MySQL.
So far I'm looking at phpFormGenerator here
http://phpformgen.sourceforge.net/
But it says "beta" which gives me some small pause, and I'm
actively browsing for others.
Any experience or advice others have here would be greatly
appreciated.
Any CMS out there that might have a tool for this that would
be quick to install and get up and going? Codeigniter have
one, any others???
Much thanks,
Skip
--
====================================
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut
--- End Message ---
--- Begin Message ---
Skip Evans wrote:
> Hey guys & gals & all ships at sea,
>
> We've been approached by a central office of a relatively large
> religious denomination that collects data from their member churches in
> the form of an 11 page questionnaire with a diverse set of questions
> ranging from multiple choice, essay type, to financial statements.
>
> It's currently all hand filled out and then hand typed in to a MS Access
> database (shudder...).
>
> They want to webify it so I'm wondering if anyone has any
> recommendations on PHP based form generation tools that would speed up
> the process of form creation and perhaps even the inserts into MySQL.
>
> So far I'm looking at phpFormGenerator here
>
> http://phpformgen.sourceforge.net/
>
> But it says "beta" which gives me some small pause, and I'm actively
> browsing for others.
>
> Any experience or advice others have here would be greatly appreciated.
>
> Any CMS out there that might have a tool for this that would be quick to
> install and get up and going? Codeigniter have one, any others???
>
> Much thanks,
>
> Skip
My first thought was CakePHP. Setup your database and run the cake bake
script and you will get all the forms, create, retrieve, update and
delete, as well as the PHP models and controllers to do it. Then you
just start customizing.
--
Thanks!
-Shawn
http://www.spidean.com
--- End Message ---
--- Begin Message ---
Skip Evans wrote:
> Hey guys & gals & all ships at sea,
>
> We've been approached by a central office of a relatively large
> religious denomination that collects data from their member churches in
> the form of an 11 page questionnaire with a diverse set of questions
> ranging from multiple choice, essay type, to financial statements.
>
> It's currently all hand filled out and then hand typed in to a MS Access
> database (shudder...).
>
> They want to webify it so I'm wondering if anyone has any
> recommendations on PHP based form generation tools that would speed up
> the process of form creation and perhaps even the inserts into MySQL.
>
> So far I'm looking at phpFormGenerator here
>
> http://phpformgen.sourceforge.net/
>
> But it says "beta" which gives me some small pause, and I'm actively
> browsing for others.
>
> Any experience or advice others have here would be greatly appreciated.
>
> Any CMS out there that might have a tool for this that would be quick to
> install and get up and going? Codeigniter have one, any others???
>
> Much thanks,
>
> Skip
My first thought was CakePHP. Setup your database and run the cake bake
script and you will get all the forms, create, retrieve, update and
delete, as well as the PHP models and controllers to do it. Then you
just start customizing.
--
Thanks!
-Shawn
http://www.spidean.com
--- End Message ---
--- Begin Message ---
Hey all,
I've read through the cakePHP docs for a potential project
once and thought it looked pretty well put together, and liked
it, but didn't get any hands on with it.
Sounds promising...
...any other comments on Cake for this solution?
Skip
Shawn McKenzie wrote:
Skip Evans wrote:
Hey guys & gals & all ships at sea,
We've been approached by a central office of a relatively large
religious denomination that collects data from their member churches in
the form of an 11 page questionnaire with a diverse set of questions
ranging from multiple choice, essay type, to financial statements.
It's currently all hand filled out and then hand typed in to a MS Access
database (shudder...).
They want to webify it so I'm wondering if anyone has any
recommendations on PHP based form generation tools that would speed up
the process of form creation and perhaps even the inserts into MySQL.
So far I'm looking at phpFormGenerator here
http://phpformgen.sourceforge.net/
But it says "beta" which gives me some small pause, and I'm actively
browsing for others.
Any experience or advice others have here would be greatly appreciated.
Any CMS out there that might have a tool for this that would be quick to
install and get up and going? Codeigniter have one, any others???
Much thanks,
Skip
My first thought was CakePHP. Setup your database and run the cake bake
script and you will get all the forms, create, retrieve, update and
delete, as well as the PHP models and controllers to do it. Then you
just start customizing.
--
====================================
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut
--- End Message ---
--- Begin Message ---
"Shawn McKenzie" <[email protected]> wrote in message
news:[email protected]...
> Skip Evans wrote:
>> Hey guys & gals & all ships at sea,
>>
>> We've been approached by a central office of a relatively large
>> religious denomination that collects data from their member churches in
>> the form of an 11 page questionnaire with a diverse set of questions
>> ranging from multiple choice, essay type, to financial statements.
>>
>> It's currently all hand filled out and then hand typed in to a MS Access
>> database (shudder...).
>>
>> They want to webify it so I'm wondering if anyone has any
>> recommendations on PHP based form generation tools that would speed up
>> the process of form creation and perhaps even the inserts into MySQL.
>>
>> So far I'm looking at phpFormGenerator here
>>
>> http://phpformgen.sourceforge.net/
>>
>> But it says "beta" which gives me some small pause, and I'm actively
>> browsing for others.
>>
>> Any experience or advice others have here would be greatly appreciated.
>>
>> Any CMS out there that might have a tool for this that would be quick to
>> install and get up and going? Codeigniter have one, any others???
>>
>> Much thanks,
>>
>> Skip
>
> My first thought was CakePHP. Setup your database and run the cake bake
> script and you will get all the forms, create, retrieve, update and
> delete, as well as the PHP models and controllers to do it. Then you
> just start customizing.
You can do the same thing with Radicore (http://www.radicore.org) - build
your database, import it into the data dictionary, export it to create the
basic List/Search/Create/Read/Update/Delete transactions. All withut writing
a single line of HTML, SQL or even PHP. You can customise these scripts to
your heart's content
As an added bonus you get a Role Based Access Control (RBAC) system, Audit
Logging, Workflow, Single or Two Factor Authentication for user logons, PDF
forms generation, and a whole host of other goodies.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
> --
> Thanks!
> -Shawn
> http://www.spidean.com
--- End Message ---
--- Begin Message ---
"Shawn McKenzie" <[email protected]> wrote in message
news:[email protected]...
> Skip Evans wrote:
>> Hey guys & gals & all ships at sea,
>>
>> We've been approached by a central office of a relatively large
>> religious denomination that collects data from their member churches in
>> the form of an 11 page questionnaire with a diverse set of questions
>> ranging from multiple choice, essay type, to financial statements.
>>
>> It's currently all hand filled out and then hand typed in to a MS Access
>> database (shudder...).
>>
>> They want to webify it so I'm wondering if anyone has any
>> recommendations on PHP based form generation tools that would speed up
>> the process of form creation and perhaps even the inserts into MySQL.
>>
>> So far I'm looking at phpFormGenerator here
>>
>> http://phpformgen.sourceforge.net/
>>
>> But it says "beta" which gives me some small pause, and I'm actively
>> browsing for others.
>>
>> Any experience or advice others have here would be greatly appreciated.
>>
>> Any CMS out there that might have a tool for this that would be quick to
>> install and get up and going? Codeigniter have one, any others???
>>
>> Much thanks,
>>
>> Skip
>
> My first thought was CakePHP. Setup your database and run the cake bake
> script and you will get all the forms, create, retrieve, update and
> delete, as well as the PHP models and controllers to do it. Then you
> just start customizing.
You can do the same thing with Radicore (http://www.radicore.org) - build
your database, import it into the data dictionary, export it to create the
basic List/Search/Create/Read/Update/Delete transactions. All withut writing
a single line of HTML, SQL or even PHP. You can customise these scripts to
your heart's content
As an added bonus you get a Role Based Access Control (RBAC) system, Audit
Logging, Workflow, Single or Two Factor Authentication for user logons, PDF
forms generation, and a whole host of other goodies.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
> --
> Thanks!
> -Shawn
> http://www.spidean.com
--- End Message ---
--- Begin Message ---
Hello,
on 06/08/2009 07:04 PM Skip Evans said the following:
> We've been approached by a central office of a relatively large
> religious denomination that collects data from their member churches in
> the form of an 11 page questionnaire with a diverse set of questions
> ranging from multiple choice, essay type, to financial statements.
>
> It's currently all hand filled out and then hand typed in to a MS Access
> database (shudder...).
>
> They want to webify it so I'm wondering if anyone has any
> recommendations on PHP based form generation tools that would speed up
> the process of form creation and perhaps even the inserts into MySQL.
>
> So far I'm looking at phpFormGenerator here
>
> http://phpformgen.sourceforge.net/
>
> But it says "beta" which gives me some small pause, and I'm actively
> browsing for others.
>
> Any experience or advice others have here would be greatly appreciated.
>
> Any CMS out there that might have a tool for this that would be quick to
> install and get up and going? Codeigniter have one, any others???
I think that depends on how much custom programming or self tutoring you
want to do. Basically, there are no free lunches.
Usually generators produce code that you end up having to customize it
by editing the generated code by hand. Good generated code is one that
you do not need to edit to customize later.
Alternative there are frameworks and class libraries that do the bulk
code work but you need to construct your application around them. So,
you need to spend sometime reading their documentation to learn how to
make them do what you need.
I use this forms generation and validation library.
http://www.phpclasses.org/formsgeneration
Here are live examples with several types of forms:
http://www.meta-language.net/forms-examples.html
For data entry, this example may be more like what you need:
http://www.meta-language.net/forms-examples.html?example=test_scaffolding_input
This is just for form handling, so it is independent of whatever type of
database you need to integrate
--
Regards,
Manuel Lemos
Find and post PHP jobs
http://www.phpclasses.org/jobs/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
> Not as smooth as Xcode and Interface Builder eh?
I had interesting results with my first custom MyApp.app bundle.
>From
>http://developer.apple.com/documentation/CoreFOundation/Conceptual/CFBundles/Concepts/BundleAnatomy.html#//apple_ref/doc/uid/20001119-104977-TPXREF4
I made a new folder named "Test" and made a sub directory "Contents"
then another sub to that "MacOS" then put a PHP script with no
extension named "test" containing code from
http://gtk.php.net/manual/en/tutorials.helloworld.php to which I added
the top line #!/opt/local/bin/php -q
like so:
#!/opt/local/bin/php -q
<?php
if (!class_exists('gtk')) {
die("Please load the php-gtk2 module in your php.ini\r\n");
}
$wnd = new GtkWindow();
$wnd->set_title('Hello world');
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
$lblHello = new GtkLabel("Just wanted to say\r\n'Hello world!'");
$wnd->add($lblHello);
$wnd->show_all();
Gtk::main();
?>
Rename Test folder to Test.app
It should take on the default App icon.
Don't click on it until you read the WARNING below so you can show
Desktop (should not matter here yet though). If you try it now, it
may tell you that you need gtk installed "Please load the php-gtk2
module in your php.ini".
>From MacPorts I did:
sudo port install php5-gtk
I was surprised that it installed apache, but I didn't do any post
install apache step (I'll just wipe /opt/local anyway). I did however
do
sudo cp /opt/local/etc/php.ini-dist /opt/local/etc/php.ini
in response to this line during the port build
* copy /opt/local/etc/php.ini-dist to /opt/local/etc/php.ini
I then did a
sudo vi /opt/local/etc/php.ini
Changed
;extension_dir = "./"
extension_dir = "/opt/local//lib/php/extensions/no-debug-non-zts-20060613/"
and added
extension=php_gtk2.so
at the end, although it should probably be in the extension area.
WARNING:
I have my Expose set to show the desktop if I move my mouse to a
corner. (Active Screen Corners)
Without that, I would have been stuck after a launch.
I launched Test but it kicked in X11, then showed the Hello World GTK
window. I closed the window and was left with a blank X11 screen
(WITH NO DOCK !!!). Now I recovered by moving my mouse to the active
screen corner to show the Desktop (WHICH HAD MY HARDDRIVE icon there.
When I opened my Hard Drive icon Macintosh HD, the X11 app icon
appeared along with the Dock.) Then I Quit X11 from the Dock and was
back to normal.
Anyway, you can do any post install stuff if you really want to setup
properly or do port uninstall and friends, but there is also this:
http://guide.macports.org/#installing.macports.uninstalling
But after the WWDC today, I see it's high time to get into iPhone development.
--- End Message ---
--- Begin Message ---
On Monday 08 June 2009 12:34:40 pm Robert Cummings wrote:
> Matty Sarro wrote:
> > Real men use perl ;)
>
> When I was younger my dad told me real men drink their coffee black... I
> tried it for a month and then I told him real men choose their own path
> in life.
>
> Cheers,
> Rob.
Mind if I use that quote elsewhere (credited if you prefer)?
--
Larry Garfield
[email protected]
--- End Message ---
--- Begin Message ---
On 6/8/09 4:26 PM, "Dee Ayy" <[email protected]> wrote:
> Not as smooth as Xcode and Interface Builder eh?
no
--- End Message ---
--- Begin Message ---
Larry Garfield wrote:
On Monday 08 June 2009 12:34:40 pm Robert Cummings wrote:
Matty Sarro wrote:
Real men use perl ;)
When I was younger my dad told me real men drink their coffee black... I
tried it for a month and then I told him real men choose their own path
in life.
Cheers,
Rob.
Mind if I use that quote elsewhere (credited if you prefer)?
Go ahead... I don't need credit for it unless you want to add it :)
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
On Mon, Jun 08, 2009 at 09:30:18AM -0700, Kyle Terry wrote:
<snip>
> I don't mean to be the thread spirit killer, but I think another language
> would be better for this. Such as Python.
>
> PHP desktop apps might be fun to hack around with, but I wouldn't use it for
> a production application.
I've coded a bit in Python, and parts of it really annoy me. I much
prefer PHP, as it's more C-ish.
Why wouldn't you use PHP for production applications?
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
Hello,
on 06/08/2009 12:48 PM tedd said the following:
> Hi gang:
>
> I've heard that php can be used for more than web programming, but I am
> not aware of specifically how that can be done. So, let me ask directly
> -- can php be used to create a Mac Application?
>
> If so, how?
Sure, just yesterday it was released a class for controlling iTunes from
PHP.
http://www.phpclasses.org/itunes
Another PHP package was just released for displaying Web galleries
optimized for the iPhone. This is still a Web based application though.
http://www.phpclasses.org/pipho
For GUI based applications, there is PHP-Gtk for Mac like others have
mentioned.
--
Regards,
Manuel Lemos
Find and post PHP jobs
http://www.phpclasses.org/jobs/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
Hey all-
Something strange is happening with a python script I am executing
from a php page:
I am executing this by doing $output = `python blahblah.py arg1 arg2
arg3`
Say my Python code looks like this:
import sys
import os
thisPID = os.getpid()
print thisPID
print "1"
RADeg = float(sys.argv[1])
decDeg = float(sys.argv[2])
clipSizeDeg = float(sys.argv[3])
print "2"
ic.myFunction(RAdeg, decDeg, clipSizeDeg)
print "3"
os.system(SOME LONG COMMAND)
print "4"
for i in os.listdir(blah):
print "5"
os.system("gunzip BLAH")[/code]
print "6"
$output collects these numbers from the print statements, all the way
through #6, but it doesn't execute the rest of the code - the stuff
that I actually want it to do...any ideas?
Thanks!
--- End Message ---
--- Begin Message ---
Adrian Price-Whelan wrote:
Hey all-
Something strange is happening with a python script I am executing from
a php page:
I am executing this by doing $output = `python blahblah.py arg1 arg2 arg3`
Say my Python code looks like this:
import sys
import os
thisPID = os.getpid()
print thisPID
print "1"
RADeg = float(sys.argv[1])
decDeg = float(sys.argv[2])
clipSizeDeg = float(sys.argv[3])
print "2"
ic.myFunction(RAdeg, decDeg, clipSizeDeg)
print "3"
os.system(SOME LONG COMMAND)
print "4"
for i in os.listdir(blah):
print "5"
os.system("gunzip BLAH")[/code]
print "6"
$output collects these numbers from the print statements, all the way
through #6, but it doesn't execute the rest of the code - the stuff that
I actually want it to do...any ideas?
Your question belongs on a python list.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---