php-general Digest 3 Aug 2008 10:57:35 -0000 Issue 5604

Topics (messages 277638 through 277644):

Re: Returning response includes HTML form data
        277638 by: Maciek Sokolewicz
        277639 by: Edward Diener

PHP 5 auto-htmlentitizing strings?
        277640 by: Weston C

Re: Exposing PHP/errors on production vs. dev
        277641 by: Chacha C
        277642 by: Daniel Brown

PHP page completly blank
        277643 by: Alain Roger

dynamic extension
        277644 by: Alain Roger

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Edward Diener wrote:
Benjamin Hawkes-Lewis wrote:
Edward Diener wrote:
Does not the script 'exit' when the PHP code reaches the ending
'?>' tag ?

Not exactly. PHP processes the remainder of the file too, it just doesn't find any PHP code to execute therein. It does find some text to output, and it outputs it. That text happens to be a form.

Now I see. Just like in normal HTML processing a request to a URL which is an HTML page, sends the HTML markup back to the client. My PHP page is a normal HTML page with PHP processing embedded in it. Hit me on the head and wake me up <g>.

How does one stop PHP from outputting data in a PHP file outside of the PHP tags ? Hopefully there is a technique for that. can I just 'exit' in the PHP processing code in order to do that ? It seems that should work and I will try it.
yes, you can do that.

In my case I am using the form data just to process the request and not to be sent back to the client, especially as a form itself is not a complete HTML page.
You could also conditially display it, like so:

<?php
if(isset($_GET['something']) && $_GET['something'] == 'something else') {
   // do something with the data
} else {
   ?>
   <form>...</form>
<?php
}
?>

or perhaps like so, by setting a flag:
<?php
$processed = false;
if(isset($_GET['something']) && $_GET['something'] == 'something else') {
   // do something with the data
   $processed = true;
}

// lots of stuff going on here

if($processed === false) {
?>
   <form>...</form>
<?php
}
?>

--- End Message ---
--- Begin Message ---
Maciek Sokolewicz wrote:
Edward Diener wrote:
Benjamin Hawkes-Lewis wrote:
Edward Diener wrote:
Does not the script 'exit' when the PHP code reaches the ending
'?>' tag ?

Not exactly. PHP processes the remainder of the file too, it just doesn't find any PHP code to execute therein. It does find some text to output, and it outputs it. That text happens to be a form.

Now I see. Just like in normal HTML processing a request to a URL which is an HTML page, sends the HTML markup back to the client. My PHP page is a normal HTML page with PHP processing embedded in it. Hit me on the head and wake me up <g>.

How does one stop PHP from outputting data in a PHP file outside of the PHP tags ? Hopefully there is a technique for that. can I just 'exit' in the PHP processing code in order to do that ? It seems that should work and I will try it.
yes, you can do that.

In my case I am using the form data just to process the request and not to be sent back to the client, especially as a form itself is not a complete HTML page.
You could also conditially display it, like so:

<?php
if(isset($_GET['something']) && $_GET['something'] == 'something else') {
   // do something with the data
} else {
   ?>
   <form>...</form>
<?php
}
?>

or perhaps like so, by setting a flag:
<?php
$processed = false;
if(isset($_GET['something']) && $_GET['something'] == 'something else') {
   // do something with the data
   $processed = true;
}

// lots of stuff going on here

if($processed === false) {
?>
   <form>...</form>
<?php
}
?>

OK, thanks ! In my case I never want to send the form back to the client since it exists only to handle an HTTP POST on the server side.
--- End Message ---
--- Begin Message ---
I just switched over an app from PHP 4 to PHP 5, and one of the weird
things I'm noticing initially is that some of the html output seems to
be html entitized. For example, a link that was showing up in html
output as:

 "<a href="http://metaphilm.com/philm.php?id=29_0_2_0";>Is Tyler Durden
Hobbes?</a>"

now gets transformed to:

&lt;a href="http://metaphilm.com/philm.php?id=29_0_2_0"&gt;Is Tyler
Durden Hobbes&lt;/a&gt;

No other changes in the PHP source -- just a change in the interpreter.

Any idea what could be causing this?

Thanks,

Weston

--- End Message ---
--- Begin Message ---
Somehow .. I feel this isn't PHP Related.

On Sat, Aug 2, 2008 at 11:08 AM, Robert Cummings <[EMAIL PROTECTED]>wrote:

> On Sat, 2008-08-02 at 14:01 -0400, Daniel Brown wrote:
> > On Sat, Aug 2, 2008 at 1:58 PM, Robert Cummings <[EMAIL PROTECTED]>
> wrote:
> > >
> > > Sorry, I hired a profession for the chair throwing-- my bulldog Steve
> > > Ballmer!
> >
> >     More wasteful spending by the Canadian.  You know that he's just
> > going to wind up finding a way to introduce new bugs into the act of
> > domestic violence, right?  Like fear that emits an unpleasant odor or
> > bruises that cause herpes.
>
> Given the goal was to enact violence... I think fear and herpes would
> count as "features"! With respect to wasteful spending... I think you're
> forgetting that the US dollar is on target for devaluation similar to
> that of Zimbabwean currency.
>
> :B
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
http://twit.tv
- What I listen to All Week

--- End Message ---
--- Begin Message ---
On Sun, Aug 3, 2008 at 12:22 AM, Chacha C <[EMAIL PROTECTED]> wrote:
> Somehow .. I feel this isn't PHP Related.

    Boy, nothing gets by you, eh?  Welcome to the list, new meat.

-- 
</Daniel P. Brown>
Better prices on dedicated servers:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

--- End Message ---
--- Begin Message ---
Hi,

i reinstalled on my computer (Win XP) PHP 5.2.4 (but the same happens with
5.2.6).
when i run an index.php page or any other php page which works well before,
now i get a blank page result on my browser without any error message. even
if only HTML code is inside the PHP page nothing is displayed.
it's enough that page as *.php extension to reproduce such issue.

when under command line i run php -v i get a lot of error messages, like
those 2 as attached files.
what can it be ? i've checked those files and they exist. :-(

thanks a lot for your help.

-- 
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

--- End Message ---
--- Begin Message ---
Hi,

i do not see anymore the dynamic extension part in php.ini file, under PHP
5.2.6.
is it normal ?

thx

-- 
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

--- End Message ---

Reply via email to