Jump to content
Larry Ullman's Book Forums

e-mazed

Members
  • Posts

    9
  • Joined

  • Last visited

  • Days Won

    1

e-mazed last won the day on February 5 2012

e-mazed had the most liked content!

e-mazed's Achievements

Newbie

Newbie (1/14)

2

Reputation

  1. Ok not sure why - but I have another computer and I copied the entire MAMP folder over from one to the other and the problem is resolved - so I will leave this one as a mystery that has been resolved
  2. Thanks - i am completely lost on this one - Just so i am following the same path as you - I created a database called ecommerces2 - then at the top i have a structure tab - followed by a SQL tab - in that tab I dumped the above code and selected "go" - when i do that i am returned with this #1146 - Table 'ecommerces2.orders' doesn't exist
  3. Hi I am trying to create the orders table and I am using MAMP - I copied your tables exactly from your downloaded file ex2 SQL SQL. but the only table that won't work is the orders table: CREATE TABLE `orders` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `customer_id` int(10) unsigned NOT NULL, `total` decimal(7,2) unsigned DEFAULT NULL, `shipping` decimal(5,2) unsigned NOT NULL, `credit_card_number` mediumint(4) unsigned NOT NULL, `order_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `customer_id` (`customer_id`), KEY `order_date` (`order_date`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; It won't accept the total column for some reason - pls help
  4. Paul thanks so much - I hate to bother you with an other error but its saying that i have issues with TZ timezone, I don't believe anywhere in the book we addressed this...thxs a million It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PST/-8.0/no DST' instea
  5. Ok i will take a look - strange as though my registration page works fine and connects to the database, i will go through the files again looking for it
  6. HI I have completed chapter 4 and when I try and test my login script i get the following error, I have re-done my Login.inc.php script and and login_form.inc.php but still get the following error: An error occurred in script '/Applications/MAMP/htdocs/html/includes/login.inc.php' on line 16: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given Array ( [0] => Array ( [function] => my_error_handler [args] => Array ( [0] => 2 [1] => mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given [2] => /Applications/MAMP/htdocs/html/includes/login.inc.php [3] => 16 [4] => Array ( [GLOBALS] => Array *RECURSION* [_ENV] => Array ( [sHELL] => /bin/bash [TMPDIR] => /var/folders/fq/jj0y633n07d9c_98t1ymj26h0000gn/T/ [Apple_PubSub_Socket_Render] => /tmp/launch-GCuAgg/Render [__AUTHORIZATION] => auth 6 [uSER] => Booboo [COMMAND_MODE] => unix2003 [sSH_AUTH_SOCK] => /tmp/launch-2V4a3o/Listeners [__CF_USER_TEXT_ENCODING] => 0x1F5:0:0 [_BASH_IMPLICIT_DASH_PEE] => -p [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [PWD] => / [HOME] => /Users/Booboo [sHLVL] => 2 [DYLD_LIBRARY_PATH] => /Applications/MAMP/Library/lib: [LOGNAME] => Booboo [DISPLAY] => /tmp/launch-mA8mph/org.x:0 [_] => /Applications/MAMP/Library/bin/httpd ) [HTTP_ENV_VARS] => Array ( [sHELL] => /bin/bash [TMPDIR] => /var/folders/fq/jj0y633n07d9c_98t1ymj26h0000gn/T/ [Apple_PubSub_Socket_Render] => /tmp/launch-GCuAgg/Render [__AUTHORIZATION] => auth 6 [uSER] => Booboo [COMMAND_MODE] => unix2003 [sSH_AUTH_SOCK] => /tmp/launch-2V4a3o/Listeners [__CF_USER_TEXT_ENCODING] => 0x1F5:0:0 [_BASH_IMPLICIT_DASH_PEE] => -p [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [PWD] => / [HOME] => /Users/Booboo [sHLVL] => 2 [DYLD_LIBRARY_PATH] => /Applications/MAMP/Library/lib: [LOGNAME] => Booboo [DISPLAY] => /tmp/launch-mA8mph/org.x:0 [_] => /Applications/MAMP/Library/bin/httpd ) [_POST] => Array ( => info@e-mazed.com [pass] => Fairmont0302 ) [HTTP_POST_VARS] => Array ( => info@e-mazed.com [pass] => Fairmont0302 ) [_GET] => Array ( ) [HTTP_GET_VARS] => Array ( ) [_COOKIE] => Array ( [phpSESSID] => b0d81cd727b5673a2ede40c1752e3524 ) [HTTP_COOKIE_VARS] => Array ( [phpSESSID] => b0d81cd727b5673a2ede40c1752e3524 ) [_SERVER] => Array ( [HTTP_HOST] => localhost [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5 [HTTP_ACCEPT_ENCODING] => gzip, deflate [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7 [HTTP_CONNECTION] => keep-alive [HTTP_REFERER] => http://localhost/html/includes/register.php [HTTP_COOKIE] => PHPSESSID=b0d81cd727b5673a2ede40c1752e3524 [CONTENT_TYPE] => application/x-www-form-urlencoded [CONTENT_LENGTH] => 42 [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [sERVER_SIGNATURE] => [sERVER_SOFTWARE] => Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.6 [sERVER_NAME] => localhost [sERVER_ADDR] => ::1 [sERVER_PORT] => 80 [REMOTE_ADDR] => ::1 [DOCUMENT_ROOT] => /Applications/MAMP/htdocs [sERVER_ADMIN] => you@example.com [sCRIPT_FILENAME] => /Applications/MAMP/htdocs/html/includes/index.php [REMOTE_PORT] => 52089 [GATEWAY_INTERFACE] => CGI/1.1 [sERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => POST [QUERY_STRING] => [REQUEST_URI] => /html/includes/index.php [sCRIPT_NAME] => /html/includes/index.php [php_SELF] => /html/includes/index.php [REQUEST_TIME] => 1329160928 [argv] => Array ( ) [argc] => 0 ) [HTTP_SERVER_VARS] => Array ( [HTTP_HOST] => localhost [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5 [HTTP_ACCEPT_ENCODING] => gzip, deflate [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7 [HTTP_CONNECTION] => keep-alive [HTTP_REFERER] => http://localhost/html/includes/register.php [HTTP_COOKIE] => PHPSESSID=b0d81cd727b5673a2ede40c1752e3524 [CONTENT_TYPE] => application/x-www-form-urlencoded [CONTENT_LENGTH] => 42 [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [sERVER_SIGNATURE] => [sERVER_SOFTWARE] => Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.6 [sERVER_NAME] => localhost [sERVER_ADDR] => ::1 [sERVER_PORT] => 80 [REMOTE_ADDR] => ::1 [DOCUMENT_ROOT] => /Applications/MAMP/htdocs [sERVER_ADMIN] => you@example.com [sCRIPT_FILENAME] => /Applications/MAMP/htdocs/html/includes/index.php [REMOTE_PORT] => 52089 [GATEWAY_INTERFACE] => CGI/1.1 [sERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => POST [QUERY_STRING] => [REQUEST_URI] => /html/includes/index.php [sCRIPT_NAME] => /html/includes/index.php [php_SELF] => /html/includes/index.php [REQUEST_TIME] => 1329160928 [argv] => Array ( ) [argc] => 0 ) [_FILES] => Array ( ) [HTTP_POST_FILES] => Array ( ) [_REQUEST] => Array ( => info@e-mazed.com [pass] => (removed for post) [phpSESSID] => b0d81cd727b5673a2ede40c1752e3524 ) [live] => [contact_email] => info@e-mazed.com [HTTP_SESSION_VARS] => Array ( ) [_SESSION] => Array ( ) [dbc] => mysqli Object ( [affected_rows] => -1 [client_info] => 5.5.9 [client_version] => 50509 [connect_errno] => 0 [connect_error] => [errno] => 1064 [error] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM users WHERE (email='info@e-mazed.com' and pass'ځ?,??~W|څ????Lԏ,??,t' at line 1 [field_count] => 0 [host_info] => Localhost via UNIX socket [info] => [insert_id] => 0 [server_info] => 5.5.9 [server_version] => 50509 [sqlstate] => 42000 [protocol_version] => 10 [thread_id] => 34 [warning_count] => 0 ) [login_errors] => Array ( ) [e] => info@e-mazed.com [p] => (removed for post) [q] => SELECT id, username, type, IF(date_expries>NOW(), true, FROM users WHERE (email='info@e-mazed.com' and pass'ځ�,��~W|څ����Lԏ,�,t���\\) [r] => ) ) ) [1] => Array ( [file] => /Applications/MAMP/htdocs/html/includes/login.inc.php [line] => 16 [function] => mysqli_num_rows [args] => Array ( [0] => ) ) [2] => Array ( [file] => /Applications/MAMP/htdocs/html/includes/index.php [line] => 19 [args] => Array ( [0] => /Applications/MAMP/htdocs/html/includes/login.inc.php ) [function] => include ) ) Knowledge is Power and it pays to know Home About Contact Register Welcome Welcome to Knowledge is Power, a site dedicated to keeping you up to date on the Web security and programming information you need to know. Blah, blah, blah. Yadda, yadda, yadda. Login The email address and password do not match those on file. Email Address Password Forgot? Content Site Map | Policies © Knowledge is Power | Design by spyka webmaster
  7. Thanks Edward I can't believe it was such a rookie mistake.. i ended up using the code hint in DW and it fixed the entire problem... thxs a million!!
  8. Hi All, I have gone over my code a number of times and i am stumbled why this is not working. I am using DW CS5 to run the code. When I go to live view for my index.php I get the following error: Warning: require(/html/includes/config.inc.php) [function.require]: failed to open stream: No such file or directory in/Applications/MAMP/htdocs/html/includes/index.php on line 7 Fatal error: require() [function.require]: Failed opening required '/html/includes/config.inc.php' (include_path='.:/Applications/MAMP/bin/php/php5.3.6/lib/php') in/Applications/MAMP/htdocs/html/includes/index.php on line 7 My line 7 of my code is the require connection to my config.php and looks like this: require('/html/includes/config.inc.php'); My config.php file isn't giving me any code errors and looks like this: <?php $live = false; $contact_email = 'info@e-mazed.com'; define ('BASE_URI', 'file:///Macintosh HD/Users/macuser/Applications/MAMP/htdocs/html'); define ('BASE_URL', 'localhost/html'); define ('MYSQL', 'mysql.inc.php'); // ************ CONSTANTS *********** // // ********************************** // // ********************************* // // ************ SESSIONS *********** // // Start the session: session_start(); // ************ SESSIONS *********** // // ********************************* // // ****************************************** // // ************ ERROR MANAGEMENT ************ // // Function for handling errors. // Takes five arguments: error number, error message (string), name of the file where the error occurred (string) // line number where the error occurred, and the variables that existed at the time (array). // Returns true. function my_error_handler ($e_number, $e_message, $e_file, $e_line, $e_vars) { // Need these two vars: global $live, $contact_email; // Build the error message: $message = "An error occurred in script '$e_file' on line $e_line:\n$e_message\n"; // Add the backtrace: $message .= "<pre>" .print_r(debug_backtrace(), 1) . "</pre>\n"; // Or just append $e_vars to the message: // $message .= "<pre>" . print_r ($e_vars, 1) . "</pre>\n"; if (!$live) { // Show the error in the browser. echo '<div class="error">' . nl2br($message) . '</div>'; } else { // Development (print the error). // Send the error in an email: error_log ($message, 1, $contact_email, 'From:admin@example.com'); // Only print an error message in the browser, if the error isn't a notice: if ($e_number != E_NOTICE) { echo '<div class="error">A system error occurred. We apologize for the inconvenience.</div>'; } } // End of $live IF-ELSE. return true; // So that PHP doesn't try to handle the error, too. } // End of my_error_handler() definition. // Use my error handler: set_error_handler ('my_error_handler');
×
×
  • Create New...