Pages: Previous12
Current Page: 2 of 2
Re: 403 Forbidden - You don't have permission to access / on this server.
Posted by: toumimi (---.100.116-78.rev.gaoland.net)
Date: June 19, 2009 12:26PM

Note that you give an uncrypted password to mysql_connect() function.
It will deal with how password is stored in the database...

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote
Re: 403 Forbidden - You don't have permission to access / on this server.
Posted by: georgebaker (---.cpe.ge-0-2-0-1101.hknqu1.customer.tele.dk)
Date: June 19, 2009 02:07PM

Ohh man, i don't know where to start. Why is PHP and Apache so difficult to get up and running?

I have set privilegier for bob and admin, but after that i fucked up phpMyAdmin cause phpMyAdmin told me to set a password for the root user so i did and now i cannot get in to privilegier :-(

Next.

When i try to login as Bob it wouldn't allow me to do that with "bob" "1234" even though the password in the db show me that the password is "1234"(no encryption)

When i try to login as Admin with "admin" "1234" it logs me in but how can it do that with the password "1234" when it in the db is "81dc9bdb52d04dc20036dbd8313ed055" ?

The code is:
// Connect database.
$host="localhost"; // Host name.
$db_user="admin"; // MySQL username.
//$db_password="81dc9bdb52d04dc20036dbd8313ed055"; // MySQL password.
$db_password="1234"; // MySQL password.
$database="login6"; // Database name.
mysql_connect($host,$db_user,$db_password);
mysql_select_db($database);

// Check matching of username and password.
$result=mysql_query("select * from admin where username='$username' and password='$md5_password'"winking smiley;
if(mysql_num_rows($result)!='0'){ // If match.
session_register("username"winking smiley; // Craete session username.
header("location:main.php"winking smiley; // Re-direct to main.php

Options: ReplyQuote
Re: 403 Forbidden - You don't have permission to access / on this server.
Posted by: georgebaker (---.cpe.ge-0-2-0-1101.hknqu1.customer.tele.dk)
Date: June 19, 2009 02:13PM

Because "81dc9bdb52d04dc20036dbd8313ed055" is the hash of "1234" right? :-)

Options: ReplyQuote
Re: 403 Forbidden - You don't have permission to access / on this server.
Posted by: yfastud (Moderator)
Date: June 19, 2009 02:30PM

download resetmysql here
[downloads.jlbn.net]
to setup password, follow this
[blog.jlbn.net]
to setup db, follow this
[blog.jlbn.net]
and try to setup db w/ these simple info just for test
Username: test
Host: localhost
Pass: 1234
Re-Pass: 1234
DB: test (auto created when follow my guide)
then try w/ this very simple test script
<?php
@ $db = mysql_pconnect('localhost', 'test', '1234');
  
  if (!$db)
  {
     echo 'Error: Could not connect to MySQL';
     exit;
  }
  else
  {
     echo 'Successful connect to MySQL';
  }
  
$useDB = mysql_select_db('test');
 if (!$useDB )
  {
     echo 'Error: Could not open MySQL DB';
     exit;
  }
  else
  {
     echo 'Successful open MySQL DB';
  }
 
?>

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides



Edited 1 time(s). Last edit at 06/19/2009 02:32PM by yfastud.

Options: ReplyQuote
Re: 403 Forbidden - You don't have permission to access / on this server.
Posted by: georgebaker (---.cpe.ge-0-2-0-1101.hknqu1.customer.tele.dk)
Date: June 23, 2009 07:14AM

Successful connect to MySQLSuccessful open MySQL DB :-)

Options: ReplyQuote
Re: 403 Forbidden - You don't have permission to access / on this server.
Posted by: yfastud (Moderator)
Date: June 23, 2009 02:51PM

now you've got idea so you can go back to old script to check what you did wrong winking smiley

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: 403 Forbidden - You don't have permission to access / on this server.
Posted by: georgebaker (---.cpe.ge-0-2-0-1101.hknqu1.customer.tele.dk)
Date: June 23, 2009 02:58PM

Yes.

Thank you for all your help and patience with me.

Also thank you to you Florian as well.

Options: ReplyQuote
Re: 403 Forbidden - You don't have permission to access / on this server.
Posted by: yfastud (Moderator)
Date: June 23, 2009 03:19PM


Options: ReplyQuote
Pages: Previous12
Current Page: 2 of 2


Sorry, only registered users may post in this forum.