Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Transer parameters from one php page to onother

Posted on 2013-06-12
3
Medium Priority
?
183 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 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

926 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