php-general Digest 23 Sep 2003 07:13:39 -0000 Issue 2313
Topics (messages 163514 through 163550):
Re: PHP Editor - which to use?
163514 by: jsWalter
163525 by: Jason Sheets
163526 by: Chris W. Parker
163535 by: Ray Hunter
163537 by: NukedWeb.aol.com
163540 by: Robert Cummings
163541 by: Dan Anderson
163542 by: NukedWeb.aol.com
POST Parameters
163515 by: Stephan Becker
163516 by: Brent Baisley
163517 by: Chris Shiflett
Re: Problem's addign a script to my web page.
163518 by: Marek Kilimajer
163531 by: Stratis Aftousmis
Shopping Cart Solutions
163519 by: Charles Kline
163521 by: Ray Hunter
163522 by: Adrian Teasdale
163523 by: Henrik Hudson
163524 by: Chris W. Parker
bugs.php.net
163520 by: Amith Varghese
speaking of php editors
163527 by: Chris W. Parker
163529 by: Curt Zirzow
163534 by: Ray Hunter
Re: Subcategories in php
163528 by: Chris W. Parker
PHP5 interfaces?
163530 by: Javier Muniz
Auto load data
163532 by: ascll
Calling PHP shell scripts with exec from within PHP goes awry?
163533 by: uvm
163536 by: Ray Hunter
163538 by: Robert Cummings
Re: Calling PHP shell scripts with exec from within PHP goes
163539 by: uvm
passing parameters to a script doesn't work
163543 by: Sol
163544 by: John Nichel
Formatting a string for entry into MySQL
163545 by: James Johnson
javascript open window and a PHP script...
163546 by: jsWalter
CAN I CASH the output of PHP SCRIPT?
163547 by: Nabil
163548 by: Curt Zirzow
163549 by: Becoming Digital
TAR Error - 'Invalid block size'
163550 by: Tohar Trabinovitch
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 use Homesite.
It has plug-ins for PHP so you have tps and cose completion.
I just modified another plug it has so I can see then entire list of methods
a script has in a window, which can then jump to, scroll to, insert here.
And I can hit F-12 and it will talk to my apache server and run the script
right there!
All in one!
Thee is CVS integration for Homesite, I just never got around to it.
I just use WinCVS, I'm just lazy.
Walter
--- End Message ---
--- Begin Message ---
PHP eclipse is also nice, you need eclipse from http://www.eclipse.org
and then you install the PHP Eclipse module
http://phpeclipse.sourceforge.net. Very easy to install, I am a big fan
of Komodo, I also like Vim, Kate and Eclipse. I tried Zend Studio 1 and
2 but it didn't live up to the expectations that I had for the price.
Becoming Digital wrote:
I'm a big fan of ActiveState Komodo, largely because it handles PHP, Perl, Python, and others. While most of my work is done in PHP, it's nice not having to switch editors when trying to port code to or from another language.
I must agree with Ryan that there is no 1 app to use. Dreamweaver MX is a staple in anyone's software library, especially for visual development, and Zend Studio is another great app. However, what I like about either, you may not so you'll really just have to try out the numerous demos and find what works for you.
Edward Dudlik
Becoming Digital
www.becomingdigital.com
wishes | www.amazon.com/o/registry/EGDXEBBWTYUU
----- Original Message -----
From: "Ryan A" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, 22 September, 2003 05:07
Subject: Re: [PHP] PHP Editor - which to use?
Hey
Personally I dont think any 1 is good for all purposes...I use a combination
of Dreamweaver MX, Zend and PHPEdit.
HTH.
Cheers,
-Ryan
We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com
----- Original Message -----
From: "Ruessel, Jan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 22, 2003 11:00 AM
Subject: RE: [PHP] PHP Editor - which to use?
well, i like to use dreamweaver mx or textpad with the syntax highlighting
file you additionally have to download. i dunno if there are special
"php-must-have-editors".
grtz
jan
-----Original Message-----
From: Binay [mailto:[EMAIL PROTECTED]
Sent: Montag, 22. September 2003 10:58
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Editor - which to use?
Hi everybody!
Please suggest me a good PHP editor like ( Microsoft's Interdev for ASP) to
write my php programs/scripts and get a visual feel.
Thanks
Binay
--- End Message ---
--- Begin Message ---
Binay <mailto:[EMAIL PROTECTED]>
on Monday, September 22, 2003 1:58 AM said:
> Please suggest me a good PHP editor like ( Microsoft's Interdev for
> ASP) to write my php programs/scripts and get a visual feel.
Doesn't fit in the "visual feel" category but I really like HTML-Kit
available at www.chami.com.
Chris.
--- End Message ---
--- Begin Message ---
> PHP eclipse is also nice, you need eclipse from http://www.eclipse.org
> and then you install the PHP Eclipse module
> http://phpeclipse.sourceforge.net. Very easy to install, I am a big fan
> of Komodo, I also like Vim, Kate and Eclipse. I tried Zend Studio 1 and
> 2 but it didn't live up to the expectations that I had for the price.
Eclipse offers tons of additional plugins and if you like java you can
surely write your own php plugins too.
There are many great db plugins that i use too.
--
BigDog
--- End Message ---
--- Begin Message ---
Best PHP Editor on the market: called "Notepad". Written by a tiny little
software dev company called Microsoft. Very nicely written, compared to the rest
of their software.
--- End Message ---
--- Begin Message ---
On Mon, 2003-09-22 at 22:08, [EMAIL PROTECTED] wrote:
> Best PHP Editor on the market: called "Notepad". Written by a tiny little
> software dev company called Microsoft. Very nicely written, compared to the rest
> of their software.
Naaaah, a slightly larger company named Microsoft Inc. created an editor
called wordpad that doesn't bugger the document with \r, or is it, it
can read the document properly when \r doesn't exist? *shrug* I use joe
-- joe, yeah that's right, one more time JOE >:) It's got really cool
features, like no auto completion, no colour, no graphics. best of all
it runs in a terminal such as Eterm or aterm which can be semi
transparent so I can see my cool background showing through. What more
could you ask for?
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
> Best PHP Editor on the market: called "Notepad". Written by a tiny little
> software dev company called Microsoft. Very nicely written, compared to the rest
> of their software.
You must either be insane, a genius, or joking. I couldn't imagine
writing code without context sensitive highlighting -- there are so many
bugs that would be overlooked. And not being able to use M-g to goto a
line number? (I use Emacs) I'd go bonkers.
Look at GNU Emacs. It's got a large learning curve, but once you learn
it it's worth it. E-mail me if you want how-to instructions on setting
it up.
-Dan
--- End Message ---
--- Begin Message ---
>You must either be insane, a genius, or joking.
Some of the most gifted people in the world are all three! Not that I'm
claiming to be one, but yes I'm all three. :-D
> I couldn't imagine writing code without context sensitive highlighting --
there are so many bugs that would be overlooked. - Huh? What's that? Context
hightlighting? Like built-in colorful magic markers? Ehh. Bugs can NEVER go
overlooked as long as PHP's parse-errors are always right there to rub it in that
we fudged up... ;) I swear...all PHP error msgs should end with "....you
loser!" :-D
> And not being able to use M-g to goto aline number? (I use Emacs) I'd go
bonkers.
Notepad as well. ctrl+G -- only found out about that a year into
PHP....dammit. coulda really used it when I was learning...beat the hell outta using
the
down arrow and counting in my head!
Hope ya don't think I'm tryin to poke fun Dan. I meant well ;) Quite frankly
I dont think I'd ever learn an "editor", I've used Notepad so long, it's like
an 85 year old man learning how to use a DVD player. ;)
--- End Message ---
--- Begin Message ---
Maybe my problem ist simple to solve, but I canīt.
Here it is:
A special PHP CGI Script, letīs say 'phpscript.cgi' might be called with GET
or POST Parameters.
Though I will never now which kind and how many of such parameters will be
passed to that script, I have to do some work of mine with them and after
that would like to call (redirect to) an other script passing exact the same
amount and type of pararmeters origninally given to my famous phpscript.cgi.
I just succeeded in handling the URL based stuff like Host, Scriptname GET
Paramters etc.
But how to handle the POST Data ?
Any guess out there ?
brgds
stephan
--- End Message ---
--- Begin Message ---
All POST value are stored in the $_POST[] array, all GET values are
stored in the $_GET[] array. Both POST and GET values are stored in the
$_REQUEST[] array. So if you don't know whether it will be a post or a
get, grab the data by accessing the $_REQUEST[] array.
On Monday, September 22, 2003, at 10:25 AM, Stephan Becker wrote:
Maybe my problem ist simple to solve, but I canīt.
Here it is:
A special PHP CGI Script, letīs say 'phpscript.cgi' might be called
with GET
or POST Parameters.
Though I will never now which kind and how many of such parameters
will be
passed to that script, I have to do some work of mine with them and
after
that would like to call (redirect to) an other script passing exact
the same
amount and type of pararmeters origninally given to my famous
phpscript.cgi.
I just succeeded in handling the URL based stuff like Host, Scriptname
GET
Paramters etc.
But how to handle the POST Data ?
Any guess out there ?
brgds
stephan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--- End Message ---
--- Begin Message ---
--- Stephan Becker <[EMAIL PROTECTED]> wrote:
> A special PHP CGI Script, letīs say 'phpscript.cgi' might be called
> with GET or POST Parameters. Though I will never now which kind and
> how many of such parameters will be passed to that script, I have to
> do some work of mine with them and after that would like to call
> (redirect to) an other script passing exact the same amount and type
> of pararmeters origninally given to my famous phpscript.cgi.
>
> I just succeeded in handling the URL based stuff like Host,
> Scriptname GET Paramters etc. But how to handle the POST Data?
Use the $_POST array. You can loop through it conveniently using something like
the following:
foreach ($_POST as $name => $value)
{
...
}
As for redirecting, you cannot force a client to send a POST request to another
URL (thankfully). So, you either need to send the POST request yourself (and
send the output to the client), or you need to think of another solution (such
as using URL variables for everything).
Hope that helps.
Chris
=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
Yes, it will get rid of the permission problems.
Example of creating a directory:
$fp=ftp_connect('localhost');
if(ftp_login($fp, $ftpuser, $ftppass)) {
if(ftp_mkdir($fp, $ftpbasedir .'members/'.$iid)) {
/*if(!ftp_site($fp, 'chmod 0777 '.$ftpbasedir .'members/'.$iid))
die('Could not change permission on user directory (chmod 0777
'.$ftpbasedir .'members/'.$iid.')!'); this would not work for you*/
} else {
die('Could not create directory, user directory not created!');
}
} else {
die('Could not login, user directory not created!');
}
I had to create directory with ftp so I could later open it using
opendir(). Because chmod does not work for you you will have to even
create files using ftp functions.
Stratis Aftousmis wrote:
--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
Optionaly you can use ftp functions to create files
and directories.
Will that get rid of the parmission's problem? Can you
explain a little?
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--- End Message ---
--- Begin Message ---
--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> Yes, it will get rid of the permission problems.
>
> Example of creating a directory:
>
> $fp=ftp_connect('localhost');
> if(ftp_login($fp, $ftpuser, $ftppass)) {
> if(ftp_mkdir($fp, $ftpbasedir .'members/'.$iid)) {
> /*if(!ftp_site($fp, 'chmod 0777 '.$ftpbasedir
> .'members/'.$iid))
> die('Could not change permission on user directory
> (chmod 0777
> '.$ftpbasedir .'members/'.$iid.')!'); this would not
> work for you*/
> } else {
> die('Could not create directory, user directory not
> created!');
> }
> } else {
> die('Could not login, user directory not created!');
> }
>
> I had to create directory with ftp so I could later
> open it using
> opendir(). Because chmod does not work for you you
> will have to even
> create files using ftp functions.
Awesome! I tilt my hat to you!
Thank's again.
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--- End Message ---
--- Begin Message ---
Anyone have suggestions for open source shopping cart apps in PHP?
Thanks,
Charles
--- End Message ---
--- Begin Message ---
> Anyone have suggestions for open source shopping cart apps in PHP?
Check out sourceforge.net...there are many there. Also try google and
you will get tons of info.
--
Ray
--- End Message ---
--- Begin Message ---
Charles
Try oscommerce.org - it's an open source app written in PHP that has a
fantastic community and is incredibly feature-rich. I'm not associated
with the project, but I have used it
Best regards
Ade
Sourceguardian.com
> -----Original Message-----
> From: Charles Kline [mailto:[EMAIL PROTECTED]
> Sent: 22 September 2003 21:10
> To: [EMAIL PROTECTED]
> Subject: [PHP] Shopping Cart Solutions
>
>
> Anyone have suggestions for open source shopping cart apps in PHP?
>
> Thanks,
> Charles
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
--- End Message ---
--- Begin Message ---
On Monday 22 September 2003 15:42, Adrian Teasdale wrote:
> Charles
>
> Try oscommerce.org - it's an open source app written in PHP that has a
> fantastic community and is incredibly feature-rich. I'm not associated
> with the project, but I have used it
My 2 cents. OSCommerce is great if you want to use it out of the box, but we
tried to extend it and alter some of it's functions and the code is very
obtuse and making changes in one spot can lead to problems in others. Also,
it tries to throw in the kitchen-sink worth of options and if you need
something slimmer or more easily configured you might be better off starting
from another codebase.
That being said..if you're looking for an OSS program which works well for
what it's meant to be..a full featured shopping cart solution..then look no
further.
Henrik
--
Henrik Hudson
[EMAIL PROTECTED]
"`If there's anything more important than my ego
around, I want it caught and shot now.'"
--Hitchhikers Guide to the Galaxy
--- End Message ---
--- Begin Message ---
Henrik Hudson <mailto:[EMAIL PROTECTED]>
on Monday, September 22, 2003 3:09 PM said:
> My 2 cents. OSCommerce is great if you want to use it out of the box,
> but we tried to extend it and alter some of it's functions and the
> code is very obtuse and making changes in one spot can lead to
> problems in others.
+1
I messed around with it for a few days just trying to add two fields to
the product table but it so difficult to find where all the mysql db
errors were being generated I just gave up and decided to write my own
cart from scratch. ;)
I should clarify a little. I gave up after only trying to add two fields
because the other features that I needed in a shopping cart were WAY
more complicated than the two fields and I reasoned that if it was that
difficult to add two fields it's going to be near impossible to add what
I wanted. So I decided my time would be better spent developing my own
cart (what learning experience it's been!!). I would be able to extend
my own cart much more quickly and efficiently than I could anyone elses
code.
> Also, it tries to throw in the kitchen-sink worth
> of options and if you need something slimmer or more easily
> configured you might be better off starting from another codebase.
+1
Chris.
--- End Message ---
--- Begin Message ---
Can anyone tell me where I can download the bug tracking system used for
bugs.php.net? I don't see any links on the PHP site (or i'm probably missing
something quite obvious)
Thanks
Amith
--- End Message ---
--- Begin Message ---
Hey everyone.
I am looking for an editor that will highlight the string
"{$array['index']['index']}" within a string.
For example:
+--------- gray ------------+
| |
| +-- red ---+ |
| | | |
$variable = "The amount is {$amount[0]}.";
Is there anything out there that does this?
Thanks,
Chris.
--- End Message ---
--- Begin Message ---
* Thus wrote Chris W. Parker ([EMAIL PROTECTED]):
> Hey everyone.
>
> I am looking for an editor that will highlight the string
> "{$array['index']['index']}" within a string.
>
> For example:
>
> +--------- gray ------------+
> | |
> | +-- red ---+ |
> | | | |
> $variable = "The amount is {$amount[0]}.";
^^^^ ^^^^^^ ^^ +*%%%%%%#^#+^^
| || | |||| |
Green <-------'-----------------------'---'
|| | | ||
Red +------------------------'----------'
| | | |
Dk. Red #----------------------------'-'
| |
Yellow *----------------------' |
|
Blue %---------------------------'
Thats vi's coloring :)
Vi can also hightlight html and sql statements inside the string.
I'm not going to map that one out... lol
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
Check out vim or emacs...
--
BigDog
On Mon, 2003-09-22 at 17:41, Chris W. Parker wrote:
> Hey everyone.
>
> I am looking for an editor that will highlight the string
> "{$array['index']['index']}" within a string.
>
> For example:
>
> +--------- gray ------------+
> | |
> | +-- red ---+ |
> | | | |
> $variable = "The amount is {$amount[0]}.";
>
>
> Is there anything out there that does this?
>
>
>
> Thanks,
> Chris.
--- End Message ---
--- Begin Message ---
phpu <mailto:[EMAIL PROTECTED]>
on Saturday, September 20, 2003 7:41 AM said:
> I have been trying to do this for weeks but i just cant figure this
> out. I have categories that have subcategories and i want to insert
> them into database.
If you need more than two levels of classification I would suggest you
use a method called Modified Preorder Tree Traversal. You can read about
it here. http://www.sitepoint.com/article/1105
It's a little complicated at first but once you grasp the idea it starts
to make a lot of sense.
Hope this helps.
Chris.
--- End Message ---
--- Begin Message ---
Wondering if maybe someone famililar with php5 can respond to this. I am
reading about PHP5 and it's interface support, and i have a concern. The
purpose of interfaces is to handle multiple inheritance in a fashion that
resolves a number of conflicts that arise when performing true multiple
inheritance, the most obvious conflict being two identical members being
inherited from different classes.
What appears to be missing, and correct me if I'm wrong, is the ability to
address this issue in PHP5. A (rather poor) Example:
interface BoardMember
{
function position(); // used to set board position of board member
}
interface Employee
{
function position(); // used to set job title of employee
}
class BusyBoardMember implements Employee, BoardMember
{
function position(); // what does this function do? ambiguous unless I
am missing something
}
In Visual Basic, for instance, this is handled using the "implements"
keyword, so the function definitions within BusyBoardMember would look like:
function position() implements Employee.position()
function position() implements BoardMember.position()
Then when you do something like
function operatesOnEmployee(Employee $e)
{
$e->position("CEO")
}
or
function operatesOnBoardMember(BoardMember $b) {
$b->position("Chairman")
}
The right thing can happen, as the compiler/parser knows which position()
you're referring to in each case.
Hopefully this is the right list to be posting this, and hopefully I'm
completely wrong and have missed something while reading about PHP5 :)
-Javier
--- End Message ---
--- Begin Message ---
Greetings,
I'm designing a table with 21 columns and 3 rows (1-row column header, 2-row
data) store in .php file, and each cell of this table storing a value, that
I stored it using MySQL database. Now, I want all the values (just the
values, but NOT the table) shown on this page automatic update every
1-second.
So, I use "create_table.php" to create the table and automatic load
"get_data.php" every 1-second to retrieve data from database. Once the
"get_data.php" loaded, my IE only show those data and the table disappeared.
Please help. Thanks in advance.
========== start create_table.php ============
<html>
<head>
<title>Member Area</title>
<META HTTP-EQUIV=Refresh CONTENT="5; URL=get_data.php">
</head>
<body>
<center>
<table bgcolor="#EEEEEE" border="0" width="95%"><tr><td>
<table bgcolor="#B6C7E5" border="0" width="100%"><tr><td>
<table bgcolor="#FFFFFF" border="0" width="100%"><tr><td>
<table border=0 bgcolor="#F7F7FF" width="100%">
<tr><th colspan=21><font size=+1>RACING RESULT</font></td></tr>
<tr bgcolor="#FFFFFF"><th colspan=21></tr>
<tr>
<td width="20%">1st row</td><td width="4%">1</td><td
width="4%">2</td><td width="4%">3</td><td width="4%">4</td>
<td width="4%">5</td><td width="4%">6</td><td width="4%">7</td><td
width="4%">8</td><td width="4%">9</td>
<td width="4%">10</td><td width="4%">11</td><td
width="4%">12</td><td width="4%">13</td><td width="4%">14</td>
<td width="4%">15</td><td width="4%">16</td><td
width="4%">17</td><td width="4%">18</td><td width="4%">19</td><td
width="4%">20</td>
</tr>
<tr>
<td width="20%">2nd row</td><td width="4%">' . $myWin1 . '</td><td
width="4%">' . $myWin2 . '</td><td width="4%">' . $myWin3 . '</td>
<td width="4%">' . $myWin4 . '</td><td width="4%">' . $myWin5 .
'</td><td width="4%">' . $myWin6 . '</td><td width="4%">' . $myWin7 . '</td>
<td width="4%">' . $myWin8 . '</td><td width="4%">' . $myWin9 .
'</td><td width="4%">' . $myWin10 . '</td><td width="4%">' . $myWin11 .
'</td>
<td width="4%">' . $myWin12 . '</td><td width="4%">' . $myWin13 .
'</td><td width="4%">' . $myWin14 . '</td><td width="4%">' . $myWin15 .
'</td>
<td width="4%">' . $myWin16 . '</td><td width="4%">' . $myWin17 .
'</td><td width="4%">' . $myWin18 . '</td><td width="4%">' . $myWin19 .
'</td>
<td width="4%">' . $myWin20 . '</td>
</tr>
<tr>
<td width="20%">3rd row</td><td width="4%">' . $myPlace1 .
'</td><td width="4%">' . $myPlace2 . '</td><td width="4%">' . $myPlace3 .
'</td>
<td width="4%">' . $myPlace4 . '</td><td width="4%">' . $myPlace5
. '</td><td width="4%">' . $myPlace6 . '</td><td width="4%">' . $myPlace7 .
'</td>
<td width="4%">' . $myPlace8 . '</td><td width="4%">' . $myPlace9
. '</td><td width="4%">' . $myPlace10 . '</td><td width="4%">' . $myPlace11
. '</td>
<td width="4%">' . $myPlace12 . '</td><td width="4%">' .
$myPlace13 . '</td><td width="4%">' . $myPlace14 . '</td><td width="4%">' .
$myPlace15 . '</td>
<td width="4%">' . $myPlace16 . '</td><td width="4%">' .
$myPlace17 . '</td><td width="4%">' . $myPlace18 . '</td><td width="4%">' .
$myPlace19 . '</td>
<td width="4%">' . $myPlace20 . '</td>
</tr>
</table>
</td></tr></table>
</td></tr></table>
</td></tr></table>
</center>
</body>
</html>
========== end create_table.php ============
========== start get_data.php ============
<?php
$result = @mysql_query('SELECT `myWin1`, `myWin2`, `myWin3`, `myWin4`,
`myWin5`, `myWin6`, `myWin7`, `myWin8`, `myWin9`, `myWin10`, `myWin11`,
`myWin12`, `myWin13`, `myWin14`, `myWin15`, `myWin16`, `myWin17`, `myWin18`,
`myWin19`, `myWin20`, `myPlace1`, `myPlace2`, `myPlace3`, `myPlace4`,
`myPlace5`, `myPlace6`, `myPlace7`, `myPlace8`, `myPlace9`, `myPlace10`,
`myPlace11`, `myPlace12`, `myPlace13`, `myPlace14`, `myPlace15`,
`myPlace16`, `myPlace17`, `myPlace18`, `myPlace19`, `myPlace20` FROM
Testing');
if (!$result) {
die('<p>Error performing query: ' . mysql_error() . '</p>');
}
while ( $row = mysql_fetch_array($result) )
{
$myWin1 = $row['0'];
$myWin2 = $row['1'];
$myWin3 = $row['2'];
$myWin4 = $row['3'];
$myWin5 = $row['4'];
$myWin6 = $row['5'];
$myWin7 = $row['6'];
$myWin8 = $row['7'];
$myWin9 = $row['8'];
$myWin10 = $row['9'];
$myWin11 = $row['10'];
$myWin12 = $row['11'];
$myWin13 = $row['12'];
$myWin14 = $row['13'];
$myWin15 = $row['14'];
$myWin16 = $row['15'];
$myWin17 = $row['16'];
$myWin18 = $row['17'];
$myWin19 = $row['18'];
$myWin20 = $row['19'];
$myPlace1 = $row['20'];
$myPlace2 = $row['21'];
$myPlace3 = $row['22'];
$myPlace4 = $row['23'];
$myPlace5 = $row['24'];
$myPlace6 = $row['25'];
$myPlace7 = $row['26'];
$myPlace8 = $row['27'];
$myPlace9 = $row['28'];
$myPlace10 = $row['29'];
$myPlace11 = $row['30'];
$myPlace12 = $row['31'];
$myPlace13 = $row['32'];
$myPlace14 = $row['33'];
$myPlace15 = $row['34'];
$myPlace16 = $row['35'];
$myPlace17 = $row['36'];
$myPlace18 = $row['37'];
$myPlace19 = $row['38'];
$myPlace20 = $row['39'];
echo('<tr><td width="20%">2nd row</td><td width="4%">' . $myWin1 . '</td><td
width="4%">' . $myWin2 . '</td><td width="4%">' . $myWin3 . '</td>
<td width="4%">' . $myWin4 . '</td><td width="4%">' . $myWin5 . '</td><td
width="4%">' . $myWin6 . '</td><td width="4%">' . $myWin7 . '</td>
<td width="4%">' . $myWin8 . '</td><td width="4%">' . $myWin9 . '</td><td
width="4%">' . $myWin10 . '</td><td width="4%">' . $myWin11 . '</td>
<td width="4%">' . $myWin12 . '</td><td width="4%">' . $myWin13 . '</td><td
width="4%">' . $myWin14 . '</td><td width="4%">' . $myWin15 . '</td>
<td width="4%">' . $myWin16 . '</td><td width="4%">' . $myWin17 . '</td><td
width="4%">' . $myWin18 . '</td><td width="4%">' . $myWin19 . '</td>
<td width="4%">' . $myWin20 . '</td></tr>');
echo('<tr><td width="20%">3rd row</td><td width="4%">' . $myPlace1 .
'</td><td width="4%">' . $myPlace2 . '</td><td width="4%">' . $myPlace3 .
'</td>
<td width="4%">' . $myPlace4 . '</td><td width="4%">' . $myPlace5 .
'</td><td width="4%">' . $myPlace6 . '</td><td width="4%">' . $myPlace7 .
'</td>
<td width="4%">' . $myPlace8 . '</td><td width="4%">' . $myPlace9 .
'</td><td width="4%">' . $myPlace10 . '</td><td width="4%">' . $myPlace11 .
'</td>
<td width="4%">' . $myPlace12 . '</td><td width="4%">' . $myPlace13 .
'</td><td width="4%">' . $myPlace14 . '</td><td width="4%">' . $myPlace15 .
'</td>
<td width="4%">' . $myPlace16 . '</td><td width="4%">' . $myPlace17 .
'</td><td width="4%">' . $myPlace18 . '</td><td width="4%">' . $myPlace19 .
'</td>
<td width="4%">' . $myPlace20 . '</td></tr>');
}
?>
========== end get_data.php ============
--- End Message ---
--- Begin Message ---
I'm beggining to develop the theory that things go awry when
using exec from within a webserver-executed PHP script to call
a shell script itself written in PHP.
The example that I'm really trying to do might be too complicated for
presentation here, but here's a simplified version.
Take the shell script "helloWorld.php":
#!/usr/local/bin/php -q
<?PHP print "\nHello World!"; ?>
Now take a calling wrapper:
<?PHP
$execStr = "/usr/home/jakus1/www/htdocs/form2mail/helloWorld.php";
echo "\n<br>Calling: ($execStr)";
$output = exec($execStr);
echo "\n<br>Called: ($execStr)";
echo "\n<br>output: ($output)";
?>
Note that there are no loops or recursing in those scripts. I bring that
up because of the bizzare results I'm getting. Brace yourselves:
Calling: (/usr/home/jakus1/www/htdocs/form2mail/helloWorld.php)
Called: (/usr/home/jakus1/www/htdocs/form2mail/helloWorld.php)
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: (
output: ()))))))))))))))))))))))
(See http://fsboutah.net/form2mail/testphpcall.php )
So... not only am I not getting the expected result back in $output,
something really weird is going on.
If, however, I change the $execStr assigning line in the calling script to:
$execStr = "ls -l";
I get what I expect:
Calling: (ls -l)
Called: (ls -l)
output: (-rw-r--r-- 1 jakus1 vuser 193 Sep 23 01:27 testgrcall.php)
(See http://fsboutah.net/form2mail/testlscall.php )
I wondered if it might just be a problem with calling bang-begun scripts, so
I tried a helloWorld.sh:
#!/bin/sh
echo Hello World
(See http://fsboutah.net/form2mail/testshcall.php )
And got:
Calling: (/usr/home/jakus1/www/htdocs/form2mail/helloWorld.sh)
Called: (/usr/home/jakus1/www/htdocs/form2mail/helloWorld.sh)
output: (Hello World)
(See http://fsboutah.net/form2mail/testshcall.php )
Similar results for perl (see http://fsboutah.net/form2mail/testplcall.php ).
Anyone have an idea of the black magic that forbids trying to do this with php?
Thanks,
Weston
--- End Message ---
--- Begin Message ---
On Mon, 2003-09-22 at 19:50, uvm wrote:
> I'm beggining to develop the theory that things go awry when
> using exec from within a webserver-executed PHP script to call
> a shell script itself written in PHP.
>
Why are you trying to call a php script with exec...since it is php why
not just call it directly instead of creating a process outside of the
php you are in and then creating a php cgi to do the processing. It is
easier to call parse the file with the php process that you are
currently in.
--
bigdog
--- End Message ---
--- Begin Message ---
On Sun, 2003-09-21 at 22:00, Ray Hunter wrote:
> On Mon, 2003-09-22 at 19:50, uvm wrote:
> > I'm beggining to develop the theory that things go awry when
> > using exec from within a webserver-executed PHP script to call
> > a shell script itself written in PHP.
> >
>
> Why are you trying to call a php script with exec...since it is php why
> not just call it directly instead of creating a process outside of the
> php you are in and then creating a php cgi to do the processing. It is
> easier to call parse the file with the php process that you are
> currently in.
One damn good reason would be namespace conflict.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
> On Mon, 2003-09-22 at 19:50, uvm wrote:
> > I'm beggining to develop the theory that things go awry when
> > using exec from within a webserver-executed PHP script to call
> > a shell script itself written in PHP.
>
> Why are you trying to call a php script with exec...since it is php why
> not just call it directly instead of creating a process outside of the
> php you are in and then creating a php cgi to do the processing. It is
> easier to call parse the file with the php process that you are
> currently in.
While what you're saying is true, the point of what I'm trying to do is let
a PHP script I'm writing call another arbitrary script to retrieve some
data that's beyond the scope of what it should be made to do. Abstraction,
essentially.
I could use include() to accomplish this; however, I don't want to limit
someone else who might be using this extension mechanism to writing only
PHP scripts if at all possible. Using include() also introduces namespace
collision problems, which again, I'd like anyone using this mechanism
(including myself) to not have to worry about.
In short, I think there's a payoff by designing this way, allowing someone
to call an arbitrary external script (PHP or no) to perform a certain
function. I might be wrong. :)
The other thing -- I'm just curious as to why this apparently breaks PHP.
Thanks,
Weston
--- End Message ---
--- Begin Message ---
Hi,
I'm trying to pass parameters to a PHP script and it's not working.
Whilst this is the first time I've tried to use this, I'm basically
copying an example straight out of a text book and can't understand why
this doesn't work.
In one script I have a (static) link:
http://localhost/text/basic.php?html=basic
ATM basic.php looks like this:
<?php
echo("<html>\n<body>\n<p>html: $html</p>\n</body>\n</html>\n");
?>
Pretty simple? Well it doesn't work. All I get in my browser is:
html:
The only thing I can think of is that I have "register_globals" switched
off in php.ini, but I didn't think that this applied when it came to
passing parameters in URLs.
Can anyone help?
thankyou; sol
--
==============================
Sol Hanna
solATautonomonDOTnet
--- End Message ---
--- Begin Message ---
Sol wrote:
Hi,
I'm trying to pass parameters to a PHP script and it's not working.
Whilst this is the first time I've tried to use this, I'm basically
copying an example straight out of a text book and can't understand why
this doesn't work.
In one script I have a (static) link:
http://localhost/text/basic.php?html=basic
ATM basic.php looks like this:
<?php
echo("<html>\n<body>\n<p>html: $html</p>\n</body>\n</html>\n");
?>
Pretty simple? Well it doesn't work. All I get in my browser is:
html:
The only thing I can think of is that I have "register_globals" switched
off in php.ini, but I didn't think that this applied when it came to
passing parameters in URLs.
Yes, it does apply. Change $html to $_GET['html'] since you are passing
this in the URL. If you were passing via a form post method, you would
use $_POST['html'], and you can use $_REQUEST['html'] for either. Look
here...
http://www.php.net/manual/en/language.variables.external.php
--- End Message ---
--- Begin Message ---
Hi,
I'm trying to generate a string that contains a <br>, to insert into a MySQL
table. It appears the <br> is being stripped out either just before or
during the update.
** code **
// has both info, update both
$ad_contact = $tr_email;
$ad_contact .= "<br>";
$pSep = "-";
$ad_contact .= $tr_p1AC;
$ad_contact .= $pSep;
$ad_contact .= $tr_p1PRE;
$ad_contact .= $pSep;
$ad_contact .= $tr_p1SUF;
// update the record
$qUpdate = "UPDATE subscriber_ads SET ad_contact = '$ad_contact' WHERE subid
= $sid"; print("$qUpdate<br>"); $rUpdate = mysql_query($qUpdate, $CCB) or
die(mysql_error());
The print() statement shows the correct format in the browser. I've looked
at printf() and sprintf(), but can't quite figure the syntax.
I want the <br> in the string so it will output correctly in the browser
when that data is retrieved from the DB.
Suggestions?
Thanks,
James
--- End Message ---
--- Begin Message ---
I have a link on a page...
<a href="./admin/?listType=event_list&action=item_add" target=_blank>
Add or Update Your Event
</a>
This open the PHP file just fine and passes the vars fine.
But I need a new window to open via JavaScript. Why? Because I have a
"RETURN" link on the opening page that closes the child page, and if this
new window is not opened via JavaScript I get the "Close Window OK?" dialog.
The only way to not get that annoying dialog is to have that child window
opened via JavaScript.
So I did this...
<a
href="javascript:window.open('./admin/?listType=event_list&action=item_add',
'', '');">
Add or Update Your Event
</a>
A child window opens, I get 1 error dialog and a Download dialog, and then
the page opens fine.
error:
IE cannot download calendar.php from window.open('...
IE was not able to open this Internet site. The requested site is
either
unavailable or cannot be found. Please try again.
I hit OK and both the error dialog and the download page goes away.
But the desired page is displayed in the child window!
And the "RETURN" link closes the window without complaint!
So, I've solved one issue to raise another.
Anyone have any idea on this?
Thanks
Walter
--- End Message ---
--- Begin Message ---
Hi all;
I would like to cash all the output of PHP files on my apache .. to increase
the performance. To prevent PHP to work all the time to interpret and
connect to myself which is slow the performance and use the CPU .. as I have
very heavy loaded server.. I thought there might be a way to store all the
HTML output from my PHP pages, that will apache serve instead of calling
the PHP file every.. and should be a way to time the update ...
Any idea ??
Nabil
--- End Message ---
--- Begin Message ---
* Thus wrote Nabil ([EMAIL PROTECTED]):
> Hi all;
>
> I would like to cash all the output of PHP files on my apache .. to increase
> the performance. To prevent PHP to work all the time to interpret and
> connect to myself which is slow the performance and use the CPU .. as I have
> very heavy loaded server.. I thought there might be a way to store all the
> HTML output from my PHP pages, that will apache serve instead of calling
> the PHP file every.. and should be a way to time the update ...
>
> Any idea ??
I just installed mmcache, real simple to do too.
http://www.turcksoft.com/en/e_mmc.htm
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
The correct spelling is "cache." I'm not trying to be a spelling and grammar freak
(though I am), simply aiding your future searches on the topic.
PEAR has a very nice output caching class. I haven't used it myself, but I've heard
good things. I believe it was discussed recently on this very list, though it may
have been in PHP Architect. I read too many things to keep track! :)
Edward Dudlik
Becoming Digital
www.becomingdigital.com
----- Original Message -----
From: "Nabil" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, 23 September, 2003 11:11
Subject: [PHP] CAN I CASH the output of PHP SCRIPT?
Hi all;
I would like to cash all the output of PHP files on my apache .. to increase
the performance. To prevent PHP to work all the time to interpret and
connect to myself which is slow the performance and use the CPU .. as I have
very heavy loaded server.. I thought there might be a way to store all the
HTML output from my PHP pages, that will apache serve instead of calling
the PHP file every.. and should be a way to time the update ...
Any idea ??
Nabil
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I use the TAR.php file for extract tar.gz file. The tar file extracted
fine, but the tar class raises the 'Invalid block size 351'. Why? And
how can I discard this error.
Thanks,
===================
Tohar Trabinovitch
Software Engineer
[EMAIL PROTECTED]
Tel: 972-3-9008200
Ext: 269
--- End Message ---