/    Sign up×
Community /Pin to ProfileBookmark

Random re-direct not working

I have tried to use both of these scripts for a random redirect but they both produce the following error. Does anyone see anything wrong with them?

[QUOTE]

Parse error: syntax error, unexpected T_STRING in links-index.php on line 6

[/QUOTE]

[code=php]<?php
$urls = array(“www.site1.com”,
“www.site2.com”,
“www.site3.com”);
$url = $urls[array_rand($urls)];
header(“Location: http://$url”);
?> [/code]

[code=php]
<?php
$sites = array(
‘http://www.google.com/’,
‘http://www.msn.com/’,
‘http://www.yahoo.com/’
)
header(‘Location: ‘.$sites[array_rand($sites)]);
die();
?>[/code]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@gvreMay 21.2011 — $sites = array(

'http://www.google.com/',

'http://www.msn.com/',

'http://www.yahoo.com/'

)[COLOR="Red"][SIZE="2"];[/SIZE][/COLOR]
Copy linkTweet thisAlerts:
@Master00authorMay 21.2011 — Ahh yes, of course! Thanks!
×

Success!

Help @Master00 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...