Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2000121

[PHP-DB] Re: [PHP-WIN] Kinda silly question From: Zak Greant (zak <email protected>)
Date: 12/13/00

DEWA wrote:
>Maybe this one is a silly question ...
>
>Could someone teach me about that damn $PHP_SELF ???
>coz until now i can't get it work in anyway .. so i have to make a lot of
pages.
>
>i mean like whenever i wanna use it, it gaves me an error ...

$PHP_SELF is not what is causing your problem. Instead, you are trying to
use a variable ($comp) that has not been defined. This is not usually a
problem with PHP. However, PHP has many different levels of error
reporting. The most strict level of error reporting will complain if a
variable is not set when you use it.

Try doing the two following things:

Change the line that reads:
    if ($comp) {
to
    if (isset ($comp)) {

 - or -

Add this line at the top of your code:
    error_reporting (E_ALL & ~ E_NOTICE);
This will lower the error reporting to a level that is easier for beginners
to deal with.

Good Luck!

 --zak

>ex:
>if ($comp) {
> bla bla bla
>} else {
>echo "<form name='form' action='$PHP_SELF">";
>echo "<input type='text' name='comp'>";
>echo "<input type='submit' value='get it'>";
>echo "</form>";
>
>or
>
>echo "<form name='form' action='$PHP_SELF">";
>echo "<input type='text' name='comp'>";
>echo "<input type='submit' value='get it'>";
>echo "</form>";
>
>print "$comp";
>
>
>It always said that :
>Warning: Undefined variable: comp in c:\homepage\modify.php on line 10

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>