Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi there
I just started learning PHP.
I have created dynamic menu - items in menu are listed from table where I keep those items.
Now I have a problem how to link each menu item with a text it has tu show in main body once I click that item. I read on the internet about onClick event and realized that their should be some workaround. But no luck so far.
Here is my index.php Don't laugh pleaseCode: Select all
<body>
<?php
$mysqli = new mysqli('localhost','root','*****');
$mysqli->select_db('web');
?>
<table class="main" width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="115" colspan="2"><img src="_web_pictures/baneriz.jpg" width="750" height="115"></td>
</tr>
<tr>
<td width="177" height="800">
<table class="top" border="0" cellpadding="0" cellspacing="0" >
<?php
$result = $mysqli->query("select m_name from menu order by eile");
for ($i=1; $i <= mysqli_num_rows($result); $i=$i+1)
{
$row = $result->fetch_array(MYSQLI_ASSOC);
echo "<tr><td class='meniu_mouse_off' onmouseover=\"this.className='meniu_mouse_on'\" onmouseout=\"this.className='meniu_mouse_off'\" [u]onclick=\"\"[/u] width='177' height='30' align='center'><p class='lower'><font face='verdana'><b>"; // <----
echo $row["m_name"];
echo "</p></b></font></tr></td>";
}
?>
</table>
</td>
<td width="633" height="800"><font class="body">[b]Mamamia[/b]</font>
</td>
</tr>
</table>
<?php
$mysqli->close();
?>
</body>I want text to appear where word 'Mamamia' is (bolded).
Thank you for your help in advance! Any comments ant suggestions are welcome! Links too.[/u][/b]
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]