hi guys
i am in need of a room dropper for my website
any idea how i can do it or if you could make me one
there would be pay (habbo furni) involved and +rep
cheers guys
Printable View
hi guys
i am in need of a room dropper for my website
any idea how i can do it or if you could make me one
there would be pay (habbo furni) involved and +rep
cheers guys
anyone?
Do you mean something like a flash game where you move your furni onto the room?
no i mean a message line where you submit your message and it appears in a scrolling marquee
Hmm ok here is the basic script.. but first make a file called rooms.txt and CHmod to 777
that should work..PHP Code:<?php
$file = file_get_contents("rooms.txt");
$newfile = str_replace("||", " ", $file);
echo "<marquee>$newfile</marquee><br /><br />";
echo "<form name=\"roomdropper\" action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">
Room Name: <input type=\"text\" name=\"roomname\" /><br />
Owner: <input type=\"text\" name=\"owner\" /><br />
<input type=\"submit\" value=\"Submit\" name=\"submit\" /><br />
</form>";
if(isset($_POST['submit'])) {
$roomname = $_POST['roomname'];
$owner = $_POST['owner'];
if((!$owner) or (!$roomname)) {
if(!$roomname) {
echo "No roomname submitted!<br />";
}
if(!$owner) {
echo "No owner submitted!<br />";
}
}
else {
$roomname = stripslashes(strip_tags(htmlspecialchars($roomname, ENT_QUOTES)));
$owner = stripslashes(strip_tags(htmlspecialchars($owner, ENT_QUOTES)));
$string = "$roomname - $owner||";
$fp = fopen("rooms.txt", "a+");
fputs($fp, $string);
fclose($fp);
echo "Room submitted! Thanks!";
}
}
?>
ok so that submits it then how do u make the scrollin marquee
no its all in one script at the top it reads the rooms.txt file and sorts the string and displays it in the <marquee></marquee> tags..
Hey
Thats not bad script. "Hmm thinks of someone to make."
its only the real basics since it was free =] and im cba'ed currently..
www.habboattic.co.uk/roomdropper.php thats where it is but i can only get it to display the submit form how do i make it display the marquee
also it only displays one thats submitted i want a submit form on one page and a seperate scrolling marquee all together that displays more than one room
firstly please copy the script I gave you again because Ive added some changes. also I can see the marquee perfectly well..
UPDATED SCRIPT:
PHP Code:<?php
$file = file_get_contents("rooms.txt");
$newfile = str_replace("||", " ", $file);
echo "<marquee>$newfile</marquee><br /><br />";
echo "<form name=\"roomdropper\" action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">
Room Name: <input type=\"text\" name=\"roomname\" /><br />
Owner: <input type=\"text\" name=\"owner\" /><br />
<input type=\"submit\" value=\"Submit\" name=\"submit\" /><br />
</form>";
if(isset($_POST['submit'])) {
$roomname = $_POST['roomname'];
$owner = $_POST['owner'];
if((!$owner) or (!$roomname)) {
if(!$roomname) {
echo "No roomname submitted!<br />";
}
if(!$owner) {
echo "No owner submitted!<br />";
}
}
else {
$roomname = stripslashes(strip_tags(htmlspecialchars($roomname, ENT_QUOTES)));
$owner = stripslashes(strip_tags(htmlspecialchars($owner, ENT_QUOTES)));
$string = "$roomname - $owner||";
$fp = fopen("rooms.txt", "a+");
fputs($fp, $string);
fclose($fp);
echo "Room submitted! Thanks!";
header("Location: roomdropper.php");
}
}
?>
ok now that keeps all the rooms submitted so far now is there anyway i can split the 2 up so room submitter on one page and the marquee on another?
Just use this:
so to get to the form go toPHP Code:<?php
$show = $_GET['show'];
if($show=="rooms") {
$file = file_get_contents("rooms.txt");
$newfile = str_replace("||", " ", $file);
echo "<marquee>$newfile</marquee><br /><br />";
}
elseif($show=="form") {
echo "<form name=\"roomdropper\" action=\"".$_SERVER['PHP_SELF']."?show=form\" method=\"post\">
Room Name: <input type=\"text\" name=\"roomname\" /><br />
Owner: <input type=\"text\" name=\"owner\" /><br />
<input type=\"submit\" value=\"Submit\" name=\"submit\" /><br />
</form>";
if(isset($_POST['submit'])) {
$roomname = $_POST['roomname'];
$owner = $_POST['owner'];
if((!$owner) or (!$roomname)) {
if(!$roomname) {
echo "No roomname submitted!<br />";
}
if(!$owner) {
echo "No owner submitted!<br />";
}
}
else {
$roomname = stripslashes(strip_tags(htmlspecialchars($roomname, ENT_QUOTES)));
$owner = stripslashes(strip_tags(htmlspecialchars($owner, ENT_QUOTES)));
$string = "$roomname - $owner||";
$fp = fopen("rooms.txt", "a+");
fputs($fp, $string);
fclose($fp);
echo "Room submitted! Thanks!";
header("Location: roomdropper.php");
}
}
}
?>
http://www.habboattic.co.uk/roomdropper.php?show=form
and to go to the marquee go to
http://www.habboattic.co.uk/roomdropper.php?show=rooms
dont work
check it again I updated it. Sorry.
ok that sort of does and doesnt work it gives an error when you hit submit and it adds more information on the actual marquee than given
look for yourself :)
If you mean the test - test bit then that was just me =] as for the error just use this then..
PHP Code:<?php
$show = $_GET['show'];
if($show=="rooms") {
$file = file_get_contents("rooms.txt");
$newfile = str_replace("||", " ", $file);
echo "<marquee>$newfile</marquee><br /><br />";
}
elseif($show=="form") {
echo "<form name=\"roomdropper\" action=\"".$_SERVER['PHP_SELF']."?show=form\" method=\"post\">
Room Name: <input type=\"text\" name=\"roomname\" /><br />
Owner: <input type=\"text\" name=\"owner\" /><br />
<input type=\"submit\" value=\"Submit\" name=\"submit\" /><br />
</form>";
if(isset($_POST['submit'])) {
$roomname = $_POST['roomname'];
$owner = $_POST['owner'];
if((!$owner) or (!$roomname)) {
if(!$roomname) {
echo "No roomname submitted!<br />";
}
if(!$owner) {
echo "No owner submitted!<br />";
}
}
else {
$roomname = stripslashes(strip_tags(htmlspecialchars($roomname, ENT_QUOTES)));
$owner = stripslashes(strip_tags(htmlspecialchars($owner, ENT_QUOTES)));
$string = "Owner: $owner - Roomname: $roomname||";
$fp = fopen("rooms.txt", "a+");
fputs($fp, $string);
fclose($fp);
echo "Room submitted! Thanks!";
}
}
}
?>
anyway we can modify so it says
Owner: owners name - Room: there room
just check above for the modification..
ARG, that would just get totaly pwned. 777 can be edited from any server I think, so people could use html, (redirects ect)Quote:
Originally Posted by Splinter
yep but still im not wasting my time =]
theres a stupid error in it again
because you havent updated the script "/
wow dude stop bugging him, try fix the code your self.Quote:
Originally Posted by Dude2892
www.pixel2life.com
www.techtuts.com
www.codewalkers.com
Once you know the basics...
PHP.net (search functions ect)
Google.com (search functions ect)
Thank you.