=) that problem got solved =) i had the missing files on a diffrent page.... middle reciever page...:
however i got this problem now:
can someone help me fix this problem?
Here im sending a specific saved_id to a recieving page nr 1 wich is supposed to open 2 windows "target" and so it does then on my recieving page nr 2 im getting the saved_id and can by that way get the row where saved_id is at but when im writing this out to show i only get one letter when its supposed to get 3 letters from my DB(database) and yes ive double checked the DB
my sending page
:code:
Code: Select all
<?php
include "database.php";//Fil för databasinställning.
if (@$_POST["submit"])//Kollar om knappen SUBMIT använts.
{
$sql="SELECT * FROM konto";//Ta allt från databas tabellen: "konto".
$result = mysql_query($sql) or die(mysql_error(FAIL));//Välj all info i tabell.
while($row = mysql_fetch_array( $result ))//Hämtar info från tabell.
{
if ((@$_POST[user]== @$row[user]) && (@$_POST[password]== @$row[pass]) && (@$row[admin] =="1"))//Kollar så att användare finns i databasen och kollar om användaren är admin.
{
header('Refresh: 0; url=../admin/admin_menu(main).php?saved_id='.$row[saved_id]);//Skickas till angiven sida.
}
if ((@$_POST[user]== @$row[user]) && (@$_POST[password]== @$row[pass]) && (@$row[admin] =="0"))//Kollar så att användare finns i databasen och kollar om användaren är admin.
{
header('Refresh: 0; url=../menu_main(menu).php?saved_id='.$row[saved_id]);//Skickas till angiven sida.
}
}
exit;//Lämnar loop.
header("Location: login.php");//Skickas till angiven sida efter en viss tid.
}
?>
recieving page nr 1
:code:
Code: Select all
<html>
<head>
$id =(isset($_GET['saved_id']))
<script type="text/javascript">
parent.main.location.href = "sidor/admin_overview.php?saved_id=<?php echo $_GET['saved_id'] ?>"
parent.menu.location.href = "admin_menu.php?saved_id=<?php echo $_GET['saved_id'] ?>"
</script>
</head>
</html>
<body>
admin overview
</body>
</html>
//recieving page nr 2
:code:
Code: Select all
<?php
include "../login/database.php"; //Fil för databasinställning
$id =(isset($_GET['saved_id'])) ? (int)$_GET['saved_id'] : false;
if($id !== false) {
$sql="SELECT * FROM konto WHERE saved_id=$id";
} else {
echo "NO saved_id!";
}
$result = mysql_query($sql) or die(mysql_error());//Välj all info i tabell. //hämtar all info från tabell
while($row = mysql_fetch_array( $result )) //hämtar info från tabell.
{
$fornamn=$row['fornamn'];
}
?>
//further down after the first php script i got this
// its supposed to write the user name but all i get is [b]a[/b] and the full username is [b]all[/b]
and i dont get why its only writing out one letter instead of all 3 letters... can u help?
user <?php echo $user['user'] ?>
?>
thanks again for all the help
-Thomas
And once more thanks for all the help uve given me