Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Location
    Earth, sometimes...
    Posts
    136
    Tokens
    0

    Default Please help with DJ says.

    Hello,

    On the DJ says tutorial in the 'tutorials' section I followed instructions excactly but i'm still having some problems.

    Parse error: syntax error, unexpected T_STRING in /home/habb0/public_html/HeadHabbo/dbconnect.php on line 3

    Is what it says when I open edit.php

    These are the php files:

    EDIT.PHP

    <?php
    include('dbconnect.php'); $_POST = array_map('strip_tags',$_POST);
    $_POST = array_map('htmlspecialchars',$_POST);
    if (!get_magic_quotes_gpc()) { $_POST = array_map('addslashes',$_POST); }
    if ($_POST[submit]) {
    $message = $_POST[message];
    $ip = $_POST[ip];
    if($message==NULL) {
    echo("You cannot leave your message blank.");
    } else{
    $message = htmlspecialchars($message);
    $ip = htmlspecialchars($ip);
    $query = mysql_query("INSERT INTO message (message, ip) VALUES('$message', '$ip')");
    }
    echo("Your DJ Message was successfully added and should now appear on the homepage.");
    }
    else {
    echo"
    <font size=\"4\">DJ Message/Says</font><br>To create your DJ Message, fill in the TEXT you would like below. HTML, BB Code and PHP have all been protected so you can not use any of those coding characters.<br><br><b>Your IP will be recorded for security reasons.</b><br><br>
    <center>
    <form method=\"POST\">
    <input name=\"ip\" type=\"hidden\" value=\"$_SERVER[REMOTE_ADDR]\">
    <textarea name=\"message\" cols=\"55\" rows=\"10\"></textarea><br>
    <input type=\"submit\" value=\"Submit\" name=\"submit\">
    </form>
    </center>
    ";
    }
    echo" HTML here "; ?>

    dbconnect.php

    <?php
    $connect = mysql_connect("localhost","User","Pass");
    mysql_select_db(DATABASE NAME) or die(mysql_error());
    ?>
    I like a good nap. Sometimes its the only thing getting me up in the morning.


    Selling (un)coded templates, PM me for info


  2. #2

    Default

    correct syntax should be this:
    PHP Code:
    <?php
    $connect 
    mysql_connect('localhost','User','Pass');
    mysql_select_db('poo') or die(mysql_error());
    ?>
    Don't forget to actually put your db info in, lol.

  3. #3
    Join Date
    Mar 2007
    Location
    Earth, sometimes...
    Posts
    136
    Tokens
    0

    Default

    Thanks.

    Lol, I did but I didn't want to show it here.
    I like a good nap. Sometimes its the only thing getting me up in the morning.


    Selling (un)coded templates, PM me for info


Posting Permissions

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