Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 13th, 2004, 9:51 PM   #1
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
<?php
  $site = (isset($_GET['site'])) ? trim($_GET['site']) : "The forums";
?>
<html>
 <head>
  <title>Your own personal, yet generic welcome message to <?php echo $site; ?></title>
  <script language="javascript" type="text/javascript">
   window.onload = function() {
    var welcomes = new Array(
                 "Welcome, %s, to <?php echo $site; ?>.",
                 "Welcome to <?php echo $site; ?>, %s.",
                 "Hey, %s, enjoy your stay at <?php echo $site; ?>!",
                 "Enjoy posting, %s, at <?php echo $site; ?>.",
                 "Hey, %s, hope you enjoy <?php echo $site; ?>.\n" +
                 "Its the new crack ya know...",
                 "<?php echo $site; ?>, %s, is like a big can of bugspray..."
                );
                // More to come...

    var str = welcomes[Math.floor(Math.random() * welcomes.length)];

    var newStr = " ";

    var name = window.prompt("Hey, whats your tag?", "");

    for(i=0;i<str.length;i++)
      if(str.substr(i, 2) == "%s") {
        newStr += name;
        i++;
      } else newStr += str.charAt(i);

    alert(newStr.substr(1, newStr.length - 1));

    window.close();
   }
  </script>
 </head>
</html>

Couldnt decide wether to put it in JS or PHP, but since it had mroe JS, JS won...
__________________

tempest is offline   Reply With Quote
Old Dec 14th, 2004, 6:58 PM   #2
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
looks good, now you can try to get it to log in as the user and post to the specific thread based on the topic id.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Dec 14th, 2004, 9:41 PM   #3
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
i could write a PHP script to detect new posts in the welcome thread, and then login under my username and make a post everytime there is a new thread... but id rather just post "..." everytime
__________________

tempest is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:56 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC