Forum Moderators: coopster
i ve got a javascript code. but i want to use a php function instead of this javascript code. You know, some people block javascripts, due to this reason i would like to use server side coding. However, i could not write a php function yet. Any help would be great for me.
here is my java script code:
<html>
<body>
<table>
<tr>
<td>
<img id="bigImage" src="images/spacer.gif">
<--!
my other contents.
!-->
</td>
</tr>
</table>
<script type="text/javascript">
function LoadImage()
{
if (document.getElementById("bigImage")) {
document.getElementById("bigImage").src="images/big.gif";
}
}
LoadImage();
</script>
</body>
</html>
------------------------
Thank you to all friends
With best regards
This can't be done with PHP since PHP is a server-side script while javascript is a user-side script.
The only thing you can do it to create a script in PHP that parses your HTML and change all "spacer.gif" to "big.gif" using some Regex or str_replace.
OR you could just rename big.gif to spacer.gif :) simpler !