Page 1 of 1

Href doesn't suddenly

Posted: Fri Jul 17, 2009 6:21 am
by binarydream
How can this happen, back from vacation. Update both Xampp and Wamp
Then I can only use href when I'm logged on the webpage
Otherwise it says the page doesn't exist 404

<a href="calc001.php">Count funktionen</a>

Starting page where I have the referrer, href. above
index.php
<?php
session_start(); // Alltid överst på sidan

include "bla/conn.php"; // Databasanslutningen


// Inloggning
if (isset($_POST['submit'])){

$sql = "SELECT col_id, col_user, col_level FROM tbl_user
WHERE col_user='{$_POST['txtuser']}'
AND col_pwd='{$_POST['txtpasswd']}'";
$result = mysql_query($sql);
$rad = mysql_fetch_object($result);


// Hittades inte användarnamn och lösenord
// skicka till formulär med felmeddelande
if (mysql_num_rows($result) == 0){
header("Location: index.php?badlogin=");
exit;
}

// Sätt sessionen med unikt index
$_SESSION['sess_id'] = mysql_result($result, 0);
$_SESSION['sess_user'] = $_POST['txtuser'];
$_SESSION['sess_level'] = $rad->col_level;

header("Location: index.php");
exit;
}

// Utloggning
if (isset($_GET['logout'])){
session_unset();
session_destroy();
header("Location: index.php");
exit;
}

?>


and the page I'm trying to get to
calc001.php
<?php
session_start(); // Alltid överst på sidan

include "bla/conn.php"; // Databasanslutningen

// Kolla om inloggad = sessionen satt
if (!isset($_SESSION['sess_user'])) {
header("Location: index.php");
exit;
}

?>

Re: Href doesn't suddenly

Posted: Fri Jul 17, 2009 4:01 pm
by icesolid
Try using the root leading:

../blah/page.php