php-windows Digest 10 May 2001 04:58:55 -0000 Issue 589

Topics (messages 7401 through 7432):

Restricting users to a specific directory
        7401 by: Dan English

symlinks
        7402 by: Jourden Parks
        7426 by: Joe Brown

Problem with submit
        7403 by: Jerry Nelson
        7406 by: Schulz, Evan

Re: Need someone with some experience
        7404 by: Bob Hall
        7427 by: Joe Brown

Please Help / mail( ) under windows
        7405 by: M. Weller

ISAPI
        7407 by: Tim Uckun
        7408 by: Flint Doungchak
        7409 by: Tim Uckun
        7413 by: Phil Driscoll
        7416 by: Chris Adams
        7424 by: Joe Brown

Persistent DB Connections with CGI - Via Java...
        7410 by: Dickerson, Monty
        7412 by: Tim Uckun
        7414 by: Dickerson, Monty
        7415 by: Tim Uckun
        7421 by: Ignatius Teo
        7422 by: Joe Brown

PHP IIS 4 and network drive
        7411 by: Jerome

need some help with apahce-php-mysql under windows
        7417 by: Xytras

Re: anti-advocacy: Larry Seltzer, pcmag May'01 pub.
        7418 by: Greg Brunet
        7419 by: Tim Uckun
        7432 by: Greg Brunet

Question
        7420 by: Chris Cranford

HTML/PHP/Javascript
        7423 by: Bob Sears
        7428 by: Ignatius Teo
        7430 by: Mike Flynn

PHP Preprocessor - URGENT
        7425 by: Chris Cranford
        7429 by: Ignatius Teo
        7431 by: Ruslan Ohitin

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]


----------------------------------------------------------------------


We are an ISP planning to support PHP on Windows 2000 & IIS5.0.

We am trying to limit file access to each virtual site only, but users can
use scripts like PHP-Nuke file manager to list all the files/folders on the
computer.

What is the best way to prevent this?

Thanks,
Dan English
[EMAIL PROTECTED]








  I have to port alot of php code from linux to windows. This code is
all about using symlinks. Does anyone have any ideas what to do
in windows when symlinks were required?  Or how you go about
creating a temp link to a file in windows?

 Thanks.




AFAIK,

Shortcut.lnk is the closest you're going to come to symlinks on NT.

I also believe hardlinks are possible, but you need NTFS for that.

The best way to implement symbolic links on NT is to overwrite it w/Linux.

"Jourden Parks" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>   I have to port alot of php code from linux to windows. This code is
> all about using symlinks. Does anyone have any ideas what to do
> in windows when symlinks were required?  Or how you go about
> creating a temp link to a file in windows?
>
>  Thanks.
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






We have two developers that are just learning PHP.  Working with the 
following code I do not have any problems.  However, the other person gets 
the error :
Warning: Undefined variable: submit in .....

The code is :
<?php
if ($submit){
//process form
         $sql="insert into ascodes values('$ascode','$name', '$date', 
'$desc','$date')";
         $result = $db->query($sql);
         echo "Thank You, come again\n";
}else{

?>

<form method="POST" action="<?php echo $PHP_SELF ?>" >
         Accounting Code: <input type="text" name="ascode"><br>
         Your name: <input type="text" name="name"><br>
         Todays Date: <input type="text" name="date"><br>
         Description: <input type="text" name="desc"><br>
         <input type=submit name="submit" value="insert record">
         </form>

<?php
}
?>

*---------*-----------*----------*---------*---------*---------*--------*
Jerry Nelson
Datanamics, Inc.
973-C Russell Ave
Gaithersburg, MD 20879






Jerry,
This is a very, very common problem.  The other person has "error_reporting"
in his php.ini set to E_ALL.  Have him set his error_reporting to something
a little more restrictive - like "error_reporting= E_ALL & ~(E_NOTICE |
E_USER_NOTICE)".

There really isn't anything wrong with the code - its just that for
debugging, PHP has E_ALL that tells you things you probably don't need to
know (like a variable that isn't defined).


-----Original Message-----
From: Jerry Nelson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 2:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Problem with submit


We have two developers that are just learning PHP.  Working with the 
following code I do not have any problems.  However, the other person gets 
the error :
Warning: Undefined variable: submit in .....

The code is :
<?php
if ($submit){
//process form
         $sql="insert into ascodes values('$ascode','$name', '$date', 
'$desc','$date')";
         $result = $db->query($sql);
         echo "Thank You, come again\n";
}else{

?>

<form method="POST" action="<?php echo $PHP_SELF ?>" >
         Accounting Code: <input type="text" name="ascode"><br>
         Your name: <input type="text" name="name"><br>
         Todays Date: <input type="text" name="date"><br>
         Description: <input type="text" name="desc"><br>
         <input type=submit name="submit" value="insert record">
         </form>

<?php
}
?>

*---------*-----------*----------*---------*---------*---------*--------*
Jerry Nelson
Datanamics, Inc.
973-C Russell Ave
Gaithersburg, MD 20879



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




>I'm about to create a piece of a project which which will be used to check
>for errors in data entry.  Every 500 records entered will prompt the user to
>check their work.  I have all of the triggers set up already.  The database
>is all Oracle, PHP 4.0.4 (1381 build).  What I would like to do is display
>all of the 500 records (no problem) and (here's where I could use some
>advice) highlight any records with a duplicate value in one particular
>field.
>
>Should I load all of the data into an array?  Should I skim through all the
>records, take notes, reset, and then run through them again?  Should I run a
>separate statement which searches for dupes and then match them against the
>whole body of records?
>
>I don't want code, just a voice of experience which could start me off
>right.
>
>Thanks,
>
>John

Sir, just off the top of my head;
If you can return the records in a different order than they were 
entered, then I would GROUP BY the field containing duplicates, so 
that duplicate data are grouped together. Then your app can iterate 
through the records and highlight anything where the same value 
appears sequentially. If your ORDER BY in your SELECT statement so 
that the records with duplicate values appear first or last, you app 
will only have to iterate through the duplicates, and can stop as 
soon as it stops finding duplicates.

A little more off the top;
If you can't return the records in a different order, the do a second 
query, GROUP BY the field containing duplicates, and return only 
groups with more than one record. Highlight any records in the 
display whose values match the values in the second query. (Match on 
either the duplicate values or the primary key values.)

Bob Hall

Know thyself? Absurd direction!
Bubbles bear no introspection.     -Khushhal Khan Khatak
MySQL list magic words: sql query database




Dump the records into a temp table.
Make sure you don't design a system that ends up loosing Data Entry somehow.

You could store info into an array, but what happens when a connection is
broken,etc...  ???

""Asendorf, John"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm about to create a piece of a project which which will be used to check
> for errors in data entry.  Every 500 records entered will prompt the user
to
> check their work.  I have all of the triggers set up already.  The
database
> is all Oracle, PHP 4.0.4 (1381 build).  What I would like to do is display
> all of the 500 records (no problem) and (here's where I could use some
> advice) highlight any records with a duplicate value in one particular
> field.
>
> Should I load all of the data into an array?  Should I skim through all
the
> records, take notes, reset, and then run through them again?  Should I run
a
> separate statement which searches for dupes and then match them against
the
> whole body of records?
>
> I don't want code, just a voice of experience which could start me off
> right.
>
> Thanks,
>
> John
>
> ---------------------
> John Asendorf - [EMAIL PROTECTED]
> Web Applications Developer
> http://www.lcounty.com - NEW FEATURES ADDED DAILY!
> Licking County, Ohio, USA
> 740-349-3631
> Aliquando et insanire iucundum est
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Hello to all,

I trie to sent images inside an Email under Windows 2kServer. using the
mail() function under php4.
It works fine as long as the image is smaller then 3kB.

If the image is larger, the script takes ages an then it doesn't execute.

Is it possible to solve this problem???
I am on this since a long time now. It would be helpfull to know if it is
worth while to follow this.


Thx

Markus








Has anybody ever successfully ran PHP as an ISAPI module in windows NT or 
2000? I can installit and sometimes get it to print our the phpinfo() 
function but it's extremely flaky and frequently crashes.

Is there a document that explains the intracasies of this environment.
If I decide to scrap IIS and go to apache will php run as a loadable module 
or CGI? Will it be fast and efficient like ISAPI?

:wq
Tim Uckun
Due Diligence Inc.  http://www.diligence.com/    Americas Background 
Investigation Expert.
If your company isn't doing background checks, maybe you haven't considered 
the risks of a bad hire.





Tim,

Unfortunately, the ISAPI module just isn't stable on this platform. Sorry.

-Flint

-----Original Message-----
From: Tim Uckun [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 12:10 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] ISAPI




Has anybody ever successfully ran PHP as an ISAPI module in windows NT or 
2000? I can installit and sometimes get it to print our the phpinfo() 
function but it's extremely flaky and frequently crashes.

Is there a document that explains the intracasies of this environment.
If I decide to scrap IIS and go to apache will php run as a loadable module 
or CGI? Will it be fast and efficient like ISAPI?

:wq
Tim Uckun
Due Diligence Inc.  http://www.diligence.com/    Americas Background 
Investigation Expert.
If your company isn't doing background checks, maybe you haven't considered 
the risks of a bad hire.


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




At 12:13 PM 5/9/2001 -0700, Flint Doungchak wrote:
>Tim,
>
>Unfortunately, the ISAPI module just isn't stable on this platform. Sorry.

What is the prefered way to run PHP in windows? As a CGI? As an apache 
module? Aolserver?

I would rather not run it as a CGI because I need persistent database 
connections.

:wq
Tim Uckun
Due Diligence Inc.  http://www.diligence.com/    Americas Background 
Investigation Expert.
If your company isn't doing background checks, maybe you haven't considered 
the risks of a bad hire.





>What is the prefered way to run PHP in windows? As a CGI? As an apache
>module? Aolserver?
The Apache module seems to cut it for production environments from what I
hear (no direct personal experience).

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org





On 9 May 2001 12:07:54 -0700, Tim Uckun <[EMAIL PROTECTED]> wrote:
> Is there a document that explains the intracasies of this environment.
> If I decide to scrap IIS and go to apache will php run as a loadable module 
> or CGI? Will it be fast and efficient like ISAPI?

Loadable module. And yes, it's efficient. It's also nice to have the much
richer Apache environment available instead of IIS.




My preference is to run Apache/PHP on Linux.

Since I don't always get my way Apache/PHP on Windows is good.

I spent a little time attempting IIS.  When it wouldn't respond to the
Management Console and I had to reboot the server to restart IIS, I decided
it was the worst solution for any problem.  Or a good problem for every
solution.

I've yet to run into an instance where Apache can only be restarted via
reboot.

Apache is a little more compilcated to configure, however, the power beneath
the hood far outweights this difficulty.

-Joe
"Tim Uckun" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 12:13 PM 5/9/2001 -0700, Flint Doungchak wrote:
> >Tim,
> >
> >Unfortunately, the ISAPI module just isn't stable on this platform.
Sorry.
>
> What is the prefered way to run PHP in windows? As a CGI? As an apache
> module? Aolserver?
>
> I would rather not run it as a CGI because I need persistent database
> connections.
>
> :wq
> Tim Uckun
> Due Diligence Inc.  http://www.diligence.com/    Americas Background
> Investigation Expert.
> If your company isn't doing background checks, maybe you haven't
considered
> the risks of a bad hire.
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






The Problem:  php only runs reliably as a cgi on Windows, so it lacks static
DB connections.

Idea:  Make all DB queries through a JavaBean, which uses a pool of shared
JDBC connections.  Abstract this behind a php API (class with methods) to
hide its complexity.

Surely somebody has thought of this before :
If so is this solution available, free or commercially?

Monty.


> -----Original Message-----
> From: Tim Uckun [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 09, 2001 2:31 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] ISAPI
> 
> 
> At 12:13 PM 5/9/2001 -0700, Flint Doungchak wrote:
> >Tim,
> >
> >Unfortunately, the ISAPI module just isn't stable on this 
> platform. Sorry.
> 
> What is the prefered way to run PHP in windows? As a CGI? As 
> an apache 
> module? Aolserver?
> 
> I would rather not run it as a CGI because I need persistent database 
> connections.
> 
> :wq
> Tim Uckun
> Due Diligence Inc.  http://www.diligence.com/    Americas Background 
> Investigation Expert.





At 02:54 PM 5/9/2001 -0500, Dickerson, Monty wrote:
>The Problem:  php only runs reliably as a cgi on Windows, so it lacks static
>DB connections.
>
>Idea:  Make all DB queries through a JavaBean, which uses a pool of shared
>JDBC connections.  Abstract this behind a php API (class with methods) to
>hide its complexity.
>
>Surely somebody has thought of this before :
>If so is this solution available, free or commercially?

Why not use an all java solution then? Enhydra, velocity, cocoon, 
locomotive etc are all open source. Webobjects is cheap and very cool.



:wq
Tim Uckun
Due Diligence Inc.  http://www.diligence.com/    Americas Background 
Investigation Expert.
If your company isn't doing background checks, maybe you haven't considered 
the risks of a bad hire.





Tim--

1. Because we like php; it's a faster rapid development environment than any
of the environments you mentioned and has much shallower learning curve,
hence developer assistants cost less :) and are easier to find.

2. Because there's a ton of cool software in the php language out there we
want to exploit and it's not available in Java.

3. Because php lets me go home at 5pm and Java never does :-).  Even though
I like Java alot, I don't like it enough to sleep with it..!

Monty


> -----Original Message-----
> From: Tim Uckun [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 09, 2001 3:05 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] Persistent DB Connections with CGI - 
>
> 
> Why not use an all java solution then? Enhydra, velocity, cocoon, 
> locomotive etc are all open source. Webobjects is cheap and very cool.
> 
> :wq
> Tim Uckun
> Due Diligence Inc.  http://www.diligence.com/    Americas Background 
> Investigation Expert.






>1. Because we like php; it's a faster rapid development environment than any
>of the environments you mentioned and has much shallower learning curve,
>hence developer assistants cost less :) and are easier to find.
>
>2. Because there's a ton of cool software in the php language out there we
>want to exploit and it's not available in Java.
>
>3. Because php lets me go home at 5pm and Java never does :-).  Even though
>I like Java alot, I don't like it enough to sleep with it..!

Everything you say is true but....
I spent the first part of my day trying to get W2K/IIS/PHP working as an 
ISAPI module, I spent the second half of my day trying to get it working as 
an apache module (still crashing hard).
Maybe what' really needed is to build in a web server into php itself. That 
way there is only one thng to install and configure



:wq
Tim Uckun
Due Diligence Inc.  http://www.diligence.com/    Americas Background 
Investigation Expert.
If your company isn't doing background checks, maybe you haven't considered 
the risks of a bad hire.





I'm running PHP4.05RC1 on W2K as an Apache module with no problems....

Sounds like you have a config problem? How have you set it up?

Ignatius


-----Original Message-----
From: Tim Uckun [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 10 May 2001 06:55
To: [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Persistent DB Connections with CGI - Via Java...



>1. Because we like php; it's a faster rapid development environment than
any
>of the environments you mentioned and has much shallower learning curve,
>hence developer assistants cost less :) and are easier to find.
>
>2. Because there's a ton of cool software in the php language out there we
>want to exploit and it's not available in Java.
>
>3. Because php lets me go home at 5pm and Java never does :-).  Even though
>I like Java alot, I don't like it enough to sleep with it..!

Everything you say is true but....
I spent the first part of my day trying to get W2K/IIS/PHP working as an
ISAPI module, I spent the second half of my day trying to get it working as
an apache module (still crashing hard).
Maybe what' really needed is to build in a web server into php itself. That
way there is only one thng to install and configure



:wq
Tim Uckun
Due Diligence Inc.  http://www.diligence.com/    Americas Background
Investigation Expert.
If your company isn't doing background checks, maybe you haven't considered
the risks of a bad hire.


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






""Dickerson, Monty"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The Problem:  php only runs reliably as a cgi on Windows, so it lacks
static
> DB connections.

This is a false statement.  I have an implementation of apache/php SAPI
running in a production enviroinment against Oracle 8 database on an NT 4
server, w/out incident.

Took a week of studying the source to figure out why Oracle 8 was crashing,
but the thread-safe aspect is stable now, and I have an implementation in
production now.  I can't speak for other db resources, but the others being
being cleaned up.  PHP 4.0.6 will likely be very stable for all.

> Idea:  Make all DB queries through a JavaBean, which uses a pool of shared
> JDBC connections.  Abstract this behind a php API (class with methods) to
> hide its complexity.
>
> Surely somebody has thought of this before :
> If so is this solution available, free or commercially?
>
> Monty.
>
>
> > -----Original Message-----
> > From: Tim Uckun [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, May 09, 2001 2:31 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: [PHP-WIN] ISAPI
> >
> >
> > At 12:13 PM 5/9/2001 -0700, Flint Doungchak wrote:
> > >Tim,
> > >
> > >Unfortunately, the ISAPI module just isn't stable on this
> > platform. Sorry.
> >
> > What is the prefered way to run PHP in windows? As a CGI? As
> > an apache
> > module? Aolserver?
> >
> > I would rather not run it as a CGI because I need persistent database
> > connections.
> >
> > :wq
> > Tim Uckun
> > Due Diligence Inc.  http://www.diligence.com/    Americas Background
> > Investigation Expert.
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






I have 2 PCs. On the first, I installed PHP and IIS 4 on a windows NT server
and on the second windows NT server without PHP or IIS4. But my web server
(the first PC) haven't enough free disk space to store data on it.
Then I want to access with PHP on the second PC and for example list the
shared directory. I try opendir and readdir with "\\\\SERVEUR\\TEMP\\".
I tried to connect a network drive with "net use F: \\SERVEUR\TEMP ".
But he didn't work. How to do that please...
Maybe my explain is not enough explicit but my english is a little poor so
if you think to know what I want to do write me...
Thanks a lot






hi all, hope you can help me
i'm new with php, i downloaded phptriad for windows
already installed it, but i don't know how to start mysql
i'm looking for phpmyadmin but can't find it
thanks a lot to all for reading this mail and hope you can help me
Xytras




Well, as much as I like PHP, the article is accurate as far as running it on
Windows is concerned.  It's not really a problem to get it running as an
ISAPI module (though the Windows install program wisely sets it up in CGI
mode only).  I've continually tried to get the ISAPI version to handle some
moderately sophisticated & popular scripts (such as phpMyAdmin), and it has
consistently failed (with "Access Violation" errors - at least as of ver
4.04 - I haven't tested 4.05 in ISAPI mode yet).  It would be hard to
consider at least the ISAPI module ready for prime time until these issues
are resolved.

As far as his database abstraction layer complaint - I would agree that
there are a number of choices out there, and PHP's choice of using the
native or abstraction layers should be considered a plus.

Since I use HomeSite for PHP, CFM, & ASP coding, I'd also have to ignore his
complaint about the Zend development environment.  I've never used the debug
facilities in ASP (Visual Studio) anyway, thought when I have used them,
they've been nice.

Finally, one language issue that is a real pet peeve of mine is case
sensitive variable definitions.  This is not a problem in either CFM or ASP.
While it can be somewhat worked around by setting the PHP error level
reporting to flag uninitialized variables, it is a deficiency that is long
overdue to be corrected.

-- Greg Brunet


"Robert Klinkenberg" <[EMAIL PROTECTED]> wrote in message
41995094E2FED31197F6005004B2739F02655E@RED">news:41995094E2FED31197F6005004B2739F02655E@RED...
> Nice to know that some well known pc magazine wants to test PHP.
> Not so nice to know that people testing software for a major computer
> magazine don't know how to read the manual.
>
> Installing as an ISAPI module is not THAT difficult (Or am I a genius?).
At
> least I don't know anyone having problems with that. And besides the
> majority of people on the PHPWIN mailing list seem to be capable of
> performing the steps in the readme file.

<clip>







>
>Finally, one language issue that is a real pet peeve of mine is case
>sensitive variable definitions.  This is not a problem in either CFM or ASP.
>While it can be somewhat worked around by setting the PHP error level
>reporting to flag uninitialized variables, it is a deficiency that is long
>overdue to be corrected.

 From what I hear it's about to get worse. Instead of making variable names 
case insensitive they are going to make the function names case sensitive 
too.  Seems like they want to make the language more C like.
As for other stuff my pet peeve is the lack of consistency in the 
functions.  Look at all the string functions. Most of them work on a string 
but some one the string first some want it last some want it somewhere in 
the middle. It's even worse with database functions.  Because each function 
is written by somebody else it uses a different calling convention or 
returns different things. PHP definately lacks the cohesiveness and 
intuitiveness of other scripting languages. I don't want to rag on it too 
much because obviously the good points of it outweigh the bad points for me 
but especially in large projects that require multiple programmers I really 
wish it was more cohesive. As it is I am never really confident about using 
any function without first checking the manual. In Perl or python I can 
pretty much guess what a function is going to do 90 percent of the time.



:wq
Tim Uckun
Due Diligence Inc.  http://www.diligence.com/    Americas Background 
Investigation Expert.
If your company isn't doing background checks, maybe you haven't considered 
the risks of a bad hire.





Tim:

AAARRRGGH! They got it half-right with case insensitive functions and now
they're going to mess up the part that's done right!?!  It is quite annoying
that they aren't consistent, but I was thankful that at least the functions
were working "right".

-- Greg

"Tim Uckun" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

>  From what I hear it's about to get worse. Instead of making variable
names
> case insensitive they are going to make the function names case sensitive
> too.  Seems like they want to make the language more C like.
> As for other stuff my pet peeve is the lack of consistency in the
> functions.

<clip>






Hello Everyone

I am using the PHP 4.0.5 I believe's php.exe preprocessor.  How do I pass it the 
QUERY_STRING parameters from the dos window's command line ???  I need to do some 
manual testing and can not figure out how to pass it the URL's query line.

Thanks
Chris





Put on your thinking caps.

I need to open a popup window and display its contents. Since PHP doesn't 
have that functionality, I am resorting to Javascript. The two will be used in
the following manner:

<?
function outputOrderToFile(){

The PHP code that access the MySQL data base, formats the report, and 
writes it to FILEA.
}

?>

<script language="javascript">
function NewWindow (sourceHtml){

Parameters about the window (location, size, etc.)
}


the HTML ....

<a href="FILEA" onClick="<? outputOrderToFile(); ?>; NewWindow(this.href); 
return false"></a>

Is there anything obviously wrong with that bit of logic/code?

If there is a better way, please sketch it out for me.

Thanks,

Bob Sears, Owner
WebWyshez





Wouldn't it be simpler to have your PHP function in a discrete script file
and call:

<a href="javascript:void(0)" onClick="NewWindow('myscript.php');
return false"></a>

ignatius

-----Original Message-----
From: Bob Sears [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 10 May 2001 10:45
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] HTML/PHP/Javascript



Put on your thinking caps.

I need to open a popup window and display its contents. Since PHP doesn't
have that functionality, I am resorting to Javascript. The two will be used
in
the following manner:

<?
function outputOrderToFile(){

The PHP code that access the MySQL data base, formats the report, and
writes it to FILEA.
}

?>

<script language="javascript">
function NewWindow (sourceHtml){

Parameters about the window (location, size, etc.)
}


the HTML ....

<a href="FILEA" onClick="<? outputOrderToFile(); ?>; NewWindow(this.href);
return false"></a>

Is there anything obviously wrong with that bit of logic/code?

If there is a better way, please sketch it out for me.

Thanks,

Bob Sears, Owner
WebWyshez


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





Not only that, but Bob, PHP is a *server-side* language.  That means that 
all computing is done on the server before ever even being sent to the 
user.  You can't call PHP on the fly -- it's done when the user requests 
the file, and then the resulting HTML is what the user gets.  On the other 
hand, JavaScript is a CLIENT-SIDE language, meaning it doesn't do anything 
on the server, it simply manipulates the HTML that the user has already 
gotten.  You can have PHP affect the script on the resulting page the user 
gets before the page is sent, but you can't have JavaScript to anything 
with PHP, besides opening or redirecting to a new PHP page with particular 
parameters.

For example, in terms of PHP affecting JavaScript.. I created an image 
database where users can upload images, and when they do the file info 
(file name, description, file size, image width, image height, file type) 
are stored in the database.  When the users go to browse the images, there 
is JavaScript code which PHP dynamically populates with all of the image 
data, so that the users can preview all of the images and their info 
without reloading the page.  That's an example of PHP influencing the 
resulting JavaScript.  But JavaScript can't affect PHP, because the PHP is 
all computed on the server side before ever reaching the user, whereas 
JavaScript is executed on the user's side.

Hope that clears things up.

-Mike

At 11:32 AM 5/10/01 +1000, Ignatius Teo wrote:
>Wouldn't it be simpler to have your PHP function in a discrete script file
>and call:
>
><a href="javascript:void(0)" onClick="NewWindow('myscript.php');
>return false"></a>
>
>Put on your thinking caps.

Today's alienated gem:
"Send your favorite mom lots of love and affection, free of shipping 
charges!" -- Seen on a shopping site

               -=- Mike Flynn - Burlington, VT -=-
[EMAIL PROTECTED]  http://www.mikeflynn.net/  * Give blood *
  Wouldn't the free market, in its true form, be anarchy?





All - 

I am using the php.exe preprocessor and I want to run the preprocessor manually and 
see the output it generates on a particular .php file I have wrote. 

The .php file I have written requires some URL arguments which would normally be 
submitted in the QUERY_STRING argument on the URL link.  How can I force these values 
into the QUERY_STRING using the preprocessor php.exe file?

Thanks
Chris




I think you need to have argc & argv=On in your php.ini

Ignatius

-----Original Message-----
From: Chris Cranford [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 10 May 2001 09:59
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] PHP Preprocessor - URGENT


All -

I am using the php.exe preprocessor and I want to run the preprocessor
manually and see the output it generates on a particular .php file I have
wrote.

The .php file I have written requires some URL arguments which would
normally be submitted in the QUERY_STRING argument on the URL link.  How can
I force these values into the QUERY_STRING using the preprocessor php.exe
file?

Thanks
Chris





Hello Chris,

If you wants $QUERY_STRING only try this:
1) Create file wrapper.php:
   <?php
   $QUERY_STRING = "your values";
   include "your_script.php";
   ?>
2) php.exe -q wrapper.php


CC> All - 

CC> I am using the php.exe preprocessor and I want to run the preprocessor manually 
and see the output it generates on a particular .php file I have wrote. 

CC> The .php file I have written requires some URL arguments which would normally be 
submitted in the QUERY_STRING argument on the URL link.  How can I force these values 
into the QUERY_STRING using
CC> the preprocessor php.exe file?

CC> Thanks
CC> Chris




-- 
Best regards,
 Ruslan                            mailto:[EMAIL PROTECTED]




Reply via email to