simple js to php conversion
Posted: Sat Aug 23, 2008 6:16 pm
Hello all. I need some help with converting this javascript to php.
When this button is clicked it shows a random link in the iframe called "main":
Any simple way to eliminate the javascript and get the exact functionality with php code? Thanks a lot.
Code: Select all
var unknownlinks=new Array()
unknownlinks[0]="http://google.com"
unknownlinks[1]="http://yahoo.com"
function unknownlink(){
parent.main.window.location=unknownlinks[Math.floor(Math.random()*unknownlinks.length)]
}
Code: Select all
<input type="button" name="button" value="button" onclick="unknownlink()">