i want to code a php file that allow u to enter pwd to go in to owner tools
Started on the old forum in May 2010 · view the original in the archive · old links redirect here
Start with something simple like this:
$pwd = $_GET["pwd"];
if($pwd!="Enter Your Pass Here"){
print '<form action="ownercp.php?action=$action&sid=$sid" method="get">
Password: <input type="password" name="pwd" maxlength="30"/><br/>
<input type="submit" value="Sumit"/>
</form>';
exit();
}
then add &pwd=$pwd to all your links in ownercp.php
but a better way is to use sessions or cookies saves a lot of coding lol
You could do:
<?php
/**
* @author
* @copyright 2010
*/
$username = $_GET['username'];
$password = $_GET['password'];
if(isset($username) && isset($password)){
if($username == 'myusername' && $password == 'mypass'){
header("LOCATION: myfile.php");
} else {
echo 'Your details were not correct.';
}
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="Nemesis" />
<title>Admincp</title>
</head>
<body>
<form action="" method="GET">
Username<input name="username" type="text" />
Password<input name="password" type="password" />
<input type="submit" name="submit" value="Login" />
</form>
</body>
</html>
<?php } ?>
Just created it real quick, you can change it to function better if you wish. Rename the myusername and mypass to what you want the pass to be.
berty14 wrote: so when i create a php file with that code i have to put it in my ownercp.php?
yep and ownerproc.php and change all your links and forms so t contains &pwd=$pwd
TheNemesis what happens if i goto myfile.php ? and miss out your current page? 😛