Random Text can be change to Random javascript

In case you have problems with some other PHPJunkyard script (not that there are THAT many).
Post Reply
omani-ghost
Posts: 1
Joined: Fri Sep 28, 2012 7:57 pm

Random Text can be change to Random javascript

Post 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 "
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: Random Text can be change to Random javascript

Post 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>
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply