Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    Regular Coder
    Join Date
    Jul 2007
    Location
    FL, USA
    Posts
    153
    Thanks
    13
    Thanked 0 Times in 0 Posts

    problem with php login page and mysql...

    ok...I opted to go the php way, since I couldn't find the pl script, besides it seems easy to configure with php...I've been following this tutorial suggested by somene here http://www.phpeasystep.com/workshopview.php?id=6, everything seems to work fine, only when I click on the "login" button in the main_login.php page it is giving me an error "PHP Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\checklogin.php on line 10" I don't know much about php, but this I know the mysql_connect() function is trying to open the connection to the mysql server, I checked my credentials for opening the connection and they are the ones used when I installed mysql, yet it's not establishing the connection could someone help me with this?
    ohh, and after scanning the host...port 3306 is open so it's listening for connections...

    thanks

    www.pctechtips.org

  • #2
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Can you post the coding for checklogin.php ? I think I use the same one.

  • #3
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,303
    Thanks
    4
    Thanked 204 Times in 201 Posts
    Did you enable the mysql extension in your PHP ini file? Check it for a line that reads:

    Code:
    extension=php_mysql.dll
    The extension directory must also be configured in the ini file. It looks something like:

    Code:
    extension_dir = "d:\php5\ext\"
    Dave .... HostMonster for all of your hosting needs

  • #4
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    djm0219 has a good point...as it looks like you haven't enabled MySQL extension.

    To make your life a little easier, it highly recommend that you make use of WAMP which is a bundle of software applications (Apache, MySQL, PHP, OpenSSL) that comes preconfigured out of the box...and allows you to focus on development etc...

  • #5
    Regular Coder
    Join Date
    Jul 2007
    Location
    FL, USA
    Posts
    153
    Thanks
    13
    Thanked 0 Times in 0 Posts
    ok guys, thanks for all the responses, but before I go any further I think that my php installation is not working, I have created a php file with this code "<? phpinfo(); ?>" to test the install and is now showing anything....

    php is proving to be a pain to install


    www.pctechtips.org

  • #6
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,303
    Thanks
    4
    Thanked 204 Times in 201 Posts
    Take the advice of ess and use WAMP which should make it a lot easier for you.
    Dave .... HostMonster for all of your hosting needs

  • #7
    bdl
    bdl is offline
    Regular Coder
    Join Date
    Apr 2007
    Location
    Camarillo, CA US
    Posts
    590
    Thanks
    4
    Thanked 83 Times in 82 Posts
    ...or just read the directions on the PHP site. Going from IIS to Apache alone should help ease your problems, let alone installing a "WAMP" package (which I recommend staying away from, but to each his/her own).

  • #8
    Regular Coder
    Join Date
    Jul 2007
    Location
    FL, USA
    Posts
    153
    Thanks
    13
    Thanked 0 Times in 0 Posts
    guys I'm confuse about something..... the documentation I'm following says that once you finish the install to put <? phpinfo(); ?>inside a file and save it with the .php extension, I do that but nothing is displayed on the browser, but if I surround the php code with html tags like <html> and <body> tabs then it is displaying the question is do php code needs to be surrounded by html tag in order to be interpreted by the browser or the php code by itself should suffice?

    thanks

    www.pctechtips.org

  • #9
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,303
    Thanks
    4
    Thanked 204 Times in 201 Posts
    If you have IIS configured to use PHP properly only the single line should work. Something is not right with your setup. Using Apache would make your life a bit easier (OK, a lot easier).
    Dave .... HostMonster for all of your hosting needs

  • #10
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,074
    Thanks
    2
    Thanked 320 Times in 312 Posts
    Always use full php opening tags <?php

    The short open tag <? results in non-portable code that only works when the short_open_tag setting is turned on and you won't always have the ability to turn it on.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #11
    Regular Coder
    Join Date
    Jul 2007
    Location
    FL, USA
    Posts
    153
    Thanks
    13
    Thanked 0 Times in 0 Posts
    I've set up php in the past running on apache, I know it's easier, but I wanted to test php among other things on IIS, anyway I finally got it working.... on a side note after following the documentation on php.net/install I wasn't able to get it running, I think there's so much information missing there; I followed this guidehttp://www.peterguy.com/php/install_IIS6.html and it worked just fine, didn't need to troubleshoot anything....

    well now to the next step... trying to get php to talk to mysql

    thanks all

    www.pctechtips.org

  • #12
    Regular Coder
    Join Date
    Jul 2007
    Location
    FL, USA
    Posts
    153
    Thanks
    13
    Thanked 0 Times in 0 Posts
    ok.. got the login page working, now how could I make this application vulnerable to session id?...this is for a project/demo, and it is in a save environment.
    appreciate any inputs or ideas?


    thanks

    www.pctechtips.org

  • #13
    Regular Coder
    Join Date
    Jul 2007
    Location
    FL, USA
    Posts
    153
    Thanks
    13
    Thanked 0 Times in 0 Posts
    someone suggested me turning on the session.use_trans_sid in the php.ini file.... I would like to hear other ideas or comments

    thanks

    www.pctechtips.org

  • #14
    Regular Coder
    Join Date
    Jul 2007
    Location
    FL, USA
    Posts
    153
    Thanks
    13
    Thanked 0 Times in 0 Posts
    ok I just found something, well kind of..... in the same php login app that I was using http://www.phpeasystep.com/workshopview.php?id=6 there's the checklogin.php file and it contains a section to sanitize the application protecting against sql injection, if you comment out that part the app is vulnerable to sql injections like ' OR 'X'='X it log you in as the first user in the table

    thanks

    www.pctechtips.org

  • #15
    Banned
    Join Date
    Jul 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    5

    Nice forum, I really like the skin, looks very sharp and cool.


  •  

    Posting Permissions

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