I have seen sites who has this service. Does anyone have a script for like the main idea is you have a button in the page and when you click it a site shows up in another window. And to get listed as one of the "suprise sites", you have to pay $x for it. Anyone know a script like that?
I'm pretty sure that you can do this with free PHP and Javascripts available on the internet. I did it a few years ago with one of my old sites but that was for testing purposes. Try HotScripts.com and Javascript.Internet.com
I tried looking for it on hotscripts, didn't know what search to do. Ill go browse the php and java section I guess then.
It should just be a simple list with a script that selects from that list (order by rand() limit 1) and does a header() redirect to the new page. it's not hard but why on earth would anyone click on that? Sounds as ridiculous as those stumble type sites where you get served up sites of no interest.
Some people arent as good with php or java etc. as you think. If you don't like the idea, oh well. But I still need the script, so thank you for your post
OK. are you comfortable entering sites into the database directly or do you need an admin section? lets say you have a table called surprise and it has * id (int) * url (varchar 100) * name (varchar 100) on your page you would have <a href='surprise.php'>Visit a random site</a> then in surprise.php <php //initialise the connection to the database if it's not already open $sql = "select `url`, `name` from `surprise` order by rand() limit 1 "; $result = mysql_query($sql) or die( mysql_error(). '<br />' . $sql); $row = mysql_fetch_array($result); echo "<html> <head> <meta http-equiv='refresh' content='0;url={$row['url']}'> </head> <body> <p>We hope you enjoy your surprise visit to <a href='{$row['url']}'>{$row['name']}</a></p> </body> </html>"; ?> Code (markup): and that's it, all done. ofcourse I'd add in a hit counter, number of hits that have been PURCHASED, expiry date all all that stuff
Hey, thanks for the code. Maybe I did it wrong, I made an indexed page with the <a href='surprise.php'>Visit a random site</a> Then in surprise.php I added the code you gave me. Thats all I did... gave me a server error when I clicked the link, sorry clueless about php =|
I wrote it in notepad. I'll have a look tonight and write something more robust. About time I submitted something to www.weberdev.com
final code over at http://www.itamer.com/surprise-me/282/ I've got it demo'd at http://www.top100vbulletin.com Let me know if you get it working.