Forum Moderators: coopster
echo "<a href=\"buying.php?page=" . urlencode($subject["id"]) .
"\">{$subject["menu_name"]}</a>"; echo"</div>";
I'm not sure how much of that code I need, but all I want is the link, I want it to go in the menu-name div.
$div = '<div class="menu-name"> ' . $row['menu_name'] .'</div><div class="buying-text">';
The link is part of a function from an include file
function public_navigation($sel_subject = null, $sel_page = null) {
$subject_set = get_all_subjects();
// 5. Use returned data
while ($subject = mysql_fetch_array($subject_set)) {
/*----*/
if(!isset($_GET['page'])) {
echo "<div class=\"menu-name\">"; echo "<a href=\"buying.php?page=" . urlencode($subject["id"]) .
"\">{$subject["menu_name"]}</a>"; echo"</div>";
echo "<div class=\"buying-text\">"; echo "{$subject["content"]}"; echo"</div>"; echo "<div class=\"image\">"; echo"</div>";
}//
}
}
$subject = Array();
$subject["id"] = 5;
$subject["menu_name"] = "test";
$subject["content"] = "some content";
echo("<div class=\"menu-name\">");
echo("<a href=\"buying.php?page=" . urlencode($subject["id"]) . "\">{$subject["menu_name"]}</a>"); echo("</div>");
echo "<div class=\"buying-text\">"; echo "{$subject["content"]}"; echo"</div>"; echo "<div class=\"image\">"; echo"</div>";
I get the html equivalent
<div class="menu-name"><a href="buying.php?page=5">test</a></div><div class="buying-text">some content</div><div class="image"></div>