Pass from PHP to Javascript

Jals11

New Member
I have a little problem here, and no tutorials have been of help, since I couldn't find one that was directed at this specific problem.I have 2 hosting accounts, one on a server that supports PHP. And the other on a different server that does not support PHP.SERVER A = PHP Support, andSERVER B = NO PHP Support.On server a I have a php script that generates a random image. And On server b, i have a html file that includes a javascript that calls that php function on server a. But no matter how I do it, it never works.I have the following code to retrieve the result from the php script:\[code\]<script language="javascript" src="http://www.mysite.com/folder/file.php"></script>\[/code\]I know I'm probably missing something, but I've been looking for weeks! But haven't found any information that could explain how this is done. Please help!Thank you :)UPDATEThe PHP script is:\[code\]$theimgs= array ("images/logo.png", "images/logo.png", "images/logo.png", "images/logo.png", "images/logo.png");function doitnow ( $imgs) { $total = count($imgs); $call = rand(0,$total-2); return $imgs[$call];}echo '<a href="http://stackoverflow.com/questions/3649390/index.php" alt="something"><img src="'.doitnow($theimgs).'" alt="something" /></a>';\[/code\]
 
Back
Top