Bonjour,
j'ai une page intitulé login.php. Dont j'ai mis le code source en bas de ce post.
J'aimerais envoyer directement l'identification en passant par une adresse de la forme http://www.monsite.com/login.php?username=NIANIA&password=MOTDEPASSE
NIANIA est le nom d'utilisateur et MOTDEPASSE est le mot de passe...
Comment faire ???
Merci d'avance à tout ceux qui se pencheront sur mon problème...
<?
// Load and Start IPB SDK
require_once "ipbsdk_class.inc.php";
$SDK =& new IPBSDK();
if ($_SERVER['REQUEST_METHOD'] == "POST") {
// The form was submitted. Lets authenticate!
$username = $_POST['username'];
$password = $_POST['password'];
if ($SDK->login($username, $password, 1)) {
// The login worked.
?>
<html>
<head>
<title>Login</title>
<style type="text/css">
body {
font-family: Verdana, Helvetica, Arial, Sans-Serif;
}
</style>
</head>
<body>
<p>Login Successful!</p>
</body>
</html>
<?php
}
else {
?>
<html>
<head>
<title>Login</title>
<style type="text/css">
body {
font-family: Verdana, Helvetica, Arial, Sans-Serif;
}
</style>
</head>
<body>
<p>Fatal Error:
<?php
echo $SDK->sdk_error(); // Show the error
?>
</p>
</body>
</html>
<?php
}
}
else {
?>
<html>
<head>
<title>Login</title>
<style type="text/css">
body {
font-family: Verdana, Helvetica, Arial, Sans-Serif;
}
</style>
</head>
<body>
<form action="login.php" method="post">
<table width="100%" border="0" style="width: 100%; text-align: left; background-color: #DFE6EF; color:#000000; padding: 5px; font-family: Verdana; font-size: 10pt;">
<tr><td width="150" style="font-weight: bold;">Username:</td><td><input type="text" name="username" /></td></tr>
<tr><td width="150" style="font-weight: bold;">Password:</td><td><input type="password" name="password" /></td></tr>
</table>
<input type="Submit" value="Login" />
</form>
</body>
</html>
<?php
}
?>