Hey All
I have the following code (PHP):
$link = array(
"<ul>
<li><a href="index.html" class="active">Home</a></li>
<li><a href="whatwedo.html">What We Do</a></li>
<li><a href="howitworks.html">How It Works</a></li>
<li><a href="support.html">Support</a></li>
<li><a href="lalalala_hiding_paypal_url_details">Sign Up</a></li>
<li><a href="contact.php">Contact Us</a></li>
</ul>",
"<p>hi</p>",
"<img src="images/illy.png" />",
"<a href="index.html">go to index</a>",
"<h3>blah</h3>",
"<p>yipeeeeeeeee!</p>");
// Choose a random piece.
$i = sizeof($link);
srand((double)microtime()*1000000);
// Show random piece.
$result = $link[rand(0,$i - 1)];
The above is inside a PHP file.
I have another file (HTML File) which includes:
<script type='text/javascript' src='http://website.net/myphpfile.php'>
</script>
And I would like to display in pure javascript the $result of the PHP function where ever the javascript scripts tags are placed.
Is there anyway I can do this easily?
Thank you