close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Dynamic Menu not working

Thread began 2/29/2016 2:46 pm by Kumel | Last modified 5/10/2016 12:32 pm by Ray Borduin | 601 views | 24 replies |

Kumel

Dynamic Menu not working

I have added a new column called Menu in UserGroup cause in my current project i have different types of users for every different type of user has different menu options.

One of the results in UserGroup column Menu contains php value which is:

<img src="../images/employees/<?php echo $row_UserDetails['Image'];?>" alt="">



The Recordsets are:

<!-- User details -->


<?php
$colname_UserDetails = "-1";
if (isset($_SESSION['SecurityAssist_ID'])) {
$colname_UserDetails = $_SESSION['SecurityAssist_ID'];
}
mysql_select_db($database_con1, $con1);
$query_UserDetails = sprintf("SELECT * FROM Users WHERE ID = %s", GetSQLValueString($colname_UserDetails, "int"));
$UserDetails = mysql_query($query_UserDetails, $con1) or die(mysql_error());
$row_UserDetails = mysql_fetch_assoc($UserDetails);
$totalRows_UserDetails = mysql_num_rows($UserDetails);
?>

<!-- User Type & Menu -->


<?php
mysql_select_db($database_con1, $con1);
$query_UserGroup = "SELECT * FROM UserGroup WHERE ID IN (".$row_UserDetails['UserGroupID'].")";
$UserGroup = mysql_query($query_UserGroup, $con1) or die(mysql_error());
$row_UserGroup = mysql_fetch_assoc($UserGroup);
$totalRows_UserGroup = mysql_num_rows($UserGroup);
?>



Menu is displayed like this: <?php echo $row_UserGroup['TopHeader'];?> (menu)


So to display result of UserDetails['Image'] does not support is it?

Sign in to reply to this post

Ray BorduinWebAssist

The correct syntax is the first one you referenced:

<img src="../images/employees/<?php echo $row_UserDetails['Image'];?>" alt="">



You maybe just need to start the session on the top of the page:

php:
<?php

@session_start();
?>



Try writing the sql statement for that recordset on the page and see if you can spot the problem:
<?php
echo($query_UserDetails);
?>

Sign in to reply to this post

Kumel

When i use

<img src="../images/employees/<?php echo $row_UserDetails['Image'];?>" alt="">



i check on img placeholder doesnt display imge. but link of it is:
http://localhost/**/images/employees/%3C?php%20echo%20$row_UserDetails['Image'];?%3E
it must display: http://localhost/**/images/employees/filename.jpg

<?php
echo($query_UserDetails);
?>
gives: SELECT * FROM Users WHERE ID = 14

The problem is <?php echo $row_UserDetails['Image'];?> this is not display value from recordset. y?

Sign in to reply to this post

Ray BorduinWebAssist

Can I see a copy of the page?

Sign in to reply to this post

Kumel

file attached. copy of db structure of UesrGroup also attached

Attached Files
this1.zip
Sign in to reply to this post

Ray BorduinWebAssist

It looks correct to me. Can I see the live URL where you are having problems? I can't spot an issue in this file.

Sign in to reply to this post

Kumel

its on my local server.

But i feel php eco $row.. values doesn't let you display from mysql if stored like that.

Sign in to reply to this post

Ray BorduinWebAssist

Yes it definitely does let you display code with echo. I've done it hundreds of times. The code you referenced from the page looks like you pasted it into design view instead of code view... but the code on the page you attached looks correct.

Sign in to reply to this post

Kumel

So any solutions or any other way?

Sign in to reply to this post

Ray BorduinWebAssist

I have to work with the page to see what is going on. If you can put it on a live url I can take a look. I don't see any issue with the code you supplied. I may be overlooking something, but I can't imagine what it would be.

If I could view the error on a live site and debug it then I'm sure I could figure it out, but as it is I don't have a solution since I don't see a problem.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...