
phpstuff
Members-
Content Count
107 -
Joined
-
Last visited
Community Reputation
1 NeutralAbout phpstuff
-
Rank
Advanced Member
-
Can't connect to localhost for some reason. Running MAMP - just updated it. Here is what I have for my config.inc.php file: <?php if (!defined('LIVE')) DEFINE('LIVE', false); DEFINE('CONTACT_EMAIL', 'you@example.com'); // Send error messages to this email address when site is live DEFINE('BASE_URI', '/MAMP/htdocs'); // Should point to the PARENT of the web root directory DEFINE('BASE_URL', 'localhost:8888/'); // eg. www.example.com, localhost:8888/ DEFINE('MYSQL', BASE_URI . '/includes/mysql.inc.php'); session_start(); My mysql.inc.php file is in the includes folder.
-
For #9, "Add user to the database" part of the code is: $q = "INSERT INTO users (username, email, pass, first_name, last_name, date_expires) VALUES ('$u', '$e', '" . password_hash($p, PASSWORD_BCRYPT) . "', '$fn', '$ln', ADDDATE(NOW(), INTERVAL 1 MONTH) )"; $r = mysqli_query($dbc, $q); I'm wondering why there is concatenating going on: '" . password_hash($p, PASSWORD_BCRYPT) . "' What does this benefit? Isn't this info just being dumped into the database as a string?
-
So it seems like when you hash a password that the hash is a constant related to the password. So, If Amazon.com hashes the user password "mysecretpw99" and the hash is: 1209j09j0939h480h2389g4h9823g4 And then Yahoo.com hashes the same user password "mysecretpw99" then the hash will be: 1209j09j0939h480h2389g4h9823g4 Is this correct? If so, wouldn't it be easy to build a database of potential password combos, hash all of the combos, then have a database filled with hashed values. Then compare those hashed values to the actual hashed passwords that users are using
-
Sql Issue
phpstuff replied to olaoyesunday's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
Odd, when I copy/paste the first part of the code I get normal results: CREATE TABLE `categories` ( `id` SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, `category` VARCHAR(45) NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `category_UNIQUE` (`category` ASC) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; This 2nd block of code starts having the issue where it asks for a Y/N confirmation: CREATE TABLE `pages` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `categories_id` SMALLINT UNSIGNED NOT NULL, `title` VARCHAR(100) NOT NULL, `description` TINYTEXT NOT NULL, `content` LO -
Sql Issue
phpstuff replied to olaoyesunday's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
I'm glad I now know that it shouldn't do what it's doing above... I'll probably delete the database and start from scratch. Thank you for your help Larry! -
Sql Issue
phpstuff replied to olaoyesunday's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
I'm actually on the same pages 53-54 getting similar errors, so figured I'd add to this same post - updating my MySQl version may fix the error aboce, but I'm getting a wierd error below. This happened when I copied / pasted (ctrl-v) into terminal...I didn't even hit "enter" and it looks like it started trying to run the code. mysql> CREATE TABLE `pages` ( -> `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, -> `categories_id` SMALLINT UNSIGNED NOT NULL, -> `title` VARCHAR(100) NOT NULL, -> `description` TINYTEXT NOT NULL, -> `content` LONGTEXT NULL, -> -
Thank you both very much for taking time out of your day to reply. I kinda feel like I'm whining a bit, and maybe I am, but I'm really wanting to see how people approach learning this stuff. This is a personal goal that will bring great satisfation once I'm there so I will never give up that is for sure. Once I finish this book 100% and review it, I'll be moving on to ecommerce and simultaneously working on the PHP/MYSQL for the website I designed...hopefully with this forum and the books I'll be able to knock out my first site... Thanks again for the positive words here.