You are here: Re: to give the link « PHP Programming Language « IT news, forums, messages
Re: to give the link

Posted by shimmyshack on 09/10/07 12:59

On Sep 10, 11:32 am, blesso...@gmail.com wrote:
> hai all,
> I am very new to this php language.I want to create a
> webpage with php ,in the first page there is two text boxes are there
> one for username and other for password so when ever then user should
> give the correct username and password,how should i give link to the
> next page in php.plese help me..

the very simplest way to do this is to have one page with the form

--http://server.com/login.html
<form method="post" action="protected.php">
<input type="text" name="username"/>
<input type="password" name="password"/>
</form>

--protected.php
<?php
$user = 'me';
$pass = 'hello_world';

if( $_POST['username']!=$user || $_POST['password']!=$pass )
{
header( 'http://server.com/login.html' );
exit();
}
else
{
//place your protected page here
}
?>

of course then you would go firther and do what Wewin suggests and use
sessions and pasword encryption and so on....

 

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

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