Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 34

Thread: Check this script??? I know its Bad.

  1. #11
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Oh, I see... it looks as though you've copied and pasted the script from somewhere and missed a big chunk off the top.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  2. #12
    Join Date
    Jun 2006
    Posts
    148
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Not quite,
    I wrote it by looking at another script. Some of it was changed, All i want it to do is ask for the db username, Password, And DB and create the tabel.
    Cheap Webhosting At ONE TIME fees! Also offering Scripts, Software, Web Designs, and Graphic Designs. Outstanding Designs and Webhosting!

  3. #13
    Join Date
    Jun 2006
    Posts
    148
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Twey you have any ideaaa on how to fix this???
    Cheap Webhosting At ONE TIME fees! Also offering Scripts, Software, Web Designs, and Graphic Designs. Outstanding Designs and Webhosting!

  4. #14
    Join Date
    Apr 2006
    Posts
    429
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    where is the if part for the
    PHP Code:
    }else{ $muser $_POST['muser']; $mpass $_POST['mpass']; $mdata $_POST['mdata'
    if it exist before the <form></form> script then u should
    PHP Code:
    </form><? } else { 
    // the rest of the code here
    ?>
    i think....

  5. #15
    Join Date
    Jun 2006
    Posts
    148
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Dont see it...
    Cheap Webhosting At ONE TIME fees! Also offering Scripts, Software, Web Designs, and Graphic Designs. Outstanding Designs and Webhosting!

  6. #16
    Join Date
    Apr 2006
    Posts
    429
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    what dont u see?

    the if part for the else clause or what m referring to?

  7. #17
    Join Date
    Jun 2006
    Posts
    148
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I dont see
    Code:
    </form><? } else {  
    // the rest of the code here 
    ?>
    And the if part... Is the if part this?:
    Code:
    if(empty($muser) || empty($mpass) || empty($mdata)){
          Echo"<b>Error:</b> You have some boxes with No info in them, You MUST fill in EVERY BOX!";
          die();
        }
    Cheap Webhosting At ONE TIME fees! Also offering Scripts, Software, Web Designs, and Graphic Designs. Outstanding Designs and Webhosting!

  8. #18
    Join Date
    Apr 2006
    Posts
    429
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    the script should like something like :
    PHP Code:
    <?if (condition) { ?>
    <form method='post' action='install.php?step=1'>
        <table>
        <tr>
          <td>MySQL User:</td>
          <td><input type='text' name='muser' size='20'></td>
        </tr>
        <tr>
          <td>MySQL Password:</td>
          <td><input type='text' name='mpass' size='20'></td>
        </tr>
        <tr>
          <td>MySQL Database:</td>
          <td><input type='text' name='mdata' size='20'></td>
        </tr>
        <tr>
       
         <td>Make sure all the above info is correct.</td>
           
          <td><input type='submit' name='submit' value='Submit'></td>
        </tr>
        </table>
        </form><?
         
    }else{
        
    $muser $_POST['muser']; $mpass $_POST['mpass'];
        
    $mdata $_POST['mdata']; 
        }
        if(empty(
    $muser) || empty($mpass) || empty($mdata) ||{
          Echo
    "<b>Error:</b> You have some boxes with No info in them, You MUST fill in EVERY BOX!";
          die();
        }

    // Connect to Check
        
    mysql_connect ("localhost""$muser""$mpass") or die(mysql_error());
        
    mysql_select_db ("$mdata");

        
    // Create Tables

    mysql_query("CREATE TABLE `request` (
          `Habbo Name` varchar(20) NOT NULL default '',
          `Song Request` varchar(50) NOT NULL default '',
          `Shoutout\Joke` varchar(10) NOT NULL default '',
          PRIMARY KEY  (`Habbo Name`)
        ) TYPE=MyISAM"
    ) or die(mysql_error()); ?>
    dunno how to highlight the correction(s) that i think should be corrected? (redundant huh?)

  9. #19
    Join Date
    Jun 2006
    Posts
    148
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    And what should the condition be, cause i'm stupid...
    Cheap Webhosting At ONE TIME fees! Also offering Scripts, Software, Web Designs, and Graphic Designs. Outstanding Designs and Webhosting!

  10. #20
    Join Date
    Apr 2006
    Posts
    429
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    if that is the case, that if part should be before the else part

Bookmarks

Posting Permissions

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