# Call javascript function inside PHP

**URL:** <https://forum.kirupa.com/t/call-javascript-function-inside-php/203149>\
**Category:** programming\
**Created:** [October 8, 2006, 10:35am UTC](https://forum.kirupa.com/t/call-javascript-function-inside-php/203149 "2006-10-08T10:35:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NovemberRain](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@NovemberRain](https://forum.kirupa.com/u/NovemberRain)\
**Post date:** [October 8, 2006, 10:35am UTC](https://forum.kirupa.com/t/call-javascript-function-inside-php/203149/1 "2006-10-08T10:35:39Z")

</div>

Hi,  
I’ve a code something like this

\<div id=“middle” class=“clearfix”\>  
\<div id=“splash”\>\<a title="\<?php bloginfo(‘name’); ?\>" href="\<?php bloginfo(‘url’); ?\>"\>\<img src="[[COLOR=red]http://www.walkingshadow.in/wp-content/themes/default/images/splash.gif[/COLOR]](http://www.walkingshadow.in/wp-content/themes/default/images/splash.gif)" width=“568” height=“118” border=“0” alt="\<?php bloginfo(‘description’); ?\>"/\>\</a\>\</div\>  
\<?php get\_sidebar(); ?\>  
\<div id=“content”\>

Don’t look at the details of the code. I simply need to call a javascript function [COLOR=red]showImage();[/COLOR] instead of the red color text to rotate (showing different images on each refresh) the image. Javascipt is on top of the page and that return all values correctly. But my code is not working.

Any help will really appreciable.
