This topic is locked
[SOLVED]

 Link Path differ by user

3/8/2012 11:05:12 PM
PHPRunner General questions
W
wildwally author

I have a PHP snippet on mty view page that is outputting a table. I have this creating my first column item and wondering if/how I could make this do one thing based on user access, and another if not access allowed.



while($row=db_fetch_array($rs))

{

echo "<tr align='center'>

<td><p><a href='AE_SubTask_view.php?editid1=".$row["ID"]."'>".$row["QRID_num"] ."</a></td>


Of course there is more to this, but I want the link to go to the view page if condition 1, and if condition 2 go to the edit page.

I was thinking this might work, but something is not right.



while($row=db_fetch_array($rs))

{

echo "<tr align='center'>"

IF($_SESSION['AEjc']=='True')

{

"<td><p><a href='AE_SubTask_edit.php?editid1=".$row["ID"]."'>".$row["QRID_num"] ."</a></td>"

}ELSE{

"<td><p><a href='AE_SubTask_view.php?editid1=".$row["ID"]."'>".$row["QRID_num"] ."</a></td>"

}"
C
cgphp 3/9/2012
while($row=db_fetch_array($rs))

{

echo "<tr align='center'>";

if($_SESSION['AEjc']=='True')

{

echo "<td><p><a href='AE_SubTask_edit.php?editid1=".$row["ID"]."'>" . $row["QRID_num"] ."</a></td>";

}

else

{

echo "<td><p><a href='AE_SubTask_view.php?editid1=".$row["ID"]."'>" . $row["QRID_num"] ."</a></td>";

}