PDA

View Full Version : Room Dropper



-::Mr.Dave::-
16-05-2006, 07:31 AM
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

-::Mr.Dave::-
16-05-2006, 01:33 PM
anyone?

Sygon.
16-05-2006, 02:17 PM
Do you mean something like a flash game where you move your furni onto the room?

-::Mr.Dave::-
16-05-2006, 02:34 PM
no i mean a message line where you submit your message and it appears in a scrolling marquee

Splinter
16-05-2006, 03:32 PM
Hmm ok here is the basic script.. but first make a file called rooms.txt and CHmod to 777


<?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!";
}
}
?>
that should work..

-::Mr.Dave::-
16-05-2006, 03:33 PM
ok so that submits it then how do u make the scrollin marquee

Splinter
16-05-2006, 03:34 PM
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..

ADAM:
16-05-2006, 03:38 PM
Hey

Thats not bad script. "Hmm thinks of someone to make."

Splinter
16-05-2006, 03:39 PM
its only the real basics since it was free =] and im cba'ed currently..

-::Mr.Dave::-
16-05-2006, 03:45 PM
www.habboattic.co.uk/roomdropper.php (http://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

Splinter
16-05-2006, 03:46 PM
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
$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");
}
}
?>

-::Mr.Dave::-
16-05-2006, 03:51 PM
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?

Splinter
16-05-2006, 03:54 PM
Just use this:


<?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");
}
}
}
?> so to get to the form go to
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

-::Mr.Dave::-
16-05-2006, 03:58 PM
dont work

Splinter
16-05-2006, 03:59 PM
check it again I updated it. Sorry.

-::Mr.Dave::-
16-05-2006, 04:05 PM
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 :)

Splinter
16-05-2006, 04:06 PM
If you mean the test - test bit then that was just me =] as for the error just use this then..


<?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!";
}
}
}
?>

-::Mr.Dave::-
16-05-2006, 04:10 PM
anyway we can modify so it says

Owner: owners name - Room: there room

Splinter
16-05-2006, 04:11 PM
just check above for the modification..

Luckyrare
16-05-2006, 04:15 PM
Hmm ok here is the basic script.. but first make a file called rooms.txt and CHmod to 777


<?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!";
}
}
?>
that should work..
ARG, that would just get totaly pwned. 777 can be edited from any server I think, so people could use html, (redirects ect)

Splinter
16-05-2006, 04:16 PM
yep but still im not wasting my time =]

-::Mr.Dave::-
16-05-2006, 04:18 PM
theres a stupid error in it again

Splinter
16-05-2006, 04:21 PM
because you havent updated the script "/

Luckyrare
16-05-2006, 05:22 PM
theres a stupid error in it again
wow dude stop bugging him, try fix the code your self.

www.pixel2life.com (http://www.pixel2life.com)
www.techtuts.com (http://www.techtuts.com)
www.codewalkers.com
Once you know the basics...

PHP.net (search functions ect)
Google.com (search functions ect)

Thank you.

Want to hide these adverts? Register an account for free!