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!


Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: My Install File

  1. #11
    Join Date
    Apr 2007
    Location
    england
    Posts
    536
    Tokens
    0

    Default

    Quote Originally Posted by Hitman View Post
    Hi Adam,

    You have things like

    $query = mysql_query(\"select count(*) from petition\");
    $result = mysql_result($query, 0);
    there shouldn't be any \ before " when it's pure PHP. If it's an HTML echo (ie echo "<input type=\"text\"> then there should, but on a query (ie query = mysql_query(\"INSTER INTO......\") there shouldn't be \.

    I'm not sure if it effects the script, but it isn't needed.

    Might be the cause, I really don't know but I do know it doesn't need to be there.

    Good luck mate!

    The reason being is because those things are inside quotation marks, therefore, needing "\"s. If that makes any sense.


    Selling DJ/Habbo layout, more info here.


  2. #12
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    OK, I've lost it im drunk off my head

    I will reply tomorrow wirh a decent reply...

    Just try changing the $_POST["name\"] to $_POST['name']

    Cya tomorrow dude!!

  3. #13
    Join Date
    Apr 2007
    Location
    england
    Posts
    536
    Tokens
    0

    Default

    Quote Originally Posted by Hitman View Post
    OK, I've lost it im drunk off my head

    I will reply tomorrow wirh a decent reply...

    Just try changing the $_POST["name\"] to $_POST['name']

    Cya tomorrow dude!!
    I'll try, thank you! +rep.

    EDIT: I tried, but it still doesn't work.
    Last edited by adamFTW; 15-12-2007 at 12:11 AM.


    Selling DJ/Habbo layout, more info here.


  4. #14
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Right, I'm sober now haha.

    The code is very bad. Why are there random ?>'s and things that are dividing the script up? Also all the \'s before the "'s aren't needed, they're only needed when you're echoing HTML (ie <input type=\"text\">).

    I tried to fix it - it's a big mess though, one error after another.

    Here's what I fixed up if anybody wants to fix it on from there.

    PHP Code:
    <? 
    include "iconfig.php";

    // DO NOT edit the following unless you know what you are doing
    if ($_GET['step'] == '1') {
    $query mysql_query("CREATE TABLE `users` (
      `uid` int(11) NOT NULL AUTO_INCREMENT,
      `username` varchar(50) NOT NULL,
      `password` varchar(500) NOT NULL,
      PRIMARY KEY  (`uid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;"
    );

    $query mysql_query("CREATE TABLE `petition` (
    `id` INT( 20 ) NOT NULL AUTO_INCREMENT ,
    `name` VARCHAR( 30 ) NOT NULL ,
    `other` VARCHAR( 30 ) NOT NULL ,
    `comment` VARCHAR( 200 ) NOT NULL ,
    PRIMARY KEY ( `id` )
    ) ENGINE = MYISAM"
    );

    $query mysql_query("CREATE TABLE `admin` (
    `navigation` TEXT( 10000 ) NOT NULL ,
    `maincontent` TEXT( 10000 ) NOT NULL ,
    `php` TEXT( 10000 ) NOT NULL ,
    `other` TEXT( 10000 ) NOT NULL ,
    `footer` VARCHAR( 10000 ) NOT NULL
    ) ENGINE = MYISAM"
    );

    $query mysql_query("CREATE TABLE `home` (
    `navigation` TEXT( 10000 ) NOT NULL ,
    `maincontent` TEXT( 10000 ) NOT NULL ,
    `php` TEXT( 10000 ) NOT NULL ,
    `other` TEXT( 10000 ) NOT NULL ,
    `footer` TEXT( 10000 ) NOT NULL
    ) ENGINE = MYISAM"
    );

    $query mysql_query("CREATE TABLE `other` (
    `navigation` TEXT( 10000 ) NOT NULL ,
    `maincontent` TEXT( 10000 ) NOT NULL ,
    `php` TEXT( 10000 ) NOT NULL ,
    `other` TEXT( 10000 ) NOT NULL ,
    `footer` TEXT( 10000 ) NOT NULL
    ) ENGINE = MYISAM"
    );

    $query mysql_query("CREATE TABLE `sign` (
    `navigation` TEXT( 10000 ) NOT NULL ,
    `maincontent` TEXT( 10000 ) NOT NULL ,
    `php` TEXT( 10000 ) NOT NULL ,
    `other` TEXT( 10000 ) NOT NULL ,
    `footer` TEXT( 10000 ) NOT NULL
    ) ENGINE = MYISAM"
    );

    $query mysql_query("CREATE TABLE `view` (
    `navigation` TEXT( 10000 ) NOT NULL ,
    `maincontent` TEXT( 10000 ) NOT NULL ,
    `php` TEXT( 10000 ) NOT NULL ,
    `other` TEXT( 10000 ) NOT NULL ,
    `footer` TEXT( 10000 ) NOT NULL
    ) ENGINE = MYISAM"
    );

    $query mysql_query("CREATE TABLE `titles` (
    `home` TEXT( 10000 ) NOT NULL ,
    `sign` TEXT( 10000 ) NOT NULL ,
    `view` TEXT( 10000 ) NOT NULL ,
    `other` TEXT( 10000 ) NOT NULL
    ) ENGINE = MYISAM"
    );

    $query mysql_query("INSERT INTO `admin` (`navigation`, `maincontent`, `php`, `other`, `footer`) VALUES (Home | <a href=\"edit.php\">View + Edit Comments / Other Details</a> | <a href=\"editpage.php\">Edit Pages</a> | <a href=\"editsite.php\">Edit Site Details</a>, Welcome to the administration panel, use the links above to navigate your way through the panel., This is optional PHP, you don't really need it for the admin CP main page., This is where you put any other stuff, you can edit all of this using the Edit Site Pages link., Footer BBZ. Add your copyright etc. here.);");

    $query mysql_query("INSERT INTO `home` (`navigation`, `maincontent`, `php`, `other`, `footer`) VALUES (Home | <a href=\"sign.php\">Sign</a> <a href=\"view.php\">View Entries</a> | <a href=\"other.php\">Other</a>, Welcome! Edit all this text in the admin CP., This is optional PHP, you don't really need it for the main page., This is where you put any other stuff, you can edit all of this using the Edit Site Pages link., Footer BBZ. Add your copyright etc. here.);");

    $query mysql_query("INSERT INTO `sign` (`navigation`, `maincontent`, `php`, `other`, `footer`) VALUES (<a href=\"index.php\">Home</a> | Sign <a href=\"view.php\">View Entries</a> | <a href=\"other.php\">Other</a>, Welcome! Edit all this text in the admin CP. This is NOT where you stick the form, etc.");
        
    // The database
        
    include 'config.php';
        
    // The variables
    $name $_POST["name"];
    $other $_POST["other"];
    $comment $_POST["comment"];
    $ip $_SERVER[REMOTE_ADDR];

    //Those horrible IF's - Form data
    if ($_GET["action"] == "submit")
    {
    if (
    $name == "")
        {
            echo 
    "Whoops! You didn't enter your name.";
            exit;
        }
        
        
    if (
    $comment== "")
        {
            echo 
    "Whoops! You didnt enter a comment.";
            exit;
        }
            
    $name addslashes(htmlspecialchars($name));  
            
    $grade addslashes(htmlspecialchars($grade));
            
    $comment addslashes(htmlspecialchars($comment));
             
    $addpetition mysql_query("INSERT INTO `petition` (`name`, `other`, `comment`, `ip`) VALUES ('$name','$other','$comment', '$ip')"); 
            
        
    // The form details are fine, display text & details
        
    echo "Thank you for signing the petition! Here are the details you submitted: <br />
    Name: 
    $name<br />
    Other: 
    $other<br />
    Your comment: 
    $comment<br />
    <br />
    To view all the signatures, click <a href=\"view.php\">here.</a> To go back to the home page, click <a href=\"index.php\">here.</a>"
    ;
    exit;
    }

    else
    // Display the form
    {
        echo 
    "
    <div align=\"center\">Want Miss Oppedisano to stay at O.L.H? Sign the petition below. Your support is needed.<br />
    <strong>Remember, only sign the petition once!</strong></div><br />
    <br />
    <form action=\"?action=submit\" method=\"post\">
        <div id=\"title\">Name:</div>
        <input type=\"text\" name=\"name\"><br /><br />
        <div id=\"title\">Other (EDIT IN ADMIN CP):</div>
        <input type=\"text\" name=\"other\"><br /><br />
        <div id=\"title\">Comment:</div>
        <style=\"width=\"169\"; height=\"116\"><textarea rows=\"7\" input type=\"text\" name=\"comment\" cols=\"28\"></textarea><br />
        <input type=\"submit\" name=\"submit\" value=\"Sign the petition!\">
        </form>"
    ;
        exit;
        }
        
    ?>, This is where you put any other stuff, you can edit all of this using the Edit Site Pages link., Footer BBZ. Add your copyright etc. here.);");
    exit;
    }

    $query = mysql_query("INSERT INTO `view` (`navigation`, `maincontent`, `php`, `other`, `footer`) VALUES (<a href=\"index.php\">Home</a> | <a href=\"sign.php\">Sign</a> View Entries | <a href=\"other.php\">Other</a>, Welcome! Edit all this text in the admin CP. This is NOT where you stick the form, etc., <?php
      
    //DB connection
      
    include "config.php";
      
      
    // Display number of entries
          
    $query mysql_query("select count(*) from petition");
        
    $result mysql_result($query0);
        echo 
    "We have a total of <strong>$result</strong> signatures!";
      
    ?>
      <?php
    // The database connetcion
    include "config.php";

    $sql "SELECT * FROM petition";
    $check mysql_query("SELECT name, other, comment FROM petition") or die("Sorry, the data couldn't be displayed. Please check back later.");
    // The above variables will be used to check our connection to MySQL.

    while ($display mysql_fetch_array($check)) {

        
    $name $display['name'];
        
    $other $display['other'];
        
    $comment $display['comment'];

        
    // Above are variables defined for our Name, Gradeand Comment.

        
    echo "
    <strong>Name:</strong> 
    $name 
    <br> 
    <strong>Other:</strong> 
    $other
    <br>
    <strong>Comment:</strong><br>
    $comment
    <br>
    ____________________________________________________________<br /><br />
    "
    ;

    }
    ?>This is where you put any other stuff, you can edit all of this using the Edit Site Pages link., Footer BBZ. Add your copyright etc. here.);");

    $query = mysql_query("INSERT INTO `other` (`navigation`, `maincontent`, `php`, `other`, `footer`) VALUES (<a href=\"index.php\">Home</a> | <a href=\"sign.php\">Sign</a> <a href=\"view.php\">View Entries</a> | Other, Welcome! Edit all this text in the admin CP. This is NOT where you stick the form, etc., This is optional PHP, you don't really need it for the other page. But it is other, so add whatever you want here., This is where you put any other stuff, you can edit all of this in the admin CP., Footer BBZ. Add your copyright etc. here.);");

    echo ("Step 1 done! Now, please enter your desired username and password for admin CP.<br />

    <form action=\"?step=2" method=\"post\">
    Username:<br />
    <input type=\"text" name=\"name\"><br />
    Password:<br />
    <input type=\"text" name=\"password\\"><br />
    <input type=\"submit" name=\"start" value=\"Step 2\"></form>");
    };

    $user = ($_POST["username"]);
    $pass = ($_POST["password"]);
    $pass = md5($password);

    elseif ($_GET['step'] == '2') {
    $query = mysql_query("INSERT INTO `users` ( `uid` , `username` , `password` ) VALUES ( NULL, ‘$user’, ‘$pass‘ )");
    };

    else ("Welcome to the erPETITION v0.1 installer! This will add all the necessary databases and codes into your mySQL DB. Before you continue, <strong>please</strong> make sure your database info is correct.
    Host: $db[host] <br>Username: $db[user] <br>Password: $db[pass] <br> Database: $db[name]<br />
    If your database info is incorrect, please go and edit config.php now.<br />
    <form action=\"?step=1" method=\"post\"><input type=\"submit" name=\"start" value=\"Step 1\"></form>");

    ?>
    Current error: The last line (php closing ?>).

  5. #15
    Join Date
    Apr 2007
    Location
    england
    Posts
    536
    Tokens
    0

    Default

    After you closed it, there was still some more PHP code left..?


    Selling DJ/Habbo layout, more info here.


  6. #16
    Join Date
    Jan 2007
    Location
    England, Uk, World, Universe,
    Posts
    1,012
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <? 
    ##WERE GOING TO CONFIGURE SOME VARIABLES !
     
    $installerpagename "installer.php"#CHANGE THIS TO THE NAME OF THE INSTALLER PAGE
    include "iconfig.php";
     
    // DO NOT edit the following unless you know what you are doing
    if ($_GET['step'] == '1') {
    $query mysql_query("CREATE TABLE `users` (
      `uid` int(11) NOT NULL AUTO_INCREMENT,
      `username` varchar(50) NOT NULL,
      `password` varchar(500) NOT NULL,
      PRIMARY KEY  (`uid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;"
    );
     
    $query mysql_query("CREATE TABLE `petition` (
    `id` INT( 20 ) NOT NULL AUTO_INCREMENT ,
    `name` VARCHAR( 30 ) NOT NULL ,
    `other` VARCHAR( 30 ) NOT NULL ,
    `comment` VARCHAR( 200 ) NOT NULL ,
    PRIMARY KEY ( `id` )
    ) ENGINE = MYISAM"
    );
     
    $query mysql_query("CREATE TABLE `admin` (
    `navigation` TEXT( 10000 ) NOT NULL ,
    `maincontent` TEXT( 10000 ) NOT NULL ,
    `php` TEXT( 10000 ) NOT NULL ,
    `other` TEXT( 10000 ) NOT NULL ,
    `footer` VARCHAR( 10000 ) NOT NULL
    ) ENGINE = MYISAM"
    );
     
    $query mysql_query("CREATE TABLE `home` (
    `navigation` TEXT( 10000 ) NOT NULL ,
    `maincontent` TEXT( 10000 ) NOT NULL ,
    `php` TEXT( 10000 ) NOT NULL ,
    `other` TEXT( 10000 ) NOT NULL ,
    `footer` TEXT( 10000 ) NOT NULL
    ) ENGINE = MYISAM"
    );
     
    $query mysql_query("CREATE TABLE `other` (
    `navigation` TEXT( 10000 ) NOT NULL ,
    `maincontent` TEXT( 10000 ) NOT NULL ,
    `php` TEXT( 10000 ) NOT NULL ,
    `other` TEXT( 10000 ) NOT NULL ,
    `footer` TEXT( 10000 ) NOT NULL
    ) ENGINE = MYISAM"
    );
     
    $query mysql_query("CREATE TABLE `sign` (
    `navigation` TEXT( 10000 ) NOT NULL ,
    `maincontent` TEXT( 10000 ) NOT NULL ,
    `php` TEXT( 10000 ) NOT NULL ,
    `other` TEXT( 10000 ) NOT NULL ,
    `footer` TEXT( 10000 ) NOT NULL
    ) ENGINE = MYISAM"
    );
     
    $query mysql_query("CREATE TABLE `view` (
    `navigation` TEXT( 10000 ) NOT NULL ,
    `maincontent` TEXT( 10000 ) NOT NULL ,
    `php` TEXT( 10000 ) NOT NULL ,
    `other` TEXT( 10000 ) NOT NULL ,
    `footer` TEXT( 10000 ) NOT NULL
    ) ENGINE = MYISAM"
    );
     
    $query mysql_query("CREATE TABLE `titles` (
    `home` TEXT( 10000 ) NOT NULL ,
    `sign` TEXT( 10000 ) NOT NULL ,
    `view` TEXT( 10000 ) NOT NULL ,
    `other` TEXT( 10000 ) NOT NULL
    ) ENGINE = MYISAM"
    );
     
    $query mysql_query("INSERT INTO `admin` (`navigation`, `maincontent`, `php`, `other`, `footer`) VALUES (Home | <a href=\"edit.php\">View + Edit Comments / Other Details</a> | <a href=\"editpage.php\">Edit Pages</a> | <a href=\"editsite.php\">Edit Site Details</a>, Welcome to the administration panel, use the links above to navigate your way through the panel., This is optional PHP, you don't really need it for the admin CP main page., This is where you put any other stuff, you can edit all of this using the Edit Site Pages link., Footer BBZ. Add your copyright etc. here.);");
     
    $query mysql_query("INSERT INTO `home` (`navigation`, `maincontent`, `php`, `other`, `footer`) VALUES (Home | <a href=\"sign.php\">Sign</a> <a href=\"view.php\">View Entries</a> | <a href=\"other.php\">Other</a>, Welcome! Edit all this text in the admin CP., This is optional PHP, you don't really need it for the main page., This is where you put any other stuff, you can edit all of this using the Edit Site Pages link., Footer BBZ. Add your copyright etc. here.);");
     
    $query mysql_query("INSERT INTO `sign` (`navigation`, `maincontent`, `php`, `other`, `footer`) VALUES (<a href=\"index.php\">Home</a> | Sign <a href=\"view.php\">View Entries</a> | <a href=\"other.php\">Other</a>, Welcome! Edit all this text in the admin CP. This is NOT where you stick the form, etc.");
        
    // The database
        
    include 'config.php';
     
    // The variables
    $name $_POST["name"];
    $other $_POST["other"];
    $comment $_POST["comment"];
    $ip $_SERVER[REMOTE_ADDR];
     
    //Those horrible IF's - Form data
    if ($_GET["action"] == "submit")
    {
    if (
    $name == "")
        {
            echo 
    "Whoops! You didn't enter your name.";
            exit;
        }
     
     
    if (
    $comment== "")
        {
            echo 
    "Whoops! You didnt enter a comment.";
            exit;
        }
            
    $name addslashes(htmlspecialchars($name));  
            
    $grade addslashes(htmlspecialchars($grade));
            
    $comment addslashes(htmlspecialchars($comment));
             
    $addpetition mysql_query("INSERT INTO `petition` (`name`, `other`, `comment`, `ip`) VALUES ('$name','$other','$comment', '$ip')"); 
     
        
    // The form details are fine, display text & details
        
    echo "Thank you for signing the petition! Here are the details you submitted: <br />
    Name: 
    $name<br />
    Other: 
    $other<br />
    Your comment: 
    $comment<br />
    <br />
    To view all the signatures, click <a href=\"view.php\">here.</a> To go back to the home page, click <a href=\"index.php\">here.</a>"
    ;
    exit;
    }
     
    else
    // Display the form
    {
        echo 
    "
    <div align=\"center\">Want Miss Oppedisano to stay at O.L.H? Sign the petition below. Your support is needed.<br />
    <strong>Remember, only sign the petition once!</strong></div><br />
    <br />
    <form action=\"?action=submit\" method=\"post\">
        <div id=\"title\">Name:</div>
        <input type=\"text\" name=\"name\"><br /><br />
        <div id=\"title\">Other (EDIT IN ADMIN CP):</div>
        <input type=\"text\" name=\"other\"><br /><br />
        <div id=\"title\">Comment:</div>
        <style=\"width=\"169\"; height=\"116\"><textarea rows=\"7\" input type=\"text\" name=\"comment\" cols=\"28\"></textarea><br />
        <input type=\"submit\" name=\"submit\" value=\"Sign the petition!\">
        </form>"
    ;
        exit;
        }
    ##This is where you put any other stuff, you can edit all of this using the
     ##Edit Site Pages link., Footer BBZ. Add your copyright etc. here.);");
    exit;
    }
     
    $query mysql_query("INSERT INTO `view` (`navigation`, `maincontent`, `php`, `other`, `footer`) VALUES (<a href=\"index.php\">Home</a> | <a href=\"sign.php\">Sign</a> View Entries | <a href=\"other.php\">Other</a>, Welcome! Edit all this text in the admin CP. This is NOT where you stick the form, etc., <?php
      //DB connection
      include "
    config.php";
     
      // Display number of entries
          
    $query = mysql_query("select count(*) from petition");
        
    $result = mysql_result($query, 0);
        echo "
    We have a total of <strong>$result</strongsignatures!";
    // The database connetcion
    include "
    config.php";
     
    $sql = "SELECT FROM petition";
    $check = mysql_query("SELECT nameothercomment FROM petition") or die("Sorrythe data couldn't be displayed. Please check back later.");
    // The above variables will be used to check our connection to MySQL.
     
    while ($display = mysql_fetch_array($check)) {
     
        $name = $display['
    name'];
        $other = $display['
    other'];
        $comment = $display['
    comment'];
     
        // Above are variables defined for our Name, Gradeand Comment.
     
        echo "
    <strong>Name:</strong> $name 
    <br> 
    <strong>Other:</strong> $other
    <br>
    <strong>Comment:</strong><br>$comment
    <br>
    ____________________________________________________________<br /><br />
    ";
     
    }
    ##This is where you put any other stuff, you can edit all of this using the 
    ##Edit Site Pages link., Footer BBZ. Add your copyright etc. here.);");
     
    $query = mysql_query("INSERT INTO `other` (`navigation`, `maincontent`, `php`, `other`, `footer`) VALUES (<a href=\"index.php\">Home</a> | <a href=\"sign.php\">Sign</a> <a href=\"view.php\">View Entries</a> | Other, Welcome! Edit all this text in the admin CP. This is NOT where you stick the form, etc., This is optional PHP, you don'
    t really need it for the other pageBut it is otherso add whatever you want here., This is where you put any other stuffyou can edit all of this in the admin CP., Footer BBZAdd your copyright etchere.);");
     
    print ("
    Step 1 CompletePlease Enter your AdminCP Details:\\\\\\n
    <form action=\"$installerpagename?step=2\" method=\"post\">
    Username:
    <input type=\"text\" name=\"name\">\n
    Password:
    <input type=\"text\" name=\"password\"><br />
    <input type=\"submit\" name=\"start\" value=\"Step 2\"></form>"
    );
    };
     
    $user = ($_POST["username"]);
    $pass = ($_POST["password"]);
    $pass md5($password);
     
    elseif (
    $_GET['step'] == '2') {
    $query mysql_query("INSERT INTO `users` ( `uid` , `username` , `password` ) VALUES ( NULL, ‘$user’, ‘$pass‘ )");
    };
     
    else (
    "Welcome to the erPETITION v0.1 installer! This will add all the necessary databases and codes into your mySQL DB. Before you continue, <strong>please</strong> make sure your database info is correct.
    Host: 
    $db[host] <br>Username: $db[user] <br>Password: $db[pass] <br> Database: $db[name]<br />
    If your database info is incorrect, please go and edit config.php now.<br />
    <form action=\"?step=1" 
    method=\"post\"><input type=\"submit" name=\"start" value=\"Step 1\"></form>");
     
    ?>
    Try that
    Last edited by rh4u; 15-12-2007 at 02:29 PM. Reason: Php is annoying.
    my sig ran away,

  7. #17
    Join Date
    Jul 2005
    Posts
    1,653
    Tokens
    50

    Latest Awards:

    Default

    What's the point in doing $query = mysql_query... etc?

    I'm pretty sure that wont actually execute, just take out $query =

  8. #18
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by RYANNNNN View Post
    What's the point in doing $query = mysql_query... etc?

    I'm pretty sure that wont actually execute, just take out $query =
    It does execute, I do it - but it isn't needed, I don't think.

  9. #19
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    It executes, because it's determining the value of the $query value, which is what you're technically telling the script to do.

Page 2 of 2 FirstFirst 12

Posting Permissions

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