OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 14 Jun 2003 05:46:10 -0000 Issue 2116

php-general-digest-helplists.php.net
Date: Sat Jun 14 2003 - 00:46:10 CDT


php-general Digest 14 Jun 2003 05:46:10 -0000 Issue 2116

Topics (messages 151386 through 151459):

Re: Redirects in PHP
        151386 by: Brian S. Drexler
        151387 by: Carl Furst
        151388 by: Johnny Martinez
        151389 by: Ernest E Vogelsinger
        151390 by: Brian S. Drexler

Patch: No input file specified
        151391 by: Zak Johnson

stumped on mysql_num_rows
        151392 by: Global I.S. S.A.
        151393 by: Alex Earl
        151412 by: Jason Wong

Stumped MySql insert query
        151394 by: Pushpinder Singh Garcha
        151396 by: Zak Johnson
        151397 by: Jay Blanchard
        151401 by: Pushpinder Singh Garcha
        151405 by: Zak Johnson

Re: Translate easy the language of the web site
        151395 by: Jacob Marble
        151407 by: Jason Wong
        151453 by: John Hicks

create a chmod'd file
        151398 by: Matt Palermo
        151399 by: Alex Earl
        151400 by: Jay Blanchard
        151402 by: Matt Palermo
        151403 by: Jay Blanchard
        151406 by: Jason Wong
        151408 by: Matt Palermo
        151409 by: Jason Wong
        151411 by: Jay Blanchard
        151421 by: Matt Palermo
        151424 by: Matt Palermo
        151425 by: John Nichel

ABOUT SOCKETS (HELP!)
        151404 by: David Elìas Sánchez Vásquez

Re: Zend Optimizer not active?
        151410 by: Steve Yates

set_error_handler() with class, method as parameters problem.
        151413 by: Lukasz Karapuda

Re: Variable variables question?
        151414 by: Ford, Mike [LSS]
        151442 by: Douglas Douglas

File lsiting exec(ls... using variables.
        151415 by: Vernon
        151416 by: Jay Blanchard

forms question -- simple
        151417 by: Gregory Landry
        151418 by: Gregory Landry

PLEASE STOP SENDING ME MAIL!!! PLEASE UNSUBSCRIBE NOW!!!
        151419 by: Ruth Copland
        151423 by: Alex Earl

Will this work right?
        151420 by: Leif K-Brooks
        151422 by: Alex Earl
        151426 by: Leif K-Brooks
        151458 by: PHP4 Emailer
        151459 by: Leif K-Brooks

Pipe $var to a shell command
        151427 by: Tim T
        151428 by: DvDmanDT
        151429 by: Bobby Patel
        151430 by: DvDmanDT
        151431 by: Leif K-Brooks
        151432 by: DvDmanDT
        151436 by: Tim T

header() and mozilla - HELP!
        151433 by: deno vichas
        151434 by: DvDmanDT
        151435 by: Gerard Samuel

fread has changed functionality...please read
        151437 by: Bob Silva

Re: $_SESSION as $key=>$value
        151438 by: Daniel J. Rychlik
        151440 by: Ralph
        151441 by: Daniel J. Rychlik
        151443 by: John Nichel
        151444 by: Lars Torben Wilson

extracting text from text file to be used in PHP
        151439 by: Lance Q
        151456 by: Jeff Harris

Question on SELECT
        151445 by: Roy W
        151446 by: Leif K-Brooks

which is quicker? pseudo XML, or database?
        151447 by: Justin French
        151449 by: Robert Cummings
        151454 by: Manuel Lemos
        151455 by: Justin French

Foreach loop with empty values
        151448 by: CDitty
        151451 by: CDitty

Saving
        151450 by: Monil Chheda
        151452 by: Leif K-Brooks

AOL and PHP
        151457 by: rml

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

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

attached mail follows:


I don't know of any, but is there a "good" alternative?

-----Original Message-----
From: Zak Johnson [mailto:zakj-php-generalnox.cx]
Sent: Friday, June 13, 2003 1:31 PM
To: php-generallists.php.net
Subject: Re: [PHP] Redirects in PHP

On 2003-06-13 10:34-0600, Michael wrote:
> Search engines frown on using meta refresh because of
> abuse problems. Some engines won't index the page
> period and all of them penalize you at the very least.
> While it will work as you described, you're sacrificing
> search engine positioning to use it.

How many search engines do you know of that will parse and follow the
JavaScript location.href redirection suggested earlier?

-Zak

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

attached mail follows:


I can understand the abuse, but this page wouldn't need to be indexed on any
search engines really.. but I it's an important consideration.

Thanks!

Thanks to everyone!

Carl.

-----Original Message-----
From: Michael [mailto:mlewisexasource.com]
Sent: Friday, June 13, 2003 12:35 PM
To: Zak Johnson; php-generallists.php.net
Subject: Re: [PHP] Redirects in PHP

Search engines frown on using meta refresh because of
abuse problems. Some engines won't index the page
period and all of them penalize you at the very least.
While it will work as you described, you're sacrificing
search engine positioning to use it. You need to weigh
the trade-offs

Michael

On Friday 13 June 2003 11:00 am, Zak Johnson wrote:
> <meta http-equiv="refresh"
> content="3;URL=http://example.com/new-page.html" />

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

attached mail follows:


You can do the cheesy: This page has moved. Please click this link.

heheh

J

-----Original Message-----
From: Carl Furst [mailto:carlvote.com]
Sent: Friday, June 13, 2003 10:43 AM
To: mlewisexasource.com
Cc: php-generallists.php.net
Subject: RE: [PHP] Redirects in PHP

I can understand the abuse, but this page wouldn't need to be indexed on any
search engines really.. but I it's an important consideration.

Thanks!

Thanks to everyone!

Carl.

-----Original Message-----
From: Michael [mailto:mlewisexasource.com]
Sent: Friday, June 13, 2003 12:35 PM
To: Zak Johnson; php-generallists.php.net
Subject: Re: [PHP] Redirects in PHP

Search engines frown on using meta refresh because of
abuse problems. Some engines won't index the page
period and all of them penalize you at the very least.
While it will work as you described, you're sacrificing
search engine positioning to use it. You need to weigh
the trade-offs

Michael

On Friday 13 June 2003 11:00 am, Zak Johnson wrote:
> <meta http-equiv="refresh"
> content="3;URL=http://example.com/new-page.html" />

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

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

attached mail follows:


At 19:00 13.06.2003, Zak Johnson said:
--------------------[snip]--------------------
>This will not solve the OP's problem; the header will still be output
>first, and the client will be immediately redirected. I am curious
>though; why is everyone suggesting to use JavaScript when the following
>in the <head> section of the HTML document will work just as well?
>
> <meta http-equiv="refresh"
> content="3;URL=http://example.com/new-page.html" />
>
>Am I missing something?
--------------------[snip]--------------------

This will (or should...) always work regardless of JS settings. Being a
HTTP equivalent this also means you can transmit it as MIME header as well:

header('Refresh: 5;URL="http://www.microsoft.com"');
echo 'Transferring you to Microsoft in 5 seconds...';
exit;

HTH,

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


But is this the type of stuff that gets penalized in Search Engines or no?

-----Original Message-----
From: Ernest E Vogelsinger [mailto:ernestvogelsinger.at]
Sent: Friday, June 13, 2003 1:47 PM
To: Zak Johnson
Cc: php-generallists.php.net
Subject: Re: [PHP] Redirects in PHP

At 19:00 13.06.2003, Zak Johnson said:
--------------------[snip]--------------------
>This will not solve the OP's problem; the header will still be output
>first, and the client will be immediately redirected. I am curious
>though; why is everyone suggesting to use JavaScript when the following
>in the <head> section of the HTML document will work just as well?
>
> <meta http-equiv="refresh"
> content="3;URL=http://example.com/new-page.html" />
>
>Am I missing something?
--------------------[snip]--------------------

This will (or should...) always work regardless of JS settings. Being a
HTTP equivalent this also means you can transmit it as MIME header as well:

header('Refresh: 5;URL="http://www.microsoft.com"');
echo 'Transferring you to Microsoft in 5 seconds...';
exit;

HTH,

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

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

attached mail follows:


I run PHP via a simple-minded webserver which sets up some environment
variables and then calls my php scripts (which begin with a
"#!/usr/local/bin/php" line). My scripts must handle all the headers,
including the HTTP status header. My standard included file contains
"header($_SERVER['SERVER_PROTOCOL'] . ' 200 OK');", and other files may
emit a similar header with a different status code for redirection and
so forth.

Unfortunately, after upgrading to 4.3.2 I encountered two problems.
First, PHP was "helpfully" refusing to emit status headers for which the
status code was 200 even when explicity instructed to by the above
header() call. Second, while my scripts would run correctly at the
command line, when run via a web server I was getting a 404 status and
the error message "No input file specified."

I have created a patch to work around the above problems; it is a hack,
but restores my desired functionality if I also set "cgi.rfc2616_headers
= 1" in php.ini. PHP developers, if you're out there, please consider
backing out rev 1.195 of php4/sapi/cgi/cgi_main.c or adding a
configuration directive to disable its behaviour. I'm not sure what the
correct solution for the "No input file specified" problem is; I'll try
to look into it more if I have some time next week, but this was my
first peek at PHP's source.

-Zak

attached mail follows:


Hello List,
The issue appears to be that no rows are being found with mysql_num_rows using the SQL LIMIT offset. There should be rows found. Further, all processing just halts, and no query is shown as per the code here:

// RUN THE QUERY TO RETRIEVE EACH FOUND RECORD
$queryResultHandle = mysql_query($concatquery, $link_identifier) or die ( mysql_error());
// make sure that we recieved some data from our query
$rows = mysql_num_rows ($queryResultHandle);
if ( $rows > 0 ) { // <<<<<<<< THIS IS WHERE THE SCRIPT FAILS
   while ($data = mysql_fetch_array ($queryResultHandle)) {
      /* /////////////////////////////////////////////////
      // COMMON VARIABLE ASSIGNMENT BLOCK - start
      $yflastupdate = $data["lastupdate"]; // and other fields too ...
      // COMMON VARIABLE ASSIGNMENT BLOCK - end
      //////////////////////////////////////////////////// */
      include("showOneRecord.php"); // display the row values in a template
   } // while
   // mysql_free_result ($queryResultHandle);
}else{
   echo"<br>Process anomaly. Please try again.<br>";
   echo $query;
   exit;
}

The result is intermittent failure with the message "Process anomaly. Please try again." when the first or subsequent "next page" button is clicked. No query shown with the failure, and a query should be shown.

CONFIGURATION
This issue is experienced intermittently on the developer production site and "always" on the customer localhost and production sites. The customer is using "I just recently installed PHP and mySQL so they are pretty close to the latest versions. I think it's PHP 4.3.1 and mySQL 4.0.13. I get the same error on both the first time I click the "More Results" button. My browser is IE 6.0.2800 SP1."

What's the problem?

Richard
Information Services
Global I.S. S.A.
infodreamriver.com
---
Globalissa B2B Websites
http://phpyellow.com
http://www.dreamriver.com

attached mail follows:


Can you give us the query too?

Alex

> Hello List,
> The issue appears to be that no rows are being found with mysql_num_rows
> using the SQL LIMIT offset. There should be rows found. Further, all
> processing just halts, and no query is shown as per the code here:
>
>
> // RUN THE QUERY TO RETRIEVE EACH FOUND RECORD
> $queryResultHandle = mysql_query($concatquery, $link_identifier) or die (
> mysql_error());
> // make sure that we recieved some data from our query
> $rows = mysql_num_rows ($queryResultHandle);
> if ( $rows > 0 ) { // <<<<<<<< THIS IS WHERE THE SCRIPT FAILS
> while ($data = mysql_fetch_array ($queryResultHandle)) {
> /* /////////////////////////////////////////////////
> // COMMON VARIABLE ASSIGNMENT BLOCK - start
> $yflastupdate = $data["lastupdate"]; // and other fields too ...
> // COMMON VARIABLE ASSIGNMENT BLOCK - end
> //////////////////////////////////////////////////// */
> include("showOneRecord.php"); // display the row values in a
> template
> } // while
> // mysql_free_result ($queryResultHandle);
> }else{
> echo"<br>Process anomaly. Please try again.<br>";
> echo $query;
> exit;
> }
>
>
> The result is intermittent failure with the message "Process anomaly.
> Please try again." when the first or subsequent "next page" button is
> clicked. No query shown with the failure, and a query should be shown.
>
>
> CONFIGURATION
> This issue is experienced intermittently on the developer production site
> and "always" on the customer localhost and production sites. The customer
> is using "I just recently installed PHP and mySQL so they are pretty close
> to the latest versions. I think it's PHP 4.3.1 and mySQL 4.0.13. I get
> the same error on both the first time I click the "More Results" button.
> My browser is IE 6.0.2800 SP1."
>
>
> What's the problem?
>
>
> Richard
> Information Services
> Global I.S. S.A.
> infodreamriver.com
> ---
> Globalissa B2B Websites
> http://phpyellow.com
> http://www.dreamriver.com
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


On Saturday 14 June 2003 01:55, Global I.S. S.A. wrote:

> The issue appears to be that no rows are being found with mysql_num_rows
> using the SQL LIMIT offset. There should be rows found. Further, all
> processing just halts, and no query is shown as per the code here:
>
>
> // RUN THE QUERY TO RETRIEVE EACH FOUND RECORD
> $queryResultHandle = mysql_query($concatquery, $link_identifier) or die (
> mysql_error()); // make sure that we recieved some data from our query

print out $concatquery to verify that it contains what you expect.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
It's useless to try to hold some people to anything they say while they're
madly in love, drunk, or running for office.
*/

attached mail follows:


Hello everyone,

      I am trying to execute a simple query using $_POST variables, so
that variable poisoning is not possible. note: I have register_globals
ON on my site. I am getting the error shown below . Please advise ...
as I can't seem to figure out why !

<?

// connect to the BD/Table etc

   // Formulate the query

     $sql1 = "INSERT INTO `contacts`
        
                VALUES (
                           $_POST['company'],
                           $_POST['pri_name'],
                           $_POST['sec_name'],
                           $_POST['assistant_1'],
                           $_POST['assistant_2'],
                           $_POST['pri_practice'],
                           $_POST['sec_practice'],
                           $_POST['sic'],
                           $_POST['date_established'],
                               $_POST['size'],
                           $_POST['phone_1'],
                           $_POST['phone_2'],
                           $_POST['phone_3'],
                           $_POST['email_1'],
                           $_POST['email_2'],
                           $_POST['email_3'],
                           $_POST['url'],
                           $_POST['city'],
                           $_POST['msa'],
                           $_POST['status'],
                              $_POST['timezone'],
                           $_POST['first_contact'],
                           $_POST['next_contact'],
                           $_POST['last_contact'],
                           $_POST['notes'],
                           $_POST['email_history'],
                           $_POST['battery_started'],
                           $_POST['details'],
                                TIMESTAMP();
                           $_POST['source']
                    )";
        
        

     $result1 = mysql_query($sql1)
         or die ( 'Database Error has occured.');
                
        $num_results = mysql_num_rows($result1);

        echo $num_results." rows added !!";
                        
?>

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /home/ABCD/CRM/add.php

Thanks in advance.
Pushpinder

attached mail follows:


Message-ID: <20030613182255.10131.qmailnox.cx>
Date: Fri, 13 Jun 2003 14:22:55 -0400
From: Zak Johnson <zakj-php-generalnox.cx>
To: php-generallists.php.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Subject: Re: [PHP] Stumped MySql insert query

On 2003-06-13 14:15-0400, Pushpinder Singh Garcha wrote:
> I am trying to execute a simple query using $_POST variables, so
> that variable poisoning is not possible. note: I have register_globals
> ON on my site. I am getting the error shown below . Please advise ...
> as I can't seem to figure out why !

$_POST variables are still subject to poisoning; in your case, SQL
injection. The error you're getting, however, is because you have not
enclosed your quoted variable references with braces. For example:

  <?php
    echo "{$_POST['foo']}";
  ?>

You should be passing each of those variables through
mysql_escape_string() before using them in a query.

-Zak

attached mail follows:


[snip]
     $sql1 = "INSERT INTO `contacts`
        
                VALUES (
                           $_POST['company'],
                           $_POST['pri_name'],
                           $_POST['sec_name'],
                           $_POST['assistant_1'],
                           $_POST['assistant_2'],
                           $_POST['pri_practice'],
[/snip]

     $sql1 = "INSERT INTO `contacts` (you, should, have, some, column,
names, here, in parentheses)
        
                VALUES (
                           '" . $_POST['company'] . "',
                           '" . $_POST['pri_name'] . "',
                           '" . $_POST['sec_name'] . "',
                           '" . $_POST['assistant_1'] . "',
                           '" . $_POST['assistant_2'] . "',
                           '" . $_POST['pri_practice'] . "',

etcetera

HTH!

Jay

attached mail follows:


On Friday, June 13, 2003, at 02:22 PM, Zak Johnson wrote:

> $_POST variables are still subject to poisoning; in your case, SQL
> injection.

How is variable poisoning possible when using $_POST ?? I always felt
that the php compiler should check to see if the variable was part of
the POST Global array. At least this is is what I thought about the
$_POST global array.

Thanks in advance
--Pushpinder

attached mail follows:


On 2003-06-13 14:42-0400, Pushpinder Singh Garcha wrote:
> How is variable poisoning possible when using $_POST ?? I always felt
> that the php compiler should check to see if the variable was part of
> the POST Global array. At least this is is what I thought about the
> $_POST global array.

It will do so only if magic_quotes_gpc is on. I tend not to rely on
that, especially when we have mysql_escape_string() easily available.

-Zak

attached mail follows:


Amen; machine-translators are no good for something that you don't want
confused.
ie- english "season" could be "sazon" or "estacion" in Spanish, which mean
two different things.

Jake

"Joel Rees" <joelalpsgiken.gr.jp> wrote in message
news:20030502182558.10BF.JOELalpsgiken.gr.jp...
> > Hello all mailing-list people, I need help, my question is: How could I
build a web site that I can translate easy the language of it?
> >
> > Thanks for all your help, bye.
>
> A thousand monkeys with keyboards?
>
> Machine translation is hit and miss, but there are companies that try to
> offer it.
>
> If you're talking about something a little easier, like allowing a site
> to be published in multiple languages (translation done by humans),
> there are people here who can help. But that doesn't look like the
> question you asked.
>
> --
> Joel Rees <joelalpsgiken.gr.jp>
> http://www.alpsgiken.co.jp
>

attached mail follows:


On Saturday 14 June 2003 02:19, Jacob Marble wrote:
> Amen; machine-translators are no good for something that you don't want
> confused.
> ie- english "season" could be "sazon" or "estacion" in Spanish, which mean
> two different things.

Never mind translation, "season" in English has more than one meaning.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Never invest your money in anything that eats or needs repainting.
                -- Billy Rose
*/

attached mail follows:


On Friday 13 June 2003 03:00 pm, you wrote:
> On Saturday 14 June 2003 02:19, Jacob Marble wrote:
> > Amen; machine-translators are no good for something
> > that you don't want confused.
> > ie- english "season" could be "sazon" or "estacion" in
> > Spanish, which mean two different things.
>
> Never mind translation, "season" in English has more than
> one meaning.

I think that was his point. And the two meanings correspond to two different words in Spanish.

Most translation programs attempt to determine the intended meaning of such a word from its context. But it's an imperfect science.

-J

attached mail follows:


I have a script that creates a php file based on user input. I need this newly created file to have write permissions - chmod 777. How can I have the script create the file with these permissions already set? Is this possible?

Thanks,

Matt

attached mail follows:


Message-ID: <50088.143.182.124.3.1055529432.squirrelmail.0xf00.com>
Date: Fri, 13 Jun 2003 11:37:12 -0700 (MST)
From: "Alex Earl" <slideduke-of-earl.com>
To: "Matt Palermo" <mpalermovt.edu>
Cc: php-generallists.php.net
Reply-To: slideduke-of-earl.com
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Subject: Re: [PHP] create a chmod'd file

> I have a script that creates a php file based on user input. I need this
> newly created file to have write permissions - chmod 777. How can I have
> the script create the file with these permissions already set? Is this
> possible?
>
> Thanks,
>
> Matt

How are you creating the file? fopen()? touch()? Give a little more
information please.

Alex

attached mail follows:


uh, could it be...

http://us3.php.net/manual/en/function.chmod.php

-----Original Message-----
From: Matt Palermo [mailto:mpalermovt.edu]
Sent: Friday, June 13, 2003 1:36 PM
To: php-generallists.php.net
Subject: [PHP] create a chmod'd file

I have a script that creates a php file based on user input. I need
this newly created file to have write permissions - chmod 777. How can
I have the script create the file with these permissions already set?
Is this possible?

Thanks,

Matt

attached mail follows:


I am using the fopen(), then using fwrite() to write text to it. After this
I am trying this command which doesn't work:

chmod($filename, 0777);

But, this doesn't work, and I'm not sure how to go about chmod'ing the file
for these permissions so that it can be changed later on.

Matt

----- Original Message -----
From: "Alex Earl" <slideduke-of-earl.com>
To: "Matt Palermo" <mpalermovt.edu>
Cc: <php-generallists.php.net>
Sent: Friday, June 13, 2003 2:37 PM
Subject: Re: [PHP] create a chmod'd file

> > I have a script that creates a php file based on user input. I need
this
> > newly created file to have write permissions - chmod 777. How can I
have
> > the script create the file with these permissions already set? Is this
> > possible?
> >
> > Thanks,
> >
> > Matt
>
>
> How are you creating the file? fopen()? touch()? Give a little more
> information please.
>
> Alex

attached mail follows:


[snip]

I am using the fopen(), then using fwrite() to write text to it. After
this I am trying this command which doesn't work:

chmod($filename, 0777);

But, this doesn't work, and I'm not sure how to go about chmod'ing the
file for these permissions so that it can be changed later on.
[/snip]

Does $filename have the full path to the file in question?

attached mail follows:


On Saturday 14 June 2003 02:43, Matt Palermo wrote:
> I am using the fopen(), then using fwrite() to write text to it. After
> this I am trying this command which doesn't work:
>
> chmod($filename, 0777);
>
> But, this doesn't work, and I'm not sure how to go about chmod'ing the file
> for these permissions so that it can be changed later on.

What does "doesn't work" mean? Does it blow up your computer? Or does it give
an error message or what?

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Baker's First Law of Federal Geometry:
        A block grant is a solid mass of money surrounded on all sides by
        governors.
*/

attached mail follows:


It just doesn't chmod the file. It doesn't produce errors except for later
on in the script when it says it can't access the file with write
permissions (but it should already be chmod'd by then). Thanks.

Matt

----- Original Message -----
From: "Jason Wong" <php-generalgremlins.biz>
To: <php-generallists.php.net>
Sent: Friday, June 13, 2003 2:59 PM
Subject: Re: [PHP] create a chmod'd file

> On Saturday 14 June 2003 02:43, Matt Palermo wrote:
> > I am using the fopen(), then using fwrite() to write text to it. After
> > this I am trying this command which doesn't work:
> >
> > chmod($filename, 0777);
> >
> > But, this doesn't work, and I'm not sure how to go about chmod'ing the
file
> > for these permissions so that it can be changed later on.
>
> What does "doesn't work" mean? Does it blow up your computer? Or does it
give
> an error message or what?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> Baker's First Law of Federal Geometry:
> A block grant is a solid mass of money surrounded on all sides by
> governors.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


On Saturday 14 June 2003 03:01, Matt Palermo wrote:
> It just doesn't chmod the file. It doesn't produce errors except for later
> on in the script when it says it can't access the file with write
> permissions (but it should already be chmod'd by then). Thanks.

If chmod() fails I'm pretty sure it spits out an error, so if you've already
cranked up error reporting and are 100% positive there's no error being
reported then have a look at your umask() setting.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Q: What do you get when you cross a mobster with an international standard?
A: You get someone who makes you an offer that you can't understand!
*/

attached mail follows:


[snip]
It just doesn't chmod the file. It doesn't produce errors except for
later on in the script when it says it can't access the file with write
permissions (but it should already be chmod'd by then). Thanks.
[/snip]

What are the permissions of the script producing the file? Does it have
the proper permission and does it 'own' the file? Most web
interfaces/scripts operate as 'nobody' and therefore do not have
permission to set file permissions...if you'll permit me to say so.

HTH!

Jay

attached mail follows:


How do I get the script to "own" the file? Are there special commands
needed for this?

Matt

-----Original Message-----
From: Jay Blanchard [mailto:jay.blanchardniicommunications.com]
Sent: Friday, June 13, 2003 3:08 PM
To: Matt Palermo; php-generallists.php.net
Subject: RE: [PHP] create a chmod'd file

[snip]
It just doesn't chmod the file. It doesn't produce errors except for
later on in the script when it says it can't access the file with write
permissions (but it should already be chmod'd by then). Thanks.
[/snip]

What are the permissions of the script producing the file? Does it have
the proper permission and does it 'own' the file? Most web
interfaces/scripts operate as 'nobody' and therefore do not have
permission to set file permissions...if you'll permit me to say so.

HTH!

Jay

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

attached mail follows:


What is the umask()? What is that used for? How do I set that up
right?

Matt

-----Original Message-----
From: Jason Wong [mailto:php-generalgremlins.biz]
Sent: Friday, June 13, 2003 3:08 PM
To: php-generallists.php.net
Subject: Re: [PHP] create a chmod'd file

On Saturday 14 June 2003 03:01, Matt Palermo wrote:
> It just doesn't chmod the file. It doesn't produce errors except for
later
> on in the script when it says it can't access the file with write
> permissions (but it should already be chmod'd by then). Thanks.

If chmod() fails I'm pretty sure it spits out an error, so if you've
already
cranked up error reporting and are 100% positive there's no error being
reported then have a look at your umask() setting.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Q: What do you get when you cross a mobster with an international
standard?
A: You get someone who makes you an offer that you can't
understand!
*/

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

attached mail follows:


Matt Palermo wrote:
> I need this newly created file to have write permissions - chmod 777.

First, if you just need to write to it, don't chmod it to 777 (you're
giving rwx across the board doing that). Who needs to write to the
file? The webserver only? Then set the permissions to 600, assuming
that the user which the webserver is running as owns the file (to keep
things as secure as possible, it's best not to give out more permission
than is actually needed).

Next, if you're dealing with a stock install of Apache, it's probably
running as 'nobody', which can give you fits. I usually create a user
for Apache (user 'apache'), and set it's home to /sbin/nologin so no-one
can access the machine with that account (no password). If you go this
route, you'll have to edit your httpd.conf file to make apache run as
the new user, and restart apache.

This is of course assuming you're running php with apache on a *nix
system. :)

attached mail follows:


I know this is a PHP forum, but this is really urgent!!

A close friend of mine has got many trouble with this problem while
developing a Java chat. Any help would be really appreciated.

Thanks

David.

Problem is as follows:

 I'm programming an applet java chat but I have a big problem and I don't
> know how to do.
> When I test my application, I do this test with another person
> and when one of them starting send information quickly and other
> disconnects from the chat, the last disconnect without problems but this
afects the
> person who is sending information quickly and produce that this person
> disconnects abrubtly.
>
> I think this problem occurs because some network object has a bad use of
> synchronized or need to put a synchronized in it, but I don't know where I
> have to put it.... Can somebody know about it or how can I solve this
> problem?
>
> Thank you very much
>
> Regards,
>
> Gisella

attached mail follows:


On Fri, 13 Jun 2003 10:38:39 +0200, Marek Kilimajer wrote:

>Are the logs saying anything? Or if you run php from command line?

Sorry should have made that clear. Apache's error log does not show any
reference to PHP or Zend, nor does /var/log/messages. Is there another
place I should look?

From php.ini:
[Zend]
zend_optimizer.optimization_level=15
zend_extension=/usr/local/Zend/lib/ZendOptimizer.so

/usr/local/Zend/lib# ls
ZendOptimizer.so

/usr/local/bin# php -version
PHP 4.3.2 (cli) (built: Jun 10 2003 13:51:42)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

Running the CLI on a phpinfo() call also does not show Optimizer. Also
phpinfo() says "Debug Build => no" so that's not it.

 - Steve Yates
 - I have 5 nanosecond memory. Duration - not access time.

~ Taglines by Taglinator - www.srtware.com ~

attached mail follows:


This is not exactly a bug report, because i am not sure where problem
is.

I am using PHP4.3.1 on Win2000/IIS.

I am setting a custom error handler through:
set_error_handler(array(&$objError, 'handleError')); where $objError
is an instance of an error handling class.

Then, i trigger a user error in the following way: trigger_error("test
error", E_USER_ERROR);

The problem is that sometime the custom error handler is invoked and
sometimes it is NOT. The times when it is not invoked i get the
following error: Fatal error: test error in C:\********.php on line
104

Does this mean that there is a problem in my Error Handler class or is
that a PHP issue with using a Custom Error Handler class?

Thanks in advance,

Lukasz Karapuda
lukithenewline.com

attached mail follows:


-----Original Message-----
From: Douglas Douglas
To: php-generallists.php.net

To get the superglobal array ($_GET or $_POST), I try
to build these strings '_'.$method. I'm sure this part
works, PHP builds the string _GET or _POST according
to the $method parameter.
I use ${'_'.$method} to get the contents of the
superglobal. But this piece of code doesn't work.

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

Well, it won't, because there's a prominent warning on the manual page (http://www.php.net/language.variables.variable) that says:

  "Please note that variable variables cannot be used with PHP's
  Superglobal arrays. This means you cannot do things like ${$_GET}."

Cheers!
  

attached mail follows:


Thanks for the answer Mike.

Thanks for the explanation, but I think this is a
different case, isn't? I'm not trying to do this
${$_POST}, I'm trying to make this string $_POST.

And I have another question. Why does this code work?

<?php
echo '<pre>';
print_r($_POST);
echo '</pre><br><br>';
$method = 'POST';
$data = ${'_'.$method};
echo '<pre>';
print_r($data);
echo '</pre><br><br>';
?>

It does what I want it to do. I use it as the action
of the same form I submitted before and it does print
the superglobal array twice. The difference between
this code and the one that doesn't work is that the
latter is a class method.

What do you think? Thanks again.

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

attached mail follows:


I'm trying to add a variable to the end of a directory listing.

This will give me the root directory and show me all the files
        exec('ls /home/httpd/vhosts/sitename.com/httpdocs/resumes/',
$filelist);

I figured I could do this but it shows me all the files in the root of the
site not of the folder I want. So what it seems is that it is ignoring the
$path variable all together.
       $folder = $HTTP_GET_VARS['id'];
       $path = "/home/httpd/vhosts/sitename.com/httpdocs/resumes/$folder/";
        exec('ls $path', $filelist);

I've even tried to add echo but then nothing at all is listed:
        exec('ls <? echo $path; ?>', $filelist);

Any ideas?

attached mail follows:


[snip]
I'm trying to add a variable to the end of a directory listing.

This will give me the root directory and show me all the files
        exec('ls /home/httpd/vhosts/sitename.com/httpdocs/resumes/',
$filelist);
[/snip]

Have you thought about using

http://us4.php.net/manual/en/function.opendir.php

example;

$cdrdirectory = opendir("/usr/local/crm/cdr/");
    while($cdrtxt = readdir($cdrdirectory)){
        if(($cdrtxt <> ".") && ($cdrtxt <> "..") && ($cdrtxt <>
"cdrzip")){
            ...do stuff...
        }
    }
closedir($cdrdirectory);

attached mail follows:


Hi all,

I'm new to the list and to PHP. I haven't bought a book as of yet but I've
found a number of resources that are getting me through the basics.

I am collecting data from a form. I've having no problems collecting the
data and printing it out. But...

I have a form with check boxes with 4 options. See below.
************************************************************************

<input type=checkbox value=Investment name=investment>
<input type=checkbox value=Vacation Home name=vacation>
<input type=checkbox value=Retirement Home name=retirement>
<input type=checkbox value=Primary Home name=primary>

************************************************************************

This form data is being sent off to a php page to get the values printed
out. See below:

****************************************************************************
**********************

print "Which best describes your reason for wanting to purchase land?<br>";
print "$investment<br> $investment2<br> $investment3<br> $investment4<br>";

****************************************************************************
**********************

The problem is if a check box is not checked a blank space gets printed out
which I don't want. Can someone show me how to use an if then statement
with the following stucture:

***********************************************************************
if $investment <not eqaul to a blank> then print $investment
***********************************************************************

I would use this structure for each of the variables in the checkboxes
above. I'm sure this could be done with arrays in some form or another but
since I'm new at this I would just as soon keep it simple for now and learn
more sophisticated techniques later.

Thanks so much,

Greg Landry
glandry1maine.rr.com

attached mail follows:


I figured it out. Yipppeeeeee..

Thanks

-----Original Message-----
From: Gregory Landry [mailto:glandry1maine.rr.com]
Sent: Friday, June 13, 2003 4:10 PM
To: php-generallists.php.net
Subject: [PHP] forms question -- simple

Hi all,

I'm new to the list and to PHP. I haven't bought a book as of yet but I've
found a number of resources that are getting me through the basics.

I am collecting data from a form. I've having no problems collecting the
data and printing it out. But...

I have a form with check boxes with 4 options. See below.
************************************************************************

<input type=checkbox value=Investment name=investment>
<input type=checkbox value=Vacation Home name=vacation>
<input type=checkbox value=Retirement Home name=retirement> <input
type=checkbox value=Primary Home name=primary>

************************************************************************

This form data is being sent off to a php page to get the values printed
out. See below:

****************************************************************************
**********************

print "Which best describes your reason for wanting to purchase land?<br>";
print "$investment<br> $investment2<br> $investment3<br> $investment4<br>";

****************************************************************************
**********************

The problem is if a check box is not checked a blank space gets printed out
which I don't want. Can someone show me how to use an if then statement with
the following stucture:

***********************************************************************
if $investment <not eqaul to a blank> then print $investment
***********************************************************************

I would use this structure for each of the variables in the checkboxes
above. I'm sure this could be done with arrays in some form or another but
since I'm new at this I would just as soon keep it simple for now and learn
more sophisticated techniques later.

Thanks so much,

Greg Landry
glandry1maine.rr.com

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

attached mail follows:


--- gregory landry <glandry1maine.rr.com> wrote:
> I figured it out. Yipppeeeeee..
>
> Thanks
>
> -----Original Message-----
> From: Gregory Landry [mailto:glandry1maine.rr.com]
> Sent: Friday, June 13, 2003 4:10 PM
> To: php-generallists.php.net
> Subject: [PHP] forms question -- simple
>
>
> Hi all,
>
> I'm new to the list and to PHP. I haven't bought a
> book as of yet but I've
> found a number of resources that are getting me
> through the basics.
>
> I am collecting data from a form. I've having no
> problems collecting the
> data and printing it out. But...
>
> I have a form with check boxes with 4 options. See
> below.
>
************************************************************************
>
> <input type=checkbox value=Investment
> name=investment>
> <input type=checkbox value=Vacation Home
> name=vacation>
> <input type=checkbox value=Retirement Home
> name=retirement> <input
> type=checkbox value=Primary Home name=primary>
>
>
************************************************************************
>
> This form data is being sent off to a php page to
> get the values printed
> out. See below:
>
>
****************************************************************************
> **********************
>
> print "Which best describes your reason for wanting
> to purchase land?<br>";
> print "$investment<br> $investment2<br>
> $investment3<br> $investment4<br>";
>
>
****************************************************************************
> **********************
>
> The problem is if a check box is not checked a blank
> space gets printed out
> which I don't want. Can someone show me how to use
> an if then statement with
> the following stucture:
>
>
***********************************************************************
> if $investment <not eqaul to a blank> then print
> $investment
>
***********************************************************************
>
> I would use this structure for each of the variables
> in the checkboxes
> above. I'm sure this could be done with arrays in
> some form or another but
> since I'm new at this I would just as soon keep it
> simple for now and learn
> more sophisticated techniques later.
>
> Thanks so much,
>
> Greg Landry
> glandry1maine.rr.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

attached mail follows:


Read the bottom of the email messages, it tells you how to unsubscribe.

Alex

> --- gregory landry <glandry1maine.rr.com> wrote:
>> I figured it out. Yipppeeeeee..
>>
>> Thanks
>>
>> -----Original Message-----
>> From: Gregory Landry [mailto:glandry1maine.rr.com]
>> Sent: Friday, June 13, 2003 4:10 PM
>> To: php-generallists.php.net
>> Subject: [PHP] forms question -- simple
>>
>>
>> Hi all,
>>
>> I'm new to the list and to PHP. I haven't bought a
>> book as of yet but I've
>> found a number of resources that are getting me
>> through the basics.
>>
>> I am collecting data from a form. I've having no
>> problems collecting the
>> data and printing it out. But...
>>
>> I have a form with check boxes with 4 options. See
>> below.
>>
> ************************************************************************
>>
>> <input type=checkbox value=Investment
>> name=investment>
>> <input type=checkbox value=Vacation Home
>> name=vacation>
>> <input type=checkbox value=Retirement Home
>> name=retirement> <input
>> type=checkbox value=Primary Home name=primary>
>>
>>
> ************************************************************************
>>
>> This form data is being sent off to a php page to
>> get the values printed
>> out. See below:
>>
>>
> ****************************************************************************
>> **********************
>>
>> print "Which best describes your reason for wanting
>> to purchase land?<br>";
>> print "$investment<br> $investment2<br>
>> $investment3<br> $investment4<br>";
>>
>>
> ****************************************************************************
>> **********************
>>
>> The problem is if a check box is not checked a blank
>> space gets printed out
>> which I don't want. Can someone show me how to use
>> an if then statement with
>> the following stucture:
>>
>>
> ***********************************************************************
>> if $investment <not eqaul to a blank> then print
>> $investment
>>
> ***********************************************************************
>>
>> I would use this structure for each of the variables
>> in the checkboxes
>> above. I'm sure this could be done with arrays in
>> some form or another but
>> since I'm new at this I would just as soon keep it
>> simple for now and learn
>> more sophisticated techniques later.
>>
>> Thanks so much,
>>
>> Greg Landry
>> glandry1maine.rr.com
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


The following function converts minutes to years, monthes, weeks, days,
hours, minutes. For instance, 61 minutes would become "1 hour, one
minute". Before I use it, I want to make sure there are no stupid
mistakes. I can't find any, can any of you?
function min2ymwdhm($min){
    $a = array();
    $years = intval(intval($min) / 525600);
    if($years > 0) $array[] = $years . ' year' . ($years == 1 ? '' : 's');
    $monthes = intval(intval($min) / 43200) % 12;
    if($monthes > 0) $array[] = $monthes . ' month' . ($monthes == 1 ?
'' : 'es');
    $weeks = intval(intval($min) / 10080) % 4;
    if($weeks > 0) $array[] = $weeks . ' week' . ($weeks == 1 ? '' : 's');
    $days = intval(intval($min) / 1440) % 7;
    if($days > 0) $array[] = $days . ' day' . ($days == 1 ? '' : 's');
    $hours = intval(intval($min) / 60) % 24;
    if($hours > 0) $array[] = $hours . ' hour' . ($hours == 1 ? '' : 's');
    $minutes = intval($min) % 60;
    if($minutes > 0) $array[] = $minutes . ' minute' . ($minutes == 1 ?
'' : 's');
    return implode($array,', ');
}

--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

attached mail follows:


> The following function converts minutes to years, monthes, weeks, days,
> hours, minutes. For instance, 61 minutes would become "1 hour, one
> minute". Before I use it, I want to make sure there are no stupid
> mistakes. I can't find any, can any of you?
> function min2ymwdhm($min){
> $a = array();
> $years = intval(intval($min) / 525600);
> if($years > 0) $array[] = $years . ' year' . ($years == 1 ? '' : 's');
> $monthes = intval(intval($min) / 43200) % 12;
> if($monthes > 0) $array[] = $monthes . ' month' . ($monthes == 1 ?
> '' : 'es');
> $weeks = intval(intval($min) / 10080) % 4;
> if($weeks > 0) $array[] = $weeks . ' week' . ($weeks == 1 ? '' : 's');
> $days = intval(intval($min) / 1440) % 7;
> if($days > 0) $array[] = $days . ' day' . ($days == 1 ? '' : 's');
> $hours = intval(intval($min) / 60) % 24;
> if($hours > 0) $array[] = $hours . ' hour' . ($hours == 1 ? '' : 's');
> $minutes = intval($min) % 60;
> if($minutes > 0) $array[] = $minutes . ' minute' . ($minutes == 1 ?
> '' : 's');
> return implode($array,', ');
> }
>

Why not just try it?

Alex

attached mail follows:


Already have, and it seems to work fine. Fairly hard to test though,
since the human brain has a hard time converting number of minutes into
years/monthes/weeks/days/hours/minutes.

Alex Earl wrote:

>Why not just try it?
>
>Alex
>
>
>

--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

attached mail follows:


I'm gonna go out on a limb here, but isn't that why the "human brain" made
calculators? ;)

Good luck with the buttons, if you need help let me know. :}

-----Original Message-----
From: Leif K-Brooks [mailto:eurleifbuyer-brokerage.com]
Sent: Friday, June 13, 2003 3:40 PM
To: slideduke-of-earl.com
Cc: php-generallists.php.net
Subject: Re: [PHP] Will this work right?

Already have, and it seems to work fine. Fairly hard to test though,
since the human brain has a hard time converting number of minutes into
years/monthes/weeks/days/hours/minutes.

Alex Earl wrote:

>Why not just try it?
>
>Alex
>
>
>

--
The above message is encrypted with double rot13 encoding. Any unauthorized
attempt to decrypt it will be prosecuted to the full extent of the law.

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

attached mail follows:


Unfortunatley, an equation to do what this script does would be as hard
to come up with, and as likely not to work. That's why I want a second
(human) opinion.

PHP4 Emailer wrote:

>I'm gonna go out on a limb here, but isn't that why the "human brain" made
>calculators? ;)
>
>Good luck with the buttons, if you need help let me know. :)
>

--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

attached mail follows:


I have a mem var $myoutput I would like to pipe it to the input of a
shell_exec command.

I tried shell_exec("command < $myoutput") however this is not quite right.
Anybody have any ideas??

attached mail follows:


Like $myoutput=`command`; ?
"Tim T" <timbwsweb.net> skrev i meddelandet
news:20030613215805.43303.qmailpb1.pair.com...
> I have a mem var $myoutput I would like to pipe it to the input of a
> shell_exec command.
>
> I tried shell_exec("command < $myoutput") however this is not quite
right.
> Anybody have any ideas??
>
>

attached mail follows:


maybe try exec?
$instruction = "$myOutput > command ";
# for piping (as I recall) I used to do the input from the right, but I
don't think that will make a difference
exec ($instruction);

Bobby
exec ("command
"Tim T" <timbwsweb.net> wrote in message
news:20030613215805.43303.qmailpb1.pair.com...
> I have a mem var $myoutput I would like to pipe it to the input of a
> shell_exec command.
>
> I tried shell_exec("command < $myoutput") however this is not quite
right.
> Anybody have any ideas??
>
>

attached mail follows:


Oh, sorry, I missunderstood you... You want $myoutput to be the programs
input, not the output of the program... Hmm... Look into popen(), fputs()
and fclose()...
"Tim T" <timbwsweb.net> skrev i meddelandet
news:20030613215805.43303.qmailpb1.pair.com...
> I have a mem var $myoutput I would like to pipe it to the input of a
> shell_exec command.
>
> I tried shell_exec("command < $myoutput") however this is not quite
right.
> Anybody have any ideas??
>
>

attached mail follows:


If $myoutput is "foo", it will attempt to get input from a file named
"foo". Use "command | $myoutput" instead.

Tim T wrote:

>I have a mem var $myoutput I would like to pipe it to the input of a
>shell_exec command.
>
>I tried shell_exec("command < $myoutput") however this is not quite right.
>Anybody have any ideas??
>
>
>
>
>

--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

attached mail follows:


Ok, last reply from me I think... Must read until I know for sure before I
post...
http://se.php.net/manual/en/function.proc-open.php seems to be just what you
need!

"Tim T" <timbwsweb.net> skrev i meddelandet
news:20030613215805.43303.qmailpb1.pair.com...
> I have a mem var $myoutput I would like to pipe it to the input of a
> shell_exec command.
>
> I tried shell_exec("command < $myoutput") however this is not quite
right.
> Anybody have any ideas??
>
>

attached mail follows:


YYYYYYYEEEEEESSSSSSSS!

Finally - It works!!

I used the following:

$fp = popen("$mycommand", "w+");

fwrite($fp, $myoutput);

Thank you for your assistance. I've been looking at this for 2 days and
nothing was coming to mind!

Again thank you!

Tim

"Dvdmandt" <dvdmandttelia.com> wrote in message
news:20030613223431.71318.qmailpb1.pair.com...
> Ok, last reply from me I think... Must read until I know for sure before I
> post...
> http://se.php.net/manual/en/function.proc-open.php seems to be just what
you
> need!
>
> "Tim T" <timbwsweb.net> skrev i meddelandet
> news:20030613215805.43303.qmailpb1.pair.com...
> > I have a mem var $myoutput I would like to pipe it to the input of a
> > shell_exec command.
> >
> > I tried shell_exec("command < $myoutput") however this is not quite
> right.
> > Anybody have any ideas??
> >
> >
>
>

attached mail follows:


i'm runnig into a random problem of having all the headers being
displayed instead on the actual web page in mozilla, Ie doesn't seem to
suffer from this, when using header("location: www.url.com"); this is
happening randomly. has anybody seen this or have a fix?

-deno

i'm running:

php 4.3.2
apache 1.3.27
redhat 8.0

php is configed with:
'./configure' '--prefix=/usr/local'
'--with-apache=/home/deno/Apachetoolbox-1.5.66/apache_1.3.27'
'--enable-exif' '--enable-track-vars' '--with-calendar=shared'
'--enable-magic-quotes' '--enable-trans-sid' '--enable-wddx'
'--enable-ftp' '--enable-inline-optimization' '--enable-memory-limit'
'--with-mcrypt=/usr/local' '--with-pdflib=/usr/local'
'--with-tiff-dir=/usr' '--with-jpeg-dir=/usr' '--with-zlib-dir=/usr'
'--with-openssl=/usr/local/ssl' '--with-curl=/usr' '--with-dom=/usr'
'--with-zlib-dir=/usr' '--with-pgsql' '--with-ldap'

attached mail follows:


You could always try header("Location: www.url.com"); (uppercase)...
"Deno Vichas" <ifsyncopated.net> skrev i meddelandet
news:20030613225231.82550.qmailpb1.pair.com...
> i'm runnig into a random problem of having all the headers being
> displayed instead on the actual web page in mozilla, Ie doesn't seem to
> suffer from this, when using header("location: www.url.com"); this is
> happening randomly. has anybody seen this or have a fix?
>
> -deno
>
> i'm running:
>
> php 4.3.2
> apache 1.3.27
> redhat 8.0
>
> php is configed with:
> './configure' '--prefix=/usr/local'
> '--with-apache=/home/deno/Apachetoolbox-1.5.66/apache_1.3.27'
> '--enable-exif' '--enable-track-vars' '--with-calendar=shared'
> '--enable-magic-quotes' '--enable-trans-sid' '--enable-wddx'
> '--enable-ftp' '--enable-inline-optimization' '--enable-memory-limit'
> '--with-mcrypt=/usr/local' '--with-pdflib=/usr/local'
> '--with-tiff-dir=/usr' '--with-jpeg-dir=/usr' '--with-zlib-dir=/usr'
> '--with-openssl=/usr/local/ssl' '--with-curl=/usr' '--with-dom=/usr'
> '--with-zlib-dir=/usr' '--with-pgsql' '--with-ldap'
>

attached mail follows:


Im assuming you are running mozilla 1.3.x
Its not a php issue but a mozilla bug, that I've experienced first hand
http://bugzilla.mozilla.org/show_bug.cgi?id=202210

deno vichas wrote:

> i'm runnig into a random problem of having all the headers being
> displayed instead on the actual web page in mozilla, Ie doesn't seem
> to suffer from this, when using header("location: www.url.com"); this
> is happening randomly. has anybody seen this or have a fix?
>
> -deno

attached mail follows:


Just wanted to let everyone else know so they don't waste days trying to
figure it out.
When using fread() on just about anything except for a file, it only
reads one packet at a time.
This means you must fread within a loop to read the bytes you need.
You can no longer pass "$length bytes to be read".

http://bugs.php.net/bug.php?id=24033 for details, which was classified
as Bogus (Wez states this is the expected behavior of PHP, he fails to
recognize that it is not the expected behavior of the developers that
have been using PHP for years)

The little Note: in the documentation was NOT enough of a notice for
such a large change in functionality.

Code like this:

$fp = fopen('http://finance.yahoo.com/quote.php?q=MSFT', 'r');
$data = fread($fp, 100000);

will no longer work, now you must:

$fp = fopen('http://finance.yahoo.com/quote.php?q=MSFT', 'r');
do {
        $_data = fread($fp, 8192);
        if (strlen($_data) == 0) break;
        $data .= $_data;
}

or some other similar looping of your choice.

Hope this helps someone else from wasting days trying to figure out why
their code no longer works.

Bob Silva

attached mail follows:


I read the document 4 times. I understand how it works and now Im excited
about applying this to my application, however Im running into a problem.
Im recieving an error on my page.

I have this in my form.
<input name ="fname" type="text" value=" <?php $HTTP_POST_VARS['fname']; ?>"
/>

and when running, I recieve
Notice: Undefined index: fname

I also used the example from here
http://www.zend.com/zend/spotlight/form-pro-php4.php and I recieved the same
message.

Any Ideas, to help me break through these barriers?

Thanks so much
Dan

----- Original Message -----
From: "Ralph" <ralphnqionline.com>
To: "'Daniel J. Rychlik'" <drychliktcsconsult.com>;
<php-generallists.php.net>
Sent: Friday, June 13, 2003 1:50 AM
Subject: RE: [PHP] $_SESSION as $key=>$value

> Daniel,
>
> Rather than sending them to a new page to validate the form and then
> sending them back if a field is invalid, do the error checking from the
> same script.
>
> Here's an example, a bit simple but just to give you an idea.
>
> For a better explanation, you should read this article which elaborates
> on this method:
>
> http://www.zend.com/zend/spotlight/form-pro-php4.php
>
>
> <?php
>
> if($HTTP_POST_VARS){
>
> // check for required fields
> if(!HTTP_POST_VARS['name'] || !HTTP_POST_VARS['email'])
> $error_message = 'You did not provide all required fields'
> }
>
> // any other error checking you want to do
> ....
> ?>
>
>
> <?php
>
> // if error, print out error message
> if($error_message){
> echo $error_message;
> }
>
> ?>
>
> <FORM METHOD="post" ACTION="<?php echo $PHP_SELF ?>">
> <INPUT TYPE="text" NAME="name" SIZE="20" VALUE="<?php echo
> $HTTP_POST_VARS['name'] ?>">
> <INPUT TYPE="text" NAME="email" SIZE="20" VALUE="<?php echo
> $HTTP_POST_VARS['email'] ?>">
> and so on....
>
> <INPUT TYPE="submit" NAME="process_form" VALUE="Submit">
>
> -----Original Message-----
> From: Daniel J. Rychlik [mailto:drychliktcsconsult.com]
> Sent: Thursday, June 12, 2003 2:40 PM
> To: php-generallists.php.net
> Subject: [PHP] $_SESSION as $key=>$value
>
> Is this valid to iterate over a form variables.?
>
> foreach ($_SESSION as $key=>$value)
>
> and another question, do I need this <form action="scripts/process.php"
> method="post"> in my form?
>
> Im really struggling with $_SESSION. Im trying to program smarter and
> make friendlier applications.
>
> Ive submitted several emails dealing with this function and I apologize
> for beating a dead horse, so to speak.
>
> I have a form with a few form fields. Im working on an error function
> that will take the data that was entered and pass it back to the form so
> that the user will not have to input the data again. If an error is
> found I use the header function to go back to the form. Im having
> trouble with passing back the data. Do I in my form setup a $_GET or
> should I use the $_SESSION to call it. I am also going to setup a few
> css styles that highlight which field was found in error.
>
> Again, I apologize for my lack of vision and maybe a spark of light will
> go off, and I will be able to make some connections to get this done.
>
> Dan
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


I think this may be because you did not include echo in:

value=" <?php echo $HTTP_POST_VARS['fname']; ?>"

so try this:

<input name ="fname" type="text" value=" <?php echo
$HTTP_POST_VARS['fname']; ?>"

-----Original Message-----
From: Daniel J. Rychlik [mailto:drychliktcsconsult.com]
Sent: Friday, June 13, 2003 4:28 PM
To: Ralph; php-generallists.php.net
Subject: Re: [PHP] $_SESSION as $key=>$value

I read the document 4 times. I understand how it works and now Im
excited
about applying this to my application, however Im running into a
problem.
Im recieving an error on my page.

I have this in my form.
<input name ="fname" type="text" value=" <?php $HTTP_POST_VARS['fname'];
?>"
/>

and when running, I recieve
Notice: Undefined index: fname

I also used the example from here
http://www.zend.com/zend/spotlight/form-pro-php4.php and I recieved the
same
message.

Any Ideas, to help me break through these barriers?

Thanks so much
Dan

----- Original Message -----
From: "Ralph" <ralphnqionline.com>
To: "'Daniel J. Rychlik'" <drychliktcsconsult.com>;
<php-generallists.php.net>
Sent: Friday, June 13, 2003 1:50 AM
Subject: RE: [PHP] $_SESSION as $key=>$value

> Daniel,
>
> Rather than sending them to a new page to validate the form and then
> sending them back if a field is invalid, do the error checking from
the
> same script.
>
> Here's an example, a bit simple but just to give you an idea.
>
> For a better explanation, you should read this article which
elaborates
> on this method:
>
> http://www.zend.com/zend/spotlight/form-pro-php4.php
>
>
> <?php
>
> if($HTTP_POST_VARS){
>
> // check for required fields
> if(!HTTP_POST_VARS['name'] || !HTTP_POST_VARS['email'])
> $error_message = 'You did not provide all required fields'
> }
>
> // any other error checking you want to do
> ....
> ?>
>
>
> <?php
>
> // if error, print out error message
> if($error_message){
> echo $error_message;
> }
>
> ?>
>
> <FORM METHOD="post" ACTION="<?php echo $PHP_SELF ?>">
> <INPUT TYPE="text" NAME="name" SIZE="20" VALUE="<?php echo
> $HTTP_POST_VARS['name'] ?>">
> <INPUT TYPE="text" NAME="email" SIZE="20" VALUE="<?php echo
> $HTTP_POST_VARS['email'] ?>">
> and so on....
>
> <INPUT TYPE="submit" NAME="process_form" VALUE="Submit">
>
> -----Original Message-----
> From: Daniel J. Rychlik [mailto:drychliktcsconsult.com]
> Sent: Thursday, June 12, 2003 2:40 PM
> To: php-generallists.php.net
> Subject: [PHP] $_SESSION as $key=>$value
>
> Is this valid to iterate over a form variables.?
>
> foreach ($_SESSION as $key=>$value)
>
> and another question, do I need this <form
action="scripts/process.php"
> method="post"> in my form?
>
> Im really struggling with $_SESSION. Im trying to program smarter and
> make friendlier applications.
>
> Ive submitted several emails dealing with this function and I
apologize
> for beating a dead horse, so to speak.
>
> I have a form with a few form fields. Im working on an error function
> that will take the data that was entered and pass it back to the form
so
> that the user will not have to input the data again. If an error is
> found I use the header function to go back to the form. Im having
> trouble with passing back the data. Do I in my form setup a $_GET or
> should I use the $_SESSION to call it. I am also going to setup a few
> css styles that highlight which field was found in error.
>
> Again, I apologize for my lack of vision and maybe a spark of light
will
> go off, and I will be able to make some connections to get this done.
>
> Dan
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


I tried to echo it as well, I recieved the same message.

----- Original Message -----
From: "Ralph" <ralphnqionline.com>
To: "'Daniel J. Rychlik'" <drychliktcsconsult.com>;
<php-generallists.php.net>
Sent: Friday, June 13, 2003 6:50 PM
Subject: RE: [PHP] $_SESSION as $key=>$value

> I think this may be because you did not include echo in:
>
> value=" <?php echo $HTTP_POST_VARS['fname']; ?>"
>
> so try this:
>
> <input name ="fname" type="text" value=" <?php echo
> $HTTP_POST_VARS['fname']; ?>"
>
>
> -----Original Message-----
> From: Daniel J. Rychlik [mailto:drychliktcsconsult.com]
> Sent: Friday, June 13, 2003 4:28 PM
> To: Ralph; php-generallists.php.net
> Subject: Re: [PHP] $_SESSION as $key=>$value
>
> I read the document 4 times. I understand how it works and now Im
> excited
> about applying this to my application, however Im running into a
> problem.
> Im recieving an error on my page.
>
> I have this in my form.
> <input name ="fname" type="text" value=" <?php $HTTP_POST_VARS['fname'];
> ?>"
> />
>
> and when running, I recieve
> Notice: Undefined index: fname
>
> I also used the example from here
> http://www.zend.com/zend/spotlight/form-pro-php4.php and I recieved the
> same
> message.
>
> Any Ideas, to help me break through these barriers?
>
> Thanks so much
> Dan
>
>
>
> ----- Original Message -----
> From: "Ralph" <ralphnqionline.com>
> To: "'Daniel J. Rychlik'" <drychliktcsconsult.com>;
> <php-generallists.php.net>
> Sent: Friday, June 13, 2003 1:50 AM
> Subject: RE: [PHP] $_SESSION as $key=>$value
>
>
> > Daniel,
> >
> > Rather than sending them to a new page to validate the form and then
> > sending them back if a field is invalid, do the error checking from
> the
> > same script.
> >
> > Here's an example, a bit simple but just to give you an idea.
> >
> > For a better explanation, you should read this article which
> elaborates
> > on this method:
> >
> > http://www.zend.com/zend/spotlight/form-pro-php4.php
> >
> >
> > <?php
> >
> > if($HTTP_POST_VARS){
> >
> > // check for required fields
> > if(!HTTP_POST_VARS['name'] || !HTTP_POST_VARS['email'])
> > $error_message = 'You did not provide all required fields'
> > }
> >
> > // any other error checking you want to do
> > ....
> > ?>
> >
> >
> > <?php
> >
> > // if error, print out error message
> > if($error_message){
> > echo $error_message;
> > }
> >
> > ?>
> >
> > <FORM METHOD="post" ACTION="<?php echo $PHP_SELF ?>">
> > <INPUT TYPE="text" NAME="name" SIZE="20" VALUE="<?php echo
> > $HTTP_POST_VARS['name'] ?>">
> > <INPUT TYPE="text" NAME="email" SIZE="20" VALUE="<?php echo
> > $HTTP_POST_VARS['email'] ?>">
> > and so on....
> >
> > <INPUT TYPE="submit" NAME="process_form" VALUE="Submit">
> >
> > -----Original Message-----
> > From: Daniel J. Rychlik [mailto:drychliktcsconsult.com]
> > Sent: Thursday, June 12, 2003 2:40 PM
> > To: php-generallists.php.net
> > Subject: [PHP] $_SESSION as $key=>$value
> >
> > Is this valid to iterate over a form variables.?