Solved

Transer parameters from one php page to onother

Posted on 2013-06-12
3
170 Views
Last Modified: 2013-06-13
Hi!

Have this php-page

<?php // RAY_EE_login.php
require_once('RAY_EE_config.php');
$table1 = 'Kontroller';
// ACCESS TO THIS PAGE IS TESTED BUT NOT CONTROLLED
if ($uid = access_control(TRUE))
{
   $brukerID = brukerident('xxx');
}
else
{
        header("location: login.php");
	    exit;
}

?>
<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8" />
<title>Test system</title>

</head>

<body>
<link rel="stylesheet" href="default.css">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">


<table summary="Services, or Links box template" class="servicesT" cellspacing="1">
<tr><td colspan="2" class="servHd">Min kontroller</td></tr>
<br><br>
<?php
$result3 = mysql_query("SELECT Navn FROM {$table1} WHERE Bruker_id='{$brukerID}'") or die(mysql_error());
while ($row3 = mysql_fetch_array($result3)){
    $navn = $row3['Navn'];
	$lokk = $row3['Lokasjons_id'];
?>
<tr>
	<td class="servBodL_medborder" ><?php echo $navn; ?></td>
	<td class="servBodL_medborder"><a href="http://www.softkey.no/webtest/side3.php?Navn=<?php echo $navn; ?>&lokk=<?php echo $lokk; ?>&IDENT=<?php echo $brukerID; ?>"><input type="submit" id="GULKN" value=">"></a></td>
</tr>
<?php
}

?>

</table>
<br>
<table summary="Services, or Links box template" class="servicesT" cellspacing="0">
<tr><td colspan="2" class="servHd">Mine åpne kontroller</td></tr>
<?php

$result3 = mysql_query("SELECT Navn FROM {$table1} WHERE status=1 and Bruker_id='{$brukerID}'") or die(mysql_error());
while ($row3 = mysql_fetch_array($result3)){
    $navn = $row3['Navn'];
?>
<tr>
	<td class="servBodL_medborder" ><?php echo $navn; ?></td>
	<td class="servBodL_medborder"><a <input type="submit" id="GULKN" value=">" href="http://www.test.com/newpage.php?ID=20?IDENT=40"></a></td>
</tr>
<?php
}

?>
</table>
<br><br>
<Form method="post" action="logut.php">
<fieldset id="actions">
	<input type="submit" id="LOGIN" value="Logg ut">
</fieldset>
</Form>

</body>
</html>

Open in new window


My probles is that variable $lokk is emty, and i know that in the database
it contains data...

Why is the variable emty ?
0
Comment
Question by:team2005
3 Comments
 
LVL 11

Accepted Solution

by:
Amar Bardoliwala earned 500 total points
ID: 39240637
Hello  team2005,

It seems that in your 'SELECT' query you are only fetching column 'Navn'. Please change you query as following.

$result3 = mysql_query("SELECT Navn, Lokasjons_id FROM {$table1} WHERE Bruker_id='{$brukerID}'") or die(mysql_error());

Hope, this will help you.

Thank you.

Amar.
0
 
LVL 9

Expert Comment

by:TvMpt
ID: 39240642
To help you debug just make var_dump($result3) after mysql query.

Could be a multidemensional array or just empty too
0
 
LVL 2

Author Closing Comment

by:team2005
ID: 39243772
Thanks for help
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now