Solved

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

Posted on 2013-06-11
10
236 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 54

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 54

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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 54

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 54

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 54

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 54

Expert Comment

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

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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 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…
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…

770 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