Toon posts:

volgende pagina

Pagina: 1
Acties:
  • 35 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik heb hier een loginscript met php, maar als ik ingelogd ben dan krijg ik You're authorized!. Nou wil ik dat je automatisch naar de volgende pagina gaat i.p.v dat je het berecht krijgt met You're authorized.

Alvast bedankt!!!



<?php

if (!isset($PHP_AUTH_USER)) {

header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
exit;

} else if (isset($PHP_AUTH_USER)) {

mysql_connect("localhost", "****", "***")
or die ("Unable to connect to database.");

mysql_select_db("oefen")
or die ("Unable to select database.");

$sql = "SELECT * FROM deelnemers WHERE loginnaam='$PHP_AUTH_USER' and pasword='$PHP_AUTH_PW'";

$result = mysql_query($sql);

$num = mysql_numrows($result);

if ($num != "0") {
echo "<P>You're authorized!</p>";
exit;

} else {

header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;

}

}
?>

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 31-08 10:19

D2k

Hoi,
deze thread gaat dicht :)
Dit is makkelijk te vinden via http://www.php.net/functienaam of http://www.php.net/manual/.
Mocht je alsnog tegen een probleem aanlopen ben je welkom om alsnog te posten hier in /14.
functie: header
verder: [topic=397053/1/25]

Doet iets met Cloud (MS/IBM)


Dit topic is gesloten.