php changed my life

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JamesK
    hi
    • Jun 2002
    • 16731

    #1

    php changed my life

    <?php

    $noheader=1;

    //require("./global.php");

    set_magic_quotes_runtime(0);

    error_reporting(7);

    // ###################### Start init #######################

    unset($dbservertype);
    unset($debug);

    //load config
    require('./admin/config.php');
    if ($debug != 1) {
    unset($showqueries);
    unset($explain);
    }

    // init db **********************
    // load db class
    $dbservertype = strtolower($dbservertype);
    $dbclassname="./admin/db_$dbservertype.php";
    require($dbclassname);

    $DB_site=new DB_Sql_vb;

    $DB_site->appname='vBulletin';
    $DB_site->appshortname='vBulletin (forum)';
    $DB_site->database=$dbname;
    $DB_site->server=$servername;
    $DB_site->user=$dbusername;
    $DB_site->password=$dbpassword;

    $DB_site->connect();

    $dbpassword="";
    $DB_site->password="";
    // end init db

    if (!empty($userid)) {
    $userid = intval($userid);
    } else if (!empty($HTTP_POST_VARS['userid'])) {
    $userid = intval($HTTP_POST_VARS['userid']);
    } else if (!empty($HTTP_GET_VARS['userid'])) {
    $userid = intval($HTTP_GET_VARS['userid']);
    } else {
    $userid = 0;
    }

    if ($avatarinfo=$DB_site->query_first("SELECT avatardata,dateline,f
    M3Server - NATS Hosting
  • Poo-Chee
    So Fucking Banned
    • Sep 2003
    • 3560

    #2
    very compact life...

    Comment

    • Fonz
      Confirmed User
      • Aug 2003
      • 486

      #3
      don't see how you can order a beer at the bar with that
      hardlinks for sale - ICQ 24298240 - links*at*smilinpussy.com

      Comment

      • SMG
        Confirmed User
        • Aug 2003
        • 1798

        #4
        O_o
        TGP Webmasters: sign up for the top 100 tgp list!
        Submit galleries
        If you add me to icq (title) make sure to mention GFY or I'll think you're a bot and deny you.

        Comment

        • JamesK
          hi
          • Jun 2002
          • 16731

          #5
          Originally posted by SMG
          O_o
          well said
          M3Server - NATS Hosting

          Comment

          • DarkJedi
            No Refunds Issued.
            • Feb 2001
            • 28301

            #6
            OMG !!

            what is that btw ?

            Comment

            • Poo-Chee
              So Fucking Banned
              • Sep 2003
              • 3560

              #7
              Originally posted by DarkJedi
              OMG !!

              what is that btw ?
              php

              Comment

              • who
                So Fucking Banned
                • Aug 2003
                • 19593

                #8
                Originally posted by Poo-Chee


                php
                WOW! That's space age shit!!!!!!!!!!!!!!

                Comment

                • TheFLY
                  So Fucking Banned
                  • Jan 2001
                  • 11856

                  #9
                  I've coded some PHP and I have no idea WTF that does... add some comments... :p

                  Comment

                  • DarkJedi
                    No Refunds Issued.
                    • Feb 2001
                    • 28301

                    #10
                    yes, what does it do ?

                    Comment

                    • badmrfrosty
                      Confirmed User
                      • May 2003
                      • 500

                      #11
                      maybe the reason you dont know what it does is because it doesnt do anything

                      if ($avatarinfo=$DB_site->query_first("SELECT avatardata,dateline,f
                      because it isnt finished...

                      BMF

                      Comment

                      • Nightwork
                        Registered User
                        • Oct 2003
                        • 61

                        #12
                        what's the most "practical" programming language to know for the web?

                        When I was talking about bad programming in the topic above, I referred to trash like this, hehe
                        God may have created the world in 6 days, but you can bet your ass that while he rested on the 7th, a programmer coded it all.<br>ICQ:48322442

                        Comment

                        • JamesK
                          hi
                          • Jun 2002
                          • 16731

                          #13
                          Originally posted by Nightwork
                          what's the most "practical" programming language to know for the web?

                          When I was talking about bad programming in the topic above, I referred to trash like this, hehe
                          how the fuck can you call it trash? I took it from VBulletin, one of the best community scripts ever.
                          M3Server - NATS Hosting

                          Comment

                          • badmrfrosty
                            Confirmed User
                            • May 2003
                            • 500

                            #14
                            vbulletin is the most insecure xss prone script next to phpnuke ;-)

                            yeah its reaaaaaal good, 80% of good hosting compaines will not run vbulletin or phpnuke on their servers because it is nefarious for being shit.

                            BMF

                            Comment

                            • TheViper
                              Confirmed User
                              • Mar 2003
                              • 2560

                              #15
                              Originally posted by Wildcard


                              how the fuck can you call it trash? I took it from VBulletin, one of the best community scripts ever.
                              TRASH

                              Comment

                              • Nightwork
                                Registered User
                                • Oct 2003
                                • 61

                                #16
                                how the fuck can you call it trash? I took it from VBulletin, one of the best community scripts ever.
                                Ok than...
                                First off, it's uncommented. Scripts without proper comments suck by default.

                                The structure is trash. You put includes/requires on top not in the middle of your source. It's all about structure

                                The dbase class (and I even haven't seen it completly)is crap.

                                stuff like:
                                $dbservertype = strtolower($dbservertype);
                                $dbclassname="./admin/db_$dbservertype.php";

                                Are solutions you use when you start programming one month.
                                See adodb for how a good dbasewrappingclass looks like.

                                $DB_site->appname='vBulletin';
                                $DB_site->appshortname='vBulletin (forum)';
                                $DB_site->database=$dbname;
                                $DB_site->server=$servername;
                                $DB_site->user=$dbusername;
                                $DB_site->password=$dbpassword;

                                If you like to type a lot and do things double, go ahead. But this should be one line of code max).

                                if ($debug != 1) {
                                unset($showqueries);
                                unset($explain);
                                }

                                If you use debugging functionallity, write a global debugging function and put it in yr global/config file. And trigger it on seperate ages by simply adjusting a $debug to True or false;

                                Since PHP 4.0.x or something, global_vars are set off by default (for a very, very good security reason)

                                if (!empty($userid)) {
                                $userid = intval($userid);
                                } else if (!empty($HTTP_POST_VARS['userid'])) {
                                $userid = intval($HTTP_POST_VARS['userid']);
                                } else if (!empty($HTTP_GET_VARS['userid'])) {
                                $userid = intval($HTTP_GET_VARS['userid']);
                                } else {
                                $userid = 0;
                                }

                                ifelse loops like above are written by people who apparently have trouble understandig security issues and haven't made up their mind about what they're writing and what it should do in the first place.
                                Besides, you pass values like $userid through sessions not through forms.

                                So that's how the f*ck I call it trash

                                And yeah, I'm just bored, hehe
                                God may have created the world in 6 days, but you can bet your ass that while he rested on the 7th, a programmer coded it all.<br>ICQ:48322442

                                Comment

                                • fris
                                  I have to go potty
                                  • Aug 2002
                                  • 55752

                                  #17
                                  WHILE ($answers < $solutions) {
                                  echo "Not done yet";
                                  $learn++;
                                  }
                                  Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


                                  Totally Free Templates

                                  Comment

                                  • sweet7
                                    Confirmed User
                                    • May 2003
                                    • 1792

                                    #18
                                    Originally posted by TheFLY
                                    I've coded some PHP and I have no idea WTF that does... add some comments... :p
                                    connects to some db's but the code gets cut off so who knows what happens during and after the query.

                                    Looks like it might be a login script.
                                    Needs comments.
                                    ICQ: 282814268

                                    Comment

                                    • KCat
                                      Confirmed User
                                      • Sep 2002
                                      • 2204

                                      #19
                                      Originally posted by fris
                                      WHILE ($answers < $solutions) {
                                      echo "Not done yet";
                                      $learn++;
                                      }

                                      ~ 300+ FHGs, 100,000 pics to use plus a rockin' Video of the Day download! ~

                                      Comment

                                      • TDF
                                        Triple OG nigga on GFY
                                        • Mar 2002
                                        • 27296

                                        #20
                                        geekie tech 101
                                        Sig heil

                                        Comment

                                        Working...