Solved

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

Posted on 2013-06-11
10
233 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 51

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 51

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 51

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 51

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 51

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 51

Expert Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…

707 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

15 Experts available now in Live!

Get 1:1 Help Now