PHP Div ID Update Div Content

OK....This is really doing my head in!!!

Right i have the following

<div id="menu"><a href="Link 2" onClick=document.getElementById('home').href="home.php"
 onmouseover="setOverImg('2','');" onmouseout="setOutImg('2','');" target=""><img src="buttons/button2up.png" border="0" id="button2" vspace="2" hspace="2">
</div>

I have the seperate Div i want to update which is

<div id="home" style="Z-INDEX: 2; POSITION: absolute; TOP: 5px; left: 260px;"><?php include("content.php"); ?></div>

I cannot get this div content to update to show the home.php, please can someone help me put this right as i'm really not understanding why it's not working!

Please can someone tell me how to do an example with the following

Image
Hyperlink
Button

Thanks again
srfcAsked:
Who is Participating?
 
Computer101Commented:
PAQed with points refunded (50)

Computer101
EE Admin
0
 
ncooCommented:
Your missmatching css and php.

PHP is run on the server and CSS/Javascript is run on the client (Firefox, IE).

When the following is sent to the user, the server has already run <?php include("content.php"); ?> so you can't change it.

<div id="home" style="Z-INDEX: 2; POSITION: absolute; TOP: 5px; left: 260px;"><?php include("content.php"); ?></div>

You can though do this to change the div.

<div id="menu"><a href="Link 2" onClick=document.getElementById('home').innerHTML="something else in the div"
 onmouseover="setOverImg('2','');" onmouseout="setOutImg('2','');" target=""><img src="buttons/button2up.png" border="0" id="button2" vspace="2" hspace="2">
</div>
0
 
srfcAuthor Commented:
i have previously changed it before with the onclick process where it has changed the page to another one i just deleted the code by accident!
i think instead of .innerhtml it was .href"page2.php"; or something
0
 
srfcAuthor Commented:
Seeing as no one has replied i worked it out my self and it works a treat
<?php include("Home.php")?> i used this with a link in my menu and the div updates
0
 
lou0999Commented:
Could you give details as to how you fixed your problem, I can't figure out how to do this either, I've been searching for hours now. Show me some code? PLEASE?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.