Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2013-06-11
10
Medium Priority
?
242 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 59

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 59

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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 59

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 59

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 59

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 59

Expert Comment

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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article discusses four methods for overlaying images in a container on a web page
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.…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

636 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