Dear Friends!
i have one page. in this page have 2 text box .(admin.php)
one is for username another one is for password.
if i give username=umapathy,password=india, the control goes to x.php.
what my problem is if i copied the url form the IE ex.http://154.56.45.334/umapathy/x.php and i past it to new ie this page is opening.
i want to restrict this action.
with out user and pass. this page should not be work.
how i want to write coding for this.
if any one knows please answer this
Thanks and Regards
umapthy
Authendication problem
Moderator: General Moderators
-
klarinetking
- Forum Commoner
- Posts: 59
- Joined: Mon Jul 24, 2006 9:43 am
Hi,
Basically, what you want to do is check that form values have been submitted.
$_GET['...'] should be the name of the field of your form, and you use $_GET when the form method is GET, or $_POST when the method is POST.
Hope this helps,
klarinetking
Basically, what you want to do is check that form values have been submitted.
Code: Select all
if ( isset($_GET['username']) )
{
// Form processing here
}
else
{
echo 'You need to enter your information';
}Hope this helps,
klarinetking
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Or, if you'd prefer you can seperate the conditional statement from the actual processing logic by using the php function die() or exit().
For example,
It works the same, but in the end comes to your own personal preference.
For example,
Code: Select all
if (!isset($_POST['form']) ) {
// header("location: form.php");
die();
}
// Form processing logic here