![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programming Guru
![]() |
<?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...
__________________
|
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
|
|
#3 |
|
Programming Guru
![]() |
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
![]()
__________________
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|