Page 1 of 1

Random Text can be change to Random javascript

Posted: Fri Sep 28, 2012 8:04 pm
by omani-ghost
Script URL: http://www.phpjunkyard.com/random-text.php
Version of script: 1.0
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:
Hello,

thank you for Random Text script
can any one help me to change this script to be accepted javascript instead of text :mrgreen:
I want to display random javascript code "pop ads :D "

Re: Random Text can be change to Random javascript

Posted: Sat Sep 29, 2012 3:55 pm
by Klemen
Try this:

1. Set $settings['text_from_file'] value to ''

Code: Select all

$settings['text_from_file'] = '';
2. Add Javascript blocks inside $settings['quotes'] variable. Before you do, escape any single quotes with a backslash so instead of ' use \' within the Javascript:

Code: Select all

$settings['quotes'] = array(
'document.write(\'test\')',
'window.open(\'http://www.google.com\')',
);
3. Set display type to 0

Code: Select all

$settings['display_type'] = 0;
4. Call rantext with

Code: Select all

<script language="Javascript" src="http://yoursite.com/rantex.php"></script>