http://billedeupload.dk/?v=xInlK.pngDer kan se min filer til siden.
Jeg har også prøve at skrive godkendt.php og den viser også en hvid side.
<table border="0" cellspacing="1px" cellpadding="1px" class="logind_box_system_forside">
<form name="logind_box" method="post" action="/godkendt/">
<tr>
<td><p>Brugernavn</p></td>
<td><input type="text" name="brugernavn"></td>
</tr>
<tr>
<td><p>Passsword</p></td>
<td><input type="password" name="pass"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="Log_ind" value="Log ind"></td>
</tr>
</form>
</table>
Log ind siden jeg har lige skrevet der,
<?php
session_start();
include ("inc/db/db.php");
if($stmt = $mysqli->prepare("SELECT id, brugernavn, rank FROM `bruger` WHERE `brugernavn` = ? AND `password` = ?"))
{
$stmt->bind_param('ss', $brugernavn, $password);
$brugernavn = $_POST["brugernavn"];
$password = sha1($_POST["pass"]);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($id, $brugernavn, $rank);
$stmt->fetch();
$count = $stmt->num_rows;
$stmt->close();
if($count > 0)
{
$_SESSION["logged_in"] = true;
$_SESSION["id"] = $id;
$_SESSION["brugernavn"] = $brugernavn;
$_SESSION["rank"] = $rank;
if($_SESSION["logged_in"] == true)
{
echo "True";
}
else
{
echo "errors, do not send me further";
}
}
else
{
echo "does not fit";
}
}
?>
Det er godkendt side/file
<?php
include ("inc/db/db.php");
if(isset($_POST["godkendt_bruger"]))
{
if($stmt = $mysqli->prepare('SELECT NULL FROM `bruger` WHERE `brugernavn` = ?'))
{
$stmt->bind_param('s', $brugernavn);
$brugernavn = $_POST["brugernavn"];
$stmt->execute();
$stmt->store_result();
$count = $stmt->num_rows;
$stmt->close();
if($count > 0)
{
$user_found = 1;
}
}
if(!isset($user_found))
{
if($_POST["pass"] != $_POST["gentag"])
{
$errors = 1;
echo "<li id=\"check_not\">Angive ens password på siden..</li>";
}
if(empty($_POST["pass"]) && empty($_POST["gentag"]))
{
$errors = 1;
echo "<li id=\"check_not\">Angive et password på siden..</li>";
}
if(empty($_POST["navn"]))
{
$errors = 1;
echo "<li id=\"check_not\">Angive et Fornavn</li>";
}
if(empty($_POST["efternavn"]))
{
$errors = 1;
echo "<li id=\"check_not\">Angive et Efternavn</li>";
}
if(!isset($errors))
{
$pb = null;
include "inc/img/class.upload.php";
$handle = new Upload($_FILES["file"]);
if($handle->uploaded)
{
//lidt mere store billeder
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = 220;
$handle->Process("profil/store");
//til profil billede lign..
$handle->image_resize = true;
$handle->image_ratio_crop = true;
$handle->image_y = 115;
$handle->image_x = 100;
$handle->Process("profil");
//til profil billede lign..
$handle->image_resize = true;
$handle->image_ratio_crop = true;
$handle->image_y = 75;
$handle->image_x = 75;
$handle->Process("profil/lille");
$pb = $handle->file_dst_name;
echo "<li id=\"check_ok\">Dit billede blev upload</li>";
}
else
{
echo "<li id=\"check_not\">Du upload intet billede. Derfor har vi valgt et for dig!.</li>";
$pb = 'users.png';
}
if($stmt = $mysqli->prepare('INSERT INTO `bruger`
(`rank`, `brugernavn`, `password`, `profilbillede`, `navn`, `efternavn`, `alder`)
VALUES (?, ?, ?, ?, ?, ?, ?)'))
{
$stmt->bind_param('issssss', $rank, $brugernavn, $password, $profilbillede, $navn, $efternavn, $alder);
$rank = '1';
$brugernavn = $_POST["brugernavn"];//C
$password = sha1($_POST["pass"]);//C
$profilbillede = $pb;//C
$navn = $_POST["navn"];
$efternavn = $_POST["efternavn"];
$alder = $_POST["alder_1"];
$stmt->execute();
$stmt->close();
echo "<li id=\"check_ok\">Du er blevet opret på siden.</li>";
}
else
{
/* Der er opstået en fejl */
echo 'Der opstod en fejl i erklæringen til ligge i databasen: ' . $mysqli->error;
}
}
}
else
{
echo "<li id=\"check_not\">Dette brugernavn er optaget!!</li>";
}
}
else
{
echo "<li id=\"check_opret\">Indtast dine oplysninger herunder for at opret en bruger </a></li>";
}
?>
</ul>
</div>
<table border="0" cellspacing="0" cellpadding="0">
<form name="opret_bruger" method="post" action="#" enctype="multipart/form-data">
<tr>
<td><p>Brugernavn</p></td>
<td><input type="text" name="brugernavn"></td>
</tr>
<tr>
<td><p>Password</p></td>
<td><input type="password" name="pass"></td>
</tr>
<tr>
<td><p>Password gentag</p></td>
<td><input type="password" name="gentag"></td>
</tr>
<tr>
<td><p>Fornavn</p></td>
<td><input type="text" name="navn"></td>
</tr>
<tr>
<td><p>Efternavn</p></td>
<td><input type="text" name="efternavn"></td>
</tr>
<tr>
<td><p>Alder</p></td>
<td>
<select name="alder_1">
<?php
if ($stmt = $mysqli->prepare('SELECT `alder` FROM `alder`')) {
$stmt->execute();
/* Bind resultatet */
$stmt->bind_result($alder);
/* Hent rækker og udskriv data */
while ($stmt->fetch()) {
?>
<option><?php echo $alder;?></option>
<?php
}
/* Luk statement */
$stmt->close();
} else {
/* Der er opstået en fejl */
echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error;
}
?>
</select>
</td>
</tr>
<tr>
<td><p>Upload Profilbillede</p></td>
<td><input type="file" name="file"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="godkendt_bruger"></td>
</tr>
</form>
det her er min opret side/file