wcf.regNote.message
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 |
session_start(); //oda so
sid=$PHPSESSID;
echo "<a href ...... index.php?link=news&sid=$sid&?!?!?!?!?!??!!?!?!?'>news</a>";
$link='news';
if ($link ==' news') {
include("./main/news.php");
}
if ($link == 'blabla') {
include ("./main/blabla.php");
}
|
This post has been edited 1 times, last edit by "flo" (May 17th 2005, 10:36pm)

|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?
//session_start();
$PHPSESSID = session_start(); //session starten
error_reporting(E_ALL); //alle Fehler anzeigen lassen
include("./main/config/layout.css"); //style aus css datei importieren
include("./main/config/connection.php"); //connection zum sql server herstellen
$_SESSION['Login'] = 'false';
$_SESSION['Logout'] = 'false';
$usrip = $REMOTE_ADDR; //IP des Users speichern
$usrid = $PHPSESSID; //Session ID des Users speichern
//...........usw
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
<?
if ($usrip AND $usrid)
{
echo "<form action='./checklogin.php' method='post'>";
echo "<table border='0' bgcolor='#ffffff' cellpadding='2' cellspacing='0'>";
echo "<tr>";
echo "<td colspan='2'><b>Login:</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td bgcolor='#ffffff' width='100'>Nickname:</td>";
echo "<td bgcolor='#ffffff' ><input type='text' name='nicknamel' size='25'></td>";
echo "</tr>";
echo "<tr>";
echo "<td bgcolor='#ffffff' >Passwort:</td>";
echo "<td bgcolor='#ffffff' ><input type='password' name='passwortl' size='25'></td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan='2'><div align='center'><input type='submit' value='Einloggen'></td>";
echo "</tr>";
echo "</table>";
echo "<input type='hidden' name='id' value='$usrid'>"; //übergeben der session id in der $_POST[];
echo "<input type='hidden' name='ip' value='$usrip'>"; //übergeben der computerip in der $_POST[];
echo "</form>";
echo "<br>";
echo "<B><h3>Falls Sie noch nicht registriert sind, können Sie dies <a href='./index.php?section=registrieren'>hier</a> tun.</B>";
}
else
{
echo "bitte über die <a href='index.php'>Startseite</a> einloggen. Das Loginformular wird von der Startseite aufgerufen.";
}
?>
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
<?
include("./main/config/connection.php");
if (!$link)
{
$link='';
}
if ($nicknamel =='' OR $passwortl=='')
{
echo "du musst schon etwas eingeben, Dummkopf!<br>";
echo "<a href='index.php'>Zurück</a>";
exit();
}
else
{
$cryptpw = md5($passwortl);
$sql_string = "SELECT nr, nick, passwort,aktiviert FROM accounts where nick='$nicknamel' AND passwort='$cryptpw' order by nr";
$result = mysql_db_query($db, $sql_string);
$row=mysql_num_rows($result);
for ($i=0;$i<$row;$i++)
{
$nr=mysql_result($result,$i,"nr");
$nick=mysql_result($result,$i,"nick");
$passwort=mysql_result($result,$i,"passwort");
$aktiviert=mysql_result($result,$i,"aktiviert");
}
if ($row>0)
{
if (!$aktiviert==1)
{
echo "Du musst deinen Account erst über deine emailadresse aktivieren";
echo "<meta http-equiv='refresh' content='2; URL=./index.php'><br>";
echo "mom...";
exit();
}
else
{
$login='true';
$logout='false';
echo "Eingeloggt als: $nick ";
echo "<form action='./main/main.php' method='post'>";
echo "<input type='hidden' name='sid' value='$id'>"; //übergeben der session id in der $_POST[];
echo "<input type='hidden' name='login' value='$login'>"; //übergenen der info login = true
echo "<input type='hidden' name='logout' value='$logout'>"; //übergeben der info logout = false
echo "<input type='submit' value='Zur Übersicht'>"; //Submitbutton... ANDERE IMAGE KOMMT NOCH
echo "</form>";
echo "<br><a href='userchange.php'>Anderer User</a>";
echo "<br><a href='./main/logout/logout.php'>Logout</a>";
if ($login='true' AND $logout='false')
{
$_SESSION['Login'] = 'true';
$_SESSION['Logout'] = 'false';
}
}
}
else
{
echo "Logindaten sind falsch. Bitte <a href='index.php'>Hier</a> neu einloggen.";
}
}
?>
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?
session_start($sid); //session starten
error_reporting(E_ALL); //alle Fehler anzeigen lassen
include("./config/layout.css"); //style aus css datei importieren
include("./config/connection.php");
//connection zum sql server herstellen
if (!$_SESSION['Login'] = 'true')
{
echo "bitte über das <a href='index.php'>Loginformular</a> einloggen";
}
else
{
// HIER KOMMT DER CODE REIN DER ANGEZEIGT WERDEN SOLL!!!
//hat jmd ein professionelleres script?? bitte ma zeign
}
?>
|
|
|
PHP Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
<?
//is needed because else there will be warning about this bug
ini_set("session.bug_compat_42", "0");
session_name("MySessionName");
// this line does .... nene this is the very mystery of all :)
session_start();
// get the variables from the ENV e.g. Session, Cookie, Post or Get
$user = getVar("username", "-1");
$password = getVar("password", "-1");
$logout = getVar("logout", "-1");
// this function authenticates a user with password with the client sql table
function authenticate($user, $pw)
{
global $db;
$db->Select("users", "*",
Array(
Array("sumop"=>"", "field"=>"username", "op"=>"=", "value"=>$user),
Array("sumop"=>"AND", "field"=>"password", "op"=>"=", "value"=>"md5('$pw')")
)
);
return $db->GetRowCount() ? $db->GetNext() : false;
}
function IsAdmin()
{
GLOBAL $userdata;
return $userdata['type'] == "Admin";
}
function IsLoggedIn()
{
return isset($_SESSION["userid"]);
}
if($logout == "logout")
{
// delete the content of the session array
$_SESSION = array();
// remove the cookie for the session
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
// and destroy it
session_destroy();
// and no user and password from now
$user = -1;
$password = -1;
// HIER FEHLER SEITE NOCH REIN!!!! ODER LOGIN FORMULAR.
exit();
}
// didn't we got a user or a password or is the user not authenticated ... so display the login
if($user != -1 && $password != -1 && ($userdata = authenticate($user, $password)))
{
// save the users data in the session
$_SESSION["userid"] = $userdata['userid'];
$_SESSION["username"] = $userdata['username'];
$_SESSION["password"] = $password;
}
else
{
// the user could not be authenticated and the user did not logoff so delete all the stuff
// of this session
$_SESSION = array();
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time() - 42000, '/');
}
session_destroy();
$user = -1;
$password = -1;
// HIER FEHLER SEITE NOCH REIN!!!! ODER LOGIN FORMULAR.
exit();
}
?>
|
