Solved

How to solve this, when user click a button..

Posted on 2013-06-11
10
235 Views
Last Modified: 2013-06-12
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">

<Form method="post" action="side3.php">
<table summary="Services, or Links box template" class="servicesT" cellspacing="1">
<tr><td colspan="2" class="servHd">Min kontroller</td></tr>

<?php
echo $q="SELECT Navn FROM {$table1} WHERE Bruker_id={$brukerID}";
$result3 = mysql_query("SELECT Navn FROM {$table1} WHERE 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"><input type="submit" id="GULKN" value=">"></td>
</tr>
<?php
}

?>

</table>
</Form>
<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 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"><input type="submit" id="GULKN" value=">"></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



If user clicks a button:

<?php
echo $q="SELECT Navn FROM {$table1} WHERE Bruker_id={$brukerID}";
$result3 = mysql_query("SELECT Navn FROM {$table1} WHERE 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"><input type="submit" id="GULKN" value=">"></td>
</tr>
<?php
}

Open in new window


When user click the button -> <td class="servBodL_medborder"><input type="submit" id="GULKN" value=">"></td>

It must call another php page with parameters from database.

Example -> http://www.test.com/newpage.php?ID=20?IDENT=40

So if i have 5 records from this kode:
<?php
echo $q="SELECT Navn FROM {$table1} WHERE Bruker_id={$brukerID}";
$result3 = mysql_query("SELECT Navn FROM {$table1} WHERE 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"><input type="submit" id="GULKN" value=">"></td>
</tr>
<?php
}

Open in new window


It wil have 5 different calls like:
 http://www.test.com/newpage.php?ID=20?IDENT=40
 http://www.test.com/newpage.php?ID=22?IDENT=45
 http://www.test.com/newpage.php?ID=28?IDENT=10
 http://www.test.com/newpage.php?ID=66?IDENT=11
 http://www.test.com/newpage.php?ID=77?IDENT=90

How can i solve this ?
0
Comment
Question by:team2005
  • 6
  • 4
10 Comments
 
LVL 52

Expert Comment

by:Julian Hansen
ID: 39238389
Any reason you are making the buttons buttons and not <a> links?

Why not make your buttons <a> and style them to look like a button?
0
 
LVL 2

Author Comment

by:team2005
ID: 39238414
Hi!

How do i style them lock like a button ?
0
 
LVL 52

Expert Comment

by:Julian Hansen
ID: 39238646
Just an example below - you can also use an image as a background - it all depends on how you want the button to look.
a {
 display: block;
 width: 75px;
 line-height: 20px;
 font-size: 14px;
 background: #888;
 color: #fff;
 border: 1px solid #111;
}

Open in new window

0
 
LVL 52

Expert Comment

by:Julian Hansen
ID: 39238665
Or this if you want it to look close to a normal button
a {
	text-decoration: none;
	display: inline-block;
	padding: 0px 10px;
	background: #ddd;
	color: black;
	border-right: 1px solid black;
	border-bottom: 1px solid black;
	border-top: 1px solid white;
	border-left: 1px solid white;
	box-shadow: 1px 1px #999;
	
}

Open in new window

0
 
LVL 2

Author Comment

by:team2005
ID: 39238693
hi!

this wil be 5 buttons, but how to call php page when button is clicked ?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 52

Expert Comment

by:Julian Hansen
ID: 39239121
Like you would any other link ...
<a href="http://www.test.com/newpage.php?ID=20?IDENT=40">Submit</a>

Open in new window

0
 
LVL 2

Author Comment

by:team2005
ID: 39240290
Hi!

How to use that with this line:
<input type="submit" id="GULKN" value=">" >
0
 
LVL 52

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 39240462
That is what I referred to in my earlier post - replace your <input type="submit" ...> with <a> links.
0
 
LVL 2

Author Closing Comment

by:team2005
ID: 39240468
My mistace, thanks for help
0
 
LVL 52

Expert Comment

by:Julian Hansen
ID: 39240655
You are welcome - thanks for the points.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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.…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

867 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

23 Experts available now in Live!

Get 1:1 Help Now