[Dev] TrentCMS [MySQL, Phoenix Compatible]

Page 4 of 5 FirstFirst 12345 LastLast
Results 46 to 60 of 63
  1. #46
    Garry's Mod is addictive! Law is offline
    MemberRank
    Dec 2009 Join Date
    NorwayLocation
    993Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    Too lazy to read everything, but I noticed:
    PHP Code:
                if(isset($_SESSION['M_USER'] = $username;) == "1"
    quite fast.. you did $username; in a if statement.... take away that semi-colon :P

  2. #47
    Creative One. TheEngineer is offline
    MemberRank
    Oct 2011 Join Date
    Your RouterLocation
    500Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    PHP Code:
    <?php
            
    include ('global.php');
                if(isset(
    $_SESSION['M_USER'] = $username;) == "1")
        {
            echo 
    'You are already logged in';
        }
                else
                {
            
                if(isset(
    $_POST['login']))
        {
            
    $username strip_tags(mysql_real_escape_string($_POST['username']));
            
    $password md5($_POST['password']);
                if (empty (
    $username)||empty($password))
        {
            echo 
    'Please enter both fields and try again';
        }
                else
        {
            
    $userQ mysql_query ("SELECT * FROM users WHERE `username` = $username ");
                if (
    mysql_num_rows ($userQ)==0)
        {
            echo 
    'Please enter a valid username and try again';
        }
                else
        {
            
    $userA mysql_fetch_array$userQ );
                if ( 
    $password !== $userA["password"] )
        {
            echo 
    'This user exists but the password is incorrect please try again';
        }
                else
          {
         
    $_SESSION['M_USER'] = $username;
         
    Header("Location: me.php");
         
    define('LOGGED_IN'true);
        }
        }
        }
        }
        }

  3. #48
    prjRev.com Kryptos is offline
    MemberRank
    Feb 2010 Join Date
    Planet EarthLocation
    579Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    Quote Originally Posted by Seano2o6 View Post
    Very nice Luc :)
    Posted via Mobile Device

    Ok, I'm stuck on the login system.

    PHP Code:
    <?php
            
    include ('global.php');
                if(isset(
    $_SESSION['M_USER'] = $username;) == "1"/*Error in this line, replace with: if(isset($_SESSION['M_USER'])) OR if(isset($_SESSION['M_USER']) && $_SESSION['M_USER'] === $username). I'd use the first example, second one is silly. */
        
    {
            echo 
    'You are already logged in';
        }
                else
                {
            
                if(isset(
    $_POST['login']))
        {
            
    $username strip_tags(mysql_real_escape_string($_POST['username']));
            
    $password md5(strip_tags(mysql_real_escape_string($_POST['password'])));
                if (empty (
    $username)||empty($password))
        {
            echo 
    'Please enter both fields and try again';
        }
                else
        {
            
    $userQ mysql_query ("SELECT * FROM users WHERE `username` = '{$username}' ");
                if (
    mysql_num_rows ($userQ)==0)
        {
            echo 
    'Please enter a valid username and try again';
        }
                else
        {
            
    $userA mysql_fetch_array$userQ );
                if ( 
    $password !== $userA["password"] )
        {
            echo 
    'This user exists but the password is incorrect please try again';
        }
                else
          {
         
    $_SESSION['M_USER'] = $username;
         
    Header("Location: me.php");
         
    define('LOGGED_IN'true);
        }
        }
        }
        }
        }
    What is wrong with that?
    I don't think this dev should've been approved. You need to learn before making such a project.

    PS: I edited code, check it out.
    PS2 For noobs: Sorry if anything else won't work, coding in a textbox is weird.
    Last edited by Kryptos; 15-02-12 at 08:22 PM.

  4. #49
    Web Developer Papercup is offline
    MemberRank
    Nov 2009 Join Date
    WalesLocation
    1,607Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    MOD Close thread please, Didn't realise me trying to learn and do something for the community is a bad thing.

  5. #50
    swagggggg Livar is offline
    MemberRank
    Oct 2008 Join Date
    United KingdomLocation
    2,272Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    Quote Originally Posted by Seano2o6 View Post
    MOD Close thread please, Didn't realise me trying to learn and do something for the community is a bad thing.
    Don't be so sarcastic, kryptos was right, I never made a thread for MacroCMS/quoCMS, until I knew I could do it.

    Posted via Windows 8 Hacker Edition

  6. #51
    Valued Member DeaDWiZ is offline
    MemberRank
    Aug 2006 Join Date
    117Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    @Seano2o6 You can enable errors in php.ini to see what's wrong with your code when you get a white page.

  7. #52
    Goin Goin Gone! LHaZze is offline
    MemberRank
    Mar 2011 Join Date
    VirginiaLocation
    695Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    Decent, so far.

  8. #53
    The one and only! Hejula is offline
    MemberRank
    Nov 2008 Join Date
    4,128Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    Quote Originally Posted by PowahAlert View Post
    Don't be so sarcastic, kryptos was right, I never made a thread for MacroCMS/quoCMS, until I knew I could do it.

    Posted via Windows 8 Hacker Edition
    He wanted to make a thread to show people how he is doing, what is wrong with that? He posts a snippet, someone shows him how he could improve a section of code inside that. I see nothing wrong with this, everyone needs to start somewhere.

  9. #54
    prjRev.com Kryptos is offline
    MemberRank
    Feb 2010 Join Date
    Planet EarthLocation
    579Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    Quote Originally Posted by Hejula View Post
    He wanted to make a thread to show people how he is doing, what is wrong with that? He posts a snippet, someone shows him how he could improve a section of code inside that. I see nothing wrong with this, everyone needs to start somewhere.
    He's not asking how it can be better, he's asking what's the error in the code... Developments have to be approved for a reason, so someone who can't even do an if statement correctly doesn't have a development.

  10. #55
    The one and only! Hejula is offline
    MemberRank
    Nov 2008 Join Date
    4,128Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    Quote Originally Posted by Kryptos View Post
    He's not asking how it can be better, he's asking what's the error in the code... Developments have to be approved for a reason, so someone who can't even do an if statement correctly doesn't have a development.
    So you tell him what the error is, and he knows for next time.

  11. #56
    Web Developer Papercup is offline
    MemberRank
    Nov 2009 Join Date
    WalesLocation
    1,607Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    Thanks Hejula for supporting me, I'm resuming it in private development and will just release it eventually.

  12. #57
    Web & Interaction Design Gangnam is offline
    MemberRank
    Dec 2010 Join Date
    Lincoln, UKLocation
    1,983Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    Looks good ;3. My design seems to be used a little more now!

  13. #58
    Apprentice zTriick is offline
    MemberRank
    Dec 2011 Join Date
    20Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    Good luck Sean! I'd be interested in co-developing this with you.

  14. #59
    swagggggg Livar is offline
    MemberRank
    Oct 2008 Join Date
    United KingdomLocation
    2,272Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    Quote Originally Posted by zTriick View Post
    Good luck Sean! I'd be interested in co-developing this with you.
    Your PHP isn't that good either so I suggest you team up.

  15. #60
    Apprentice zTriick is offline
    MemberRank
    Dec 2011 Join Date
    20Posts

    Re: [Dev] TrentCMS [MySQL, Phoenix Compatible]

    Quote Originally Posted by Livar View Post
    Your PHP isn't that good either so I suggest you team up.
    pfft. My PHP is waay better than Sean's. Only reason I am helping him is because I have nothing better to do.




Page 4 of 5 FirstFirst 12345 LastLast

Advertisement