Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: Room Dropper

  1. #11
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    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($roomnameENT_QUOTES)));
    $owner stripslashes(strip_tags(htmlspecialchars($ownerENT_QUOTES)));
    $string "$roomname - $owner||";
    $fp fopen("rooms.txt""a+");
    fputs($fp$string);
    fclose($fp);
    echo 
    "Room submitted! Thanks!";
    header("Location: roomdropper.php");
    }
    }
    ?>
    Last edited by Splinter; 16-05-2006 at 03:49 PM.

  2. #12
    Join Date
    Feb 2006
    Location
    Inside your PC
    Posts
    1,626
    Tokens
    0

    Latest Awards:

    Default

    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?

  3. #13
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    Just use this:
    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($roomnameENT_QUOTES)));
    $owner stripslashes(strip_tags(htmlspecialchars($ownerENT_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
    Last edited by Splinter; 16-05-2006 at 03:59 PM.

  4. #14
    Join Date
    Feb 2006
    Location
    Inside your PC
    Posts
    1,626
    Tokens
    0

    Latest Awards:

    Default

    dont work

  5. #15
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    check it again I updated it. Sorry.

  6. #16
    Join Date
    Feb 2006
    Location
    Inside your PC
    Posts
    1,626
    Tokens
    0

    Latest Awards:

    Default

    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

  7. #17
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    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($roomnameENT_QUOTES)));
    $owner stripslashes(strip_tags(htmlspecialchars($ownerENT_QUOTES)));
    $string "Owner: $owner - Roomname: $roomname||";
    $fp fopen("rooms.txt""a+");
    fputs($fp$string);
    fclose($fp);
    echo 
    "Room submitted! Thanks!";
    }
    }
    }
    ?>
    Last edited by Splinter; 16-05-2006 at 04:11 PM.

  8. #18
    Join Date
    Feb 2006
    Location
    Inside your PC
    Posts
    1,626
    Tokens
    0

    Latest Awards:

    Default

    anyway we can modify so it says

    Owner: owners name - Room: there room

  9. #19
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    just check above for the modification..

  10. #20
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Splinter
    Hmm ok here is the basic script.. but first make a file called rooms.txt and CHmod to 777
    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($roomnameENT_QUOTES)));
    $owner stripslashes(strip_tags(htmlspecialchars($ownerENT_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)
    Last edited by Luckyrare; 16-05-2006 at 04:16 PM.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •