?
Solved

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

Posted on 2013-06-11
10
Medium Priority
?
241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 58

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 58

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
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 
LVL 58

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
 
LVL 58

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 58

Accepted Solution

by:
Julian Hansen earned 2000 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 58

Expert Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
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…

764 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