You are here: Re: action="<?=$PHP_SELF?>"> « PHP Programming Language « IT news, forums, messages
Re: action="<?=$PHP_SELF?>">

Posted by Erwin Moller on 06/06/07 16:26

zoilus wrote:

> As I often do, I try learning from other peoples work. This script was
> on a site and I thought it interesting. Trying to dig out interesting
> tidbits. I had already put the 'search.php' in it's place but was
> curious as to what and why $PHP_SELF was "Trying to be used" because is
> was not working. This made it more interesting. I looked up what I think
> it was to do but still can not figure out why it is not working.
>
> Anyway.....


Hi Zoilus,

The one and foremost way to debug form-postings (in my humble opinion of
course) is dumping the posting in PHP.

for example: You post a form with method="post" to search.php

then in search.php start with this:

<?php
// dump the post
echo "<pre>";
print_r($_POST);
echo "</pre>";
exit;
?>

I must have typed the sequence of lines a zillion times by now. ;-)

You can do the same with $_GET (for forms that use method="get").
or for cookies: $_COOKIE
or actually for any array you might want to inspect.

Do not forget the <pre>..</pre> because print_r() is nicely formatted only
if you use pre.

Hope that helps.
Regards,
Erwin Moller

>
>
> Erwin Moller wrote:
>
>> zoilus wrote:
>>
>>
>>>Can not determine how "<?=PHP_SELF?>" is supposed to work.
>>>
>>>The below is the line of code.
>>><!-- <form name="search" method="post" action="<?=$PHP_SELF?>"> -->
>>>
>>>When the above statement is run the following is the result.
>>>
>>>You don't have permission to access /dev/forms/forms_testing/< on this
>>>server.
>>
>>
>> Hi,
>>
>> Why make things complicated?
>> Why don't you just fill in the name of the script you want?
>> Don't you know how your script is named?
>>
>> I never understood why people want to use PHP_SELF.
>> :-/
>>
>> Regards,
>> Erwin Moller
>>
>>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация