Jump to content

one button, 2 links


hanwei

Recommended Posts

hi,

I have 2 accessLvL here. One is Engineer, another one is View. i want those with Engineer rights to go into the page(ticket-details.php), while all those with View rights to go into this page(ticket-details2.php) when the search button is clicked.

so can anyone advise me how to do it? thanks

[sup]
if ($accessLvL == "Engineer")....
else....[/sup]
[code]<form method="post" action="ticket-details.php"
<p align="center">&nbsp;
<input type=text size=18 name="viewTT">
<input type=submit value="Search"</p></form>[/code]
Link to comment
https://forums.phpfreaks.com/topic/26802-one-button-2-links/
Share on other sites

well you could just go.
[code=php:0]
<?php
if($accessLvl == "Engineer"){
$action = "ticket-details.php";
}else{
$action = "ticket-details2.php";
}
?>
<form method="post" action="<?php echo $action; ?>"
<p align="center">&nbsp;
<input type=text size=18 name="viewTT">
<input type=submit value="Search"></p></form>
[/code]

ohh and i your submit button was wrong. you didn't have the closing >
Link to comment
https://forums.phpfreaks.com/topic/26802-one-button-2-links/#findComment-122600
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.