Re: Frst foray into PHP _SELF [message #169979 is a reply to message #169977] |
Sat, 02 October 2010 20:17 |
Twayne
Messages: 135 Registered: September 2010
Karma:
|
Senior Member |
|
|
In news:i87q3a$810$1(at)news(dot)eternal-september(dot)org,
Jerry Stuckle <jstucklex(at)attglobal(dot)net> typed:
> On 10/2/2010 1:07 PM, Twayne wrote:
>> Hi All,
>> Long time no see. Been ill, but back now!
>>
>> Windows XP SP3+, Local XAMPP with Apache, PHP 5.2.5 .
....
>>
>> <form method="post" action="<?php echo $PHP_SELF;?>">
>> ...
>> lots of HTML code
>> ...
>> </form>
>> <? php
>>
>> } else {<---------- My concern is this line considering
>> ...
>>>
>> ==================
>> In other words, I use close PHP tag, do a lot of HTML
>> work, then jump back into PHP and complete the If
>> statement (specifically the ELSE portion). Is there
>> anything wrong with doing that?
>
> Sure, nothing wrong with it at all. But what does this
> question have to do with PHP_SELF?
lol! Well, to this perpetual newbie at least, I suppose you're right if
you're thinking "not much" for an answer. But, if as I've done in the past
using separate php pages to sterilize etc.. my inputs, I guess I just didn't
notice that I'd actually done similar things many times. Changing over to
'htmlentities($_SERVER['PHP_SELF'])' switching over to it created my
confusion. I agree I could have put more thought into the Subject line.
>
>> It's my first try at PHP's _SELF for forms.
....
Why am I
>> doing this? Seems like it would be faster and more
>> efficient. Yes?
>>
>
> Sure, it's not at all uncommon to have html within a PHP
> conditional.
Thanks; that's the specific confirmation I was looking for.
>
> If it's not working, enable all error processing and
> display your errors. And make sure you display the page
> source from your browser to catch any invalid html the
> browser may not be displaying.
Ouch! I should know better. Trying to do too many things at once.
Thanks much,
Twayne`
>
>
....
Regards,
Twayne`
|
|
|