PDA

View Full Version : $PHP_SELF?


pethon
11-06-2006, 05:57 PM
i'm a bit confused. i have a form on my page.

<form name="form1" method="post" action="$PHP_SELF">

is that right? when i click on the submit button on the page, i want it to check the input boxes of the username and password to check if theyre not empty. if they are empty, i want it to echo an error on the page.

im guessing i have to use $_POST['txtUsername']; or something?

but im unsure about the $PHP_SELF

domedia
11-06-2006, 05:59 PM
php_self simply means that the action page for the form is the current (same) page that the form is on.

Didyou look at Ramandeeps tutorial?
http://www.dreamweaverclub.com/dreamweaver-php-form.php

pethon
11-06-2006, 07:07 PM
ok thanks.

and also, if i do: var $username = $_POST['txtUsername'];

do i simply use if (isset($Username)) ?

davidj
11-06-2006, 09:09 PM
yes if your checking that var is set

you can also use (isset($_POST['txtUsername']))