Jump to content
Larry Ullman's Book Forums

margaux

Members
  • Posts

    453
  • Joined

  • Last visited

  • Days Won

    52

Everything posted by margaux

  1. I am trying to apply the zip code script 3.3 to a similar situation using UK postcodes i.e. return a list of locations and their distance from a specific postcode which the user inputs in a form. Below is the (simplified) code I've started with. if (!empty($_POST['postcode']) && (preg_match('/^(([gG][iI][rR] {0,}0[aA]{2})|((([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y]?[0-9][0-9]?)|(([a-pr-uwyzA-PR-UWYZ][0-9][a-hjkstuwA-HJKSTUW])|([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y][0-9][abehmnprv-yABEHMNPRV-Y]))) {0,}[0-9][abd-hjlnp-uw-zABD-HJLNP-UW-Z]{2}))$/',$_POST['postcode']))) { $lenpcArea = strcspn($_POST['postcode'],' ',4); // get the length of the postcode up to the first instance of a space $pcArea = substr($_POST['postcode'],0, $lenpcArea); echo '<h2 class="title"> Closest Paintballing Venues to ' . $_POST['postcode'] .':</h2>'; require (MYSQL); $q = "SELECT Latitude, Longitude FROM postcodes where Pcode='$pcArea' AND Latitude IS NOT NULL"; $r = mysqli_query($dbc, $q); if (mysqli_num_rows($r) == 1 ) { list($lat, $long) = mysqli_fetch_array($r, MYSQLI_NUM); $q = "SELECT name, website, email, CONCAT_WS('<br />', address1, address2), city, county, pb.postcode, phone, description, ROUND(DEGREES(ACOS(SIN(RADIANS($lat)) * SIN(RADIANS(Latitude)) + COS(RADIANS($lat)) * COS(RADIANS(Latitude)) * COS(RADIANS($long - Longitude)))) * 69.09) AS distance FROM pbvenues AS pb LEFT JOIN postcodes AS pc ON SUBSTR(pb.postcode,0,4)=pc.Pcode ORDER BY distance ASC"; $r = mysqli_query($dbc, $q) or trigger_error("Query: $q\n <br />MySQL Error: " . mysqli_error($dbc)); if (mysqli_num_rows($r) > 0) { while ($row = mysqli_fetch_array($r, MYSQLI_NUM)) { echo '<div class="content"><h3>' . $row[0] . '</h3> <h4>'. $row[4] . ' - ' . $row[9] . ' miles</h4> <p>' . $row[8] . '</p> </div>'; } I haven't displayed the code for the form displayed to the user but it includes an input field named 'postcode'. I've downloaded a UK postcode directory and input the data to a d/b named postcodes. The UK directory only provides the postal area i.e. up to the first 4 characters of the postcodes with their corresponding latitude and longitude in a column type of tinyint(4). Syntactically, the code is okay, validating the post code and outputting the data and I'm not getting any mysql errors - all the data I've asked for is being returned. However, the distance logic isn't working. 2 questions: What's the best way to do a join when the 2 columns are of different types - the postcodes.Pcode column is tinyint(4) and the pbvenues.postcode column is varchar(9). Would it be best to change the format of the postcodes.Pcode column? Why is the above code returning the same distance for every location stored in the pbvenues table? If you're not familiar with UK postcodes the following are all valid postcodes - WC2R 0BL, S6 6JE, M33 5EE, BN6 9EA, AB10 9AB, the first section known as the postal area is between 2 and 4 characters long separated from the second section by a space, case insensitive. Any suggestions? as always improvements welcome. Thanks
  2. usually when you get the error mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given it means that your database query wasn't succesful for any number of reasons. If you look through the above output carefully you'll see that it gives you some clues to identifying your error - in this case you have an undefined category in noproducts.html on line 11. so check the script which calls noproducts.html. It can often be helpful to run your queries directly in mysql to see if they're working / why they're not working - you'll (usually) get a helpful error message if something is wrong. If you get a chance read the chapter on Error Handling and Debugging in Larry's book, "PHP and MySQL for Dynamic Websites". It will save you a lot of time in the future.
  3. %20 is the url escape code for a space - try deleting the space on either side of the = sign
  4. Since the value hasn't changed MySQL will not update the row, thereby returning zero rows and the check if (mysqli_num_rows($r) == 1) will fail. You can force the user to change his password to a new value and in the form validation check that the new value is not equal to the current value.
  5. Thanks Larry - I just passed on what I learned from your books.
  6. if I understand your question correctly, to display all members of staff who speak a particular language, you need to join the 3 tables and use a WHERE clause e.g. SELECT s.first_name, s.last_name, s.start_date, l.language FROM staff AS s INNER JOIN staff_languages AS sl USING (staff_id) INNER JOIN languages AS l USING (lang_id) WHERE l.lang_id = 02 the column names in the different tables must have exactly the same names to use the USING clause - staff_id must exist in both the staff table and the staff_languages table and lang_id must exist in both the staff_languages and languages tables. If the columns have different names you will need to use the ON clause.
  7. Great! Good luck with the rest of the site. If you have any more questions, this forum is helpful, just be sure to start a new topic.
  8. where possible I like to use my own variables as opposed to the global ones in mysql statements as I find it easier to read and to code. so this is how I would do it if ($bn && $sex && $sp && $md && $rn) { $q = "INSERT INTO bird (user_id, bird_name, sex, species_id, ringno, dob) VALUES ($uid, '$bn', '$sex', $sp, '$rn', '$md')"; at the top of the page where you check the $_SESSION['user_id'], set the $uid variable at the same time - if ($_SESSION['user_id'] > '1'){ $uid = $_SESSION['user_id]; include('includes/navbar1.inc.php'); } else { include('includes/navbar.inc.php'); } Depending on what you are using $_SESSION['user_id'] for you may also need to set the $uid variable in that else clause. A couple of other things - I think your session_start must be at the very top of the page even before your !DOCTYPE declaration or you will get problems with 'headers already sent'. Also you don't need $_POST['dob']. I originally suggested $_SESSION['dob'] as I thought the data was coming from a different page. The coding for the date validation is a little confusing, may I suggest the following starting with //Set up Date // Setup Date if ($mn && $dt && $yr) { $md = date("Ymd", mktime(0, 0, 0, $mn, $dt, $yr)); } else { $md = FALSE; echo '<p class="error">Please enter valid values in the date fields.</p>'; } Then you can delete the //Validate Date snippet. Finally the validation of sex doesn't check for valid data. I posted some code on another post which you may want to try - ch.2 review and pursue.
  9. I'm a little confused by your code so maybe I didn't understand the original question. Is all this going on in the same test_add_bird.php file? Just before the insert you create $mdate and then don't use it. It looks like you've created a few variables that you're not using e.g. $rn, $bn which you've used real_escape_string on presumably to insert clean data in the database. Why don't you use these variables in your INSERT statement? If you've tested it thoroughly and it does what you want, then maybe I'm missing something. Also there was an error in my previous code, an extra single quote - apologies for that!
  10. Thanks for the thanks. The error message is giving you some clues by reflecting the variables you've created, but these are variables and it looks like you're using a variable as a $_POST index. Have you set up a field in your form with the name mdate? The error handler shows you the $_POST variables - you have $_POST[bird_name}, $_POST[species_id], $_POST[day] etc. You have to pass mdate in another way or use your mysql statement to manipulate day, month, year. Since you already have a session, how about $_SESSION['dob'] = date("Ymd", mktime(0, 0, 0, $mn, $dt, $yr)); and then your insert statement could be $q = "INSERT INTO bird (user_id, bird_name, sex, species_id, ringno, dob) VALUES ($_SESSION['user_id], $_POST['bird_name'], $_POST['sex'], $_POST['species_id'], $_POST['ringno'], '$_SESSION['dob'])"; Also make sure you've got the quotes in the right place - e.g. instead of '$_POST[birdname]' it should be $_POST['bird_name']
  11. // Validate the gender: $gender = 'a'; //create a false value to test against $validGender = array('M'=>'Sir', 'F'=>'Madam'); // create an associative array of valid values if (isset($_REQUEST['gender']) && (array_key_exists($_REQUEST['gender'], $validGender))) { //the function array_key_exists lets you check if a value is set as a key in your array $gender = $_REQUEST['gender']; // store the valid gender $greeting = '<p><b>Good day, ' . $validGender[$gender] . ' !</b></p>'; // use the valid gender as the key to your array to access the appropriate title } else { // Unacceptable value. $gender = NULL; echo '<p class="error">Please select your gender (M/F)!</p>'; }
  12. It's really best to start a new topic for this as its not related to your original login.php query. Can you be a bit more specific where the data is coming from - if it is all coming from the same form, you can access it via the $_POST global array as long as you've set up the form fields with name attributes e.g. $q = "INSERT INTO table (user_id, email, address1, address2, city, postcode) VALUES ($_SESSION['user_id'], $_POST['email'], $_POST['city'], $_POST['postcode'])"; For the text fields you may want to consider assigning them to variables and using mysqli_real_escape_string for security reasons. For the date field, there are a couple of ways you could do this - look in the php manual for the different date functions it offers and consider the implode function.
  13. 1. point taken. 2. I'm not not sure I follow you - $cat is a variable created from $_POST, on what levels would it not work?
  14. I changed the collation in the connection script from utf8 to utf8_general_ci, then recreated the stored procedures and everything is now working nicely. Thanks for the help!
  15. I have come up against this issue as well and tried what Andrew T suggested (thanks). That seemed to work on the get_shopping_cart_contents stored procedure as I can now display the shopping cart but I get the same error when I try to remove an item or add an item to the cart Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_swedish_ci,IMPLICIT) for operation '=' This is a bit technical for me so apologies in advance for my stupid questions... Which collation is PHP using and which collation is MySQL using? In phpmyadmin it looks as if mysql defaults to utf_swedish but i have defined the tables and fields as utf_general? I'm not sure where to look to find out which collation PHP is using. Do I need to convert the collation for every instance of every variable in the stored procedures - e.g. $uid and $sp_type are strings and $pid and $qty are integers - is collation different on strings v numbers? Thanks for any suggestions!
  16. Its on the the last page of the bonus pages that I downloaded. Re validation - I thought it was weak as well, which was partly(ok mostly) out of laziness but also I was wondering... since it's a select field, there are only valid options open for the user to input so do I need to validate it? anyway I added this bit of validation. foreach ($cat as $value) { $cat['$value'] = (filter_var($value, FILTER_VALIDATE_INT,array('min_range' => 1))) ? $value : false; if (!$cat['$value']){ $addPage_errors['category'] = 'The category/ies you selected are not valid options. Please try again.';
  17. The UK version of sandbox has an error in that it redirects you to the live site when you click on merchant services from the sandbox test site. I spent ages trying to create a button that I could use for testing. http://www.x.com has loads of forums and I found a workaround. Once you're signed into your seller account, key in this url directly https://www.sandbox....?cmd=_web-tools I spoke to PayPal and they said they would look into it and get back to me 24 to 72 hours. watch this space!
  18. I've tried several of the suggestions from the bonus pages which are great ways to confirm my understanding and ensure my mysqli statements are constructed accurately, so thanks for including them. A couple of questions... why are the fields in the pages_categories table auto_increment - wouldn't these be taken from the addPage script? are you allowed to have more than one field in a table that is auto_increment - I seem to remember reading somewhere that only one field per table could be auto_increment and it has to be unique? Below is the code I used which works - please tell me where it can be improved. I changed the category validation check to if (isset($_POST['category'])) { $cat = ($_POST['category']);// create array variable to use for inserting into pages_categories } else { $addPage_errors['category'] = 'Please select a category/categories for the page you would like to add.'; } I added this code to the addPage.php script just after the check for validation errors i.e. if (!empty(addPage_errors)) { $q = "INSERT INTO pages (title, description, content) VALUES ('$title', '$des', '$con')"; // query to insert page to pages table $r = mysqli_query($dbc, $q); if (mysqli_affected_rows($dbc) == 1) { // if page inserted ok foreach ($cat as $value) { // foreach loop using the $cat array created when validating the category field $q2 = "INSERT INTO pages_categories (page_id, category_id) VALUES (LAST_INSERT_ID(),'$value')"; // use mysqli function last_insert_id to get page_id created by the pages table insertion which is then inserted into the pages_categories table $r2 = mysqli_query($dbc, $q2); } if (mysqli_affected_rows($dbc) > 0) { echo '<h4 class="success">The page has been added.</h4>'; $_POST = array(); //clear the $_post array } } else { trigger_error('The page could not be added due to a system error.'); // insert didnt work, force an error }
  19. I don't think I missed the point - I prefer the enum option which is an elegant solution if you're comfortable altering databases. My client who is on the other side of the world is not. He can use some nice forms which are styled like the rest of his site to manage the data. And yes, there are more openings for 'junk data' to be sent, but hopefully with the appropriate security techniques in place, the chances of that happening will be minimised.
  20. SHA256 is an improvement on SHA1 if you want to be a bit tighter with your security
  21. I got this to work by deleting the table and recreating it. I noticed that even tho the password column is set to VARBINARY by the sql statement if you try to amend the field in phpMyAdmin, it shows that its set to VARCHAR and there is no dropdown option for VARBINARY so I have set it to BLOB. Is there much of a difference between the two types?
  22. For another project I needed something similar. I created a table similar to categories called userTypes which had 2 fields - typeId and type - this way I could cater for admin userType as well as the other user types. In the users table I had a userType field which was a key field. The admin section of the site allowed a user to sign in and if he was an admin he could create/amend/delete users. It may seem like alot of extra work but it enabled the client who was in a remote site to control access. I also created a section for him to add/delete userTypes which was easy as it was just a form with 2 fields to validate and insert.
  23. Thanks for the reply. Here's what I've tried: registering with a number of different passwords downloading your script to use against my d/b changing the get_password_hash function to supply a hexadecimal value. changing the password column type to blob changing the password type to varchar(40) and instead of calling get_password_hash, using SHA1() The error message is always the same 1024. I dont think the password value is causing the error because I took that out of the select and I still got the same error. I'm really not sure what that error message means. I'm going to try all my queries using the sql client on phpMyAdmin, but in the meantime - any suggestions?
  24. Hi Im looking for some help on an error I get when I try to insert a new user. I've tested the script and get all the different error messages and I've manually inserted a record to the user table to test for duplicate usernames and emails and this part of the code is working. When I try to insert valid (at least what looks like valid) data, I get an error message - 1024. I haven't been able to find much info about this error other than it means: Message: Error reading file '%s' (errno: %d). I'm using php version 5.3.5 and mysql version 5.5.9 on localhost using MAMP. Here's the relevant code if (empty($reg_errors)) { $q = "SELECT email, username FROM users WHERE email = '$e' OR username = '$un'"; $r = mysqli_query($dbc, $q); $rows = mysqli_num_rows($r); if ($rows == 0){ $q = "INSERT INTO users (username, email, pass, firstname, lastname, date_expires) VALUES ('$un', '$e', '" . get_password_hash($pw). "','$fn', '$ln', ADDDATE(NOW(),INTERVAL1MONTH))"; if (mysqli_affected_rows($dbc) == 1) { echo '<h3>Thanks!</h3><p>Thank you for registering.You may now log in and access the contents of the site</p>'; $body = "Thank you for registering at The Fearless Way."; mail($_POST['email'], 'Registration Confirmed', $body, 'From: admin@fearlessconsulting.co.uk'); include('./includes/footer.html'); exit(); } else { trigger_error("You could not be registered due to a system error. We apologise for the inconvenience."); } } else { if ($rows == 2) { $reg_errors['email'] = 'This email address has already been registered. If you have forgotten your password, use the link at right to request a new password.'; $reg_errors['username'] = 'This username is not available. Please choose another.'; } else { $row = mysqli_fetch_array($r, MYSQLI_NUM); if (($row[0] == $_POST['email']) && ($row[1] == $_POST['username'])){ $reg_errors['email'] = 'This email address has already been registered. If you have forgotten your password, use the link at right to request a new password.'; $reg_errors['username'] = 'This username has already been registered with this email address. If you have forgotten your password, use the link at right to request a new password.'; } elseif ($row['0'] == $_POST['email']){ $reg_errors['email'] = 'This email address has already been registered. If you have forgotten your password, use the link at right to request a new password.'; } elseif ($row['1'] == $_POST['username']){ $reg_errors['username'] = 'This username has already been registered. Please choose another.'; } } // end of rows =2 if } // end of rows = 1 if } //end of empty reg_errors if } //end main form submission if and here's the error output Array ( [0] => Array ( [function] => EE_error_handler [args] => Array ( [0] => 1024 [1] => You could not be registered due to a system error. We apologise for the inconvenience. [2] => /Applications/MAMP/htdocs/effortlessEcom/register.php [3] => 56 [4] => Array ( [GLOBALS] => Array *RECURSION* [_ENV] => Array ( [sHELL] => /bin/bash [TMPDIR] => /var/folders/Oa/OakY5QztEk4b-9q9BumfBk+++TI/-Tmp-/ [Apple_PubSub_Socket_Render] => /tmp/launch-vm28OC/Render [__AUTHORIZATION] => auth 6 [uSER] => peterandmargo [COMMAND_MODE] => legacy [sSH_AUTH_SOCK] => /tmp/launch-zC6QpH/Listeners [__CF_USER_TEXT_ENCODING] => 0x1F5:0:0 [_BASH_IMPLICIT_DASH_PEE] => -p [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [PWD] => / [HOME] => /Users/peterandmargo [sHLVL] => 2 [DYLD_LIBRARY_PATH] => /Applications/MAMP/Library/lib: [LOGNAME] => peterandmargo [DISPLAY] => /tmp/launch-FpGD1H/org.x:0 [_] => /Applications/MAMP/Library/bin/httpd ) [HTTP_ENV_VARS] => Array ( [sHELL] => /bin/bash [TMPDIR] => /var/folders/Oa/OakY5QztEk4b-9q9BumfBk+++TI/-Tmp-/ [Apple_PubSub_Socket_Render] => /tmp/launch-vm28OC/Render [__AUTHORIZATION] => auth 6 [uSER] => peterandmargo [COMMAND_MODE] => legacy [sSH_AUTH_SOCK] => /tmp/launch-zC6QpH/Listeners [__CF_USER_TEXT_ENCODING] => 0x1F5:0:0 [_BASH_IMPLICIT_DASH_PEE] => -p [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [PWD] => / [HOME] => /Users/peterandmargo [sHLVL] => 2 [DYLD_LIBRARY_PATH] => /Applications/MAMP/Library/lib: [LOGNAME] => peterandmargo [DISPLAY] => /tmp/launch-FpGD1H/org.x:0 [_] => /Applications/MAMP/Library/bin/httpd ) [_POST] => Array ( [firstname] => Hello [lastname] => World [username] => HelloWorld [email] => hello@aol.com [pass1] => Hell0123 [pass2] => Hell0123 [submit_button] => Next → ) [HTTP_POST_VARS] => Array ( [firstname] => Hello [lastname] => World [username] => HelloWorld [email] => hello@aol.com [pass1] => Hell0123 [pass2] => Hell0123 [submit_button] => Next → ) [_GET] => Array ( ) [HTTP_GET_VARS] => Array ( ) [_COOKIE] => Array ( [sqliteManager_currentLangue] => 2 ) [HTTP_COOKIE_VARS] => Array ( [sqliteManager_currentLangue] => 2 ) [_SERVER] => Array ( [HTTP_HOST] => localhost [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.26) Gecko/20120128 Firefox/3.6.26 [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_KEEP_ALIVE] => 115 [HTTP_CONNECTION] => keep-alive [HTTP_REFERER] => http://localhost/effortlessEcom/register.php [HTTP_COOKIE] => SQLiteManager_currentLangue=2 [CONTENT_TYPE] => application/x-www-form-urlencoded [CONTENT_LENGTH] => 131 [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [sERVER_SIGNATURE] => Apache/2.0.64 (Unix) PHP/5.3.5 DAV/2 Server at localhost Port 80 [sERVER_SOFTWARE] => Apache/2.0.64 (Unix) PHP/5.3.5 DAV/2 [sERVER_NAME] => localhost [sERVER_ADDR] => 127.0.0.1 [sERVER_PORT] => 80 [REMOTE_ADDR] => 127.0.0.1 [DOCUMENT_ROOT] => /Applications/MAMP/htdocs [sERVER_ADMIN] => you@example.com [sCRIPT_FILENAME] => /Applications/MAMP/htdocs/effortlessEcom/register.php [REMOTE_PORT] => 54336 [GATEWAY_INTERFACE] => CGI/1.1 [sERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => POST [QUERY_STRING] => [REQUEST_URI] => /effortlessEcom/register.php [sCRIPT_NAME] => /effortlessEcom/register.php [php_SELF] => /effortlessEcom/register.php [REQUEST_TIME] => 1330076716 [argv] => Array ( ) [argc] => 0 ) [HTTP_SERVER_VARS] => Array ( [HTTP_HOST] => localhost [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.26) Gecko/20120128 Firefox/3.6.26 [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_KEEP_ALIVE] => 115 [HTTP_CONNECTION] => keep-alive [HTTP_REFERER] => http://localhost/effortlessEcom/register.php [HTTP_COOKIE] => SQLiteManager_currentLangue=2 [CONTENT_TYPE] => application/x-www-form-urlencoded [CONTENT_LENGTH] => 131 [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [sERVER_SIGNATURE] => Apache/2.0.64 (Unix) PHP/5.3.5 DAV/2 Server at localhost Port 80 [sERVER_SOFTWARE] => Apache/2.0.64 (Unix) PHP/5.3.5 DAV/2 [sERVER_NAME] => localhost [sERVER_ADDR] => 127.0.0.1 [sERVER_PORT] => 80 [REMOTE_ADDR] => 127.0.0.1 [DOCUMENT_ROOT] => /Applications/MAMP/htdocs [sERVER_ADMIN] => you@example.com [sCRIPT_FILENAME] => /Applications/MAMP/htdocs/effortlessEcom/register.php [REMOTE_PORT] => 54336 [GATEWAY_INTERFACE] => CGI/1.1 [sERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => POST [QUERY_STRING] => [REQUEST_URI] => /effortlessEcom/register.php [sCRIPT_NAME] => /effortlessEcom/register.php [php_SELF] => /effortlessEcom/register.php [REQUEST_TIME] => 1330076716 [argv] => Array ( ) [argc] => 0 ) [_FILES] => Array ( ) [HTTP_POST_FILES] => Array ( ) [_REQUEST] => Array ( [firstname] => Hello [lastname] => World [username] => HelloWorld [email] => hello@aol.com [pass1] => Hell0123 [pass2] => Hell0123 [submit_button] => Next → [sqliteManager_currentLangue] => 2 ) [live] => [contactEmail] => margo@margonline.co.uk [pageTitle] => register [pages] => Array ( [Home] => index.php [About] => about.php [Contact] => contact.php [Register] => register.php ) [this_page] => register.php [v] => register.php [k] => Register [dbc] => mysqli Object ( [affected_rows] => 0 [client_info] => 5.5.9 [client_version] => 50509 [connect_errno] => 0 [connect_error] => [errno] => 0 [error] => [field_count] => 2 [host_info] => Localhost via UNIX socket [info] => [insert_id] => 0 [server_info] => 5.5.9 [server_version] => 50509 [sqlstate] => 00000 [protocol_version] => 10 [thread_id] => 67 [warning_count] => 0 ) [reg_errors] => Array ( ) [fn] => Hello [ln] => World [un] => HelloWorld [e] => hello@aol.com [pw] => Hell0123 [q] => INSERT INTO users (username, email, pass, firstname, lastname, date_expires) VALUES ('HelloWorld', 'hello@aol.com', '+���v�N�M�|L��O��\\g���i�U��(4`','Hello', 'World', ADDDATE(NOW(),INTERVAL1MONTH)) [r] => mysqli_result Object ( [current_field] => 0 [field_count] => 2 [lengths] => [num_rows] => 0 [type] => 0 ) [rows] => 0 ) ) ) [1] => Array ( [file] => /Applications/MAMP/htdocs/effortlessEcom/register.php [line] => 56 [function] => trigger_error [args] => Array ( [0] => You could not be registered due to a system error. We apologise for the inconvenience. ) ) ) Array ( [GLOBALS] => Array *RECURSION* [_ENV] => Array ( [sHELL] => /bin/bash [TMPDIR] => /var/folders/Oa/OakY5QztEk4b-9q9BumfBk+++TI/-Tmp-/ [Apple_PubSub_Socket_Render] => /tmp/launch-vm28OC/Render [__AUTHORIZATION] => auth 6 [uSER] => peterandmargo [COMMAND_MODE] => legacy [sSH_AUTH_SOCK] => /tmp/launch-zC6QpH/Listeners [__CF_USER_TEXT_ENCODING] => 0x1F5:0:0 [_BASH_IMPLICIT_DASH_PEE] => -p [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [PWD] => / [HOME] => /Users/peterandmargo [sHLVL] => 2 [DYLD_LIBRARY_PATH] => /Applications/MAMP/Library/lib: [LOGNAME] => peterandmargo [DISPLAY] => /tmp/launch-FpGD1H/org.x:0 [_] => /Applications/MAMP/Library/bin/httpd ) [HTTP_ENV_VARS] => Array ( [sHELL] => /bin/bash [TMPDIR] => /var/folders/Oa/OakY5QztEk4b-9q9BumfBk+++TI/-Tmp-/ [Apple_PubSub_Socket_Render] => /tmp/launch-vm28OC/Render [__AUTHORIZATION] => auth 6 [uSER] => peterandmargo [COMMAND_MODE] => legacy [sSH_AUTH_SOCK] => /tmp/launch-zC6QpH/Listeners [__CF_USER_TEXT_ENCODING] => 0x1F5:0:0 [_BASH_IMPLICIT_DASH_PEE] => -p [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [PWD] => / [HOME] => /Users/peterandmargo [sHLVL] => 2 [DYLD_LIBRARY_PATH] => /Applications/MAMP/Library/lib: [LOGNAME] => peterandmargo [DISPLAY] => /tmp/launch-FpGD1H/org.x:0 [_] => /Applications/MAMP/Library/bin/httpd ) [_POST] => Array ( [firstname] => Hello [lastname] => World [username] => HelloWorld [email] => hello@aol.com [pass1] => Hell0123 [pass2] => Hell0123 [submit_button] => Next → ) [HTTP_POST_VARS] => Array ( [firstname] => Hello [lastname] => World [username] => HelloWorld [email] => hello@aol.com [pass1] => Hell0123 [pass2] => Hell0123 [submit_button] => Next → ) [_GET] => Array ( ) [HTTP_GET_VARS] => Array ( ) [_COOKIE] => Array ( [sqliteManager_currentLangue] => 2 ) [HTTP_COOKIE_VARS] => Array ( [sqliteManager_currentLangue] => 2 ) [_SERVER] => Array ( [HTTP_HOST] => localhost [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.26) Gecko/20120128 Firefox/3.6.26 [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_KEEP_ALIVE] => 115 [HTTP_CONNECTION] => keep-alive [HTTP_REFERER] => http://localhost/effortlessEcom/register.php [HTTP_COOKIE] => SQLiteManager_currentLangue=2 [CONTENT_TYPE] => application/x-www-form-urlencoded [CONTENT_LENGTH] => 131 [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [sERVER_SIGNATURE] => Apache/2.0.64 (Unix) PHP/5.3.5 DAV/2 Server at localhost Port 80 [sERVER_SOFTWARE] => Apache/2.0.64 (Unix) PHP/5.3.5 DAV/2 [sERVER_NAME] => localhost [sERVER_ADDR] => 127.0.0.1 [sERVER_PORT] => 80 [REMOTE_ADDR] => 127.0.0.1 [DOCUMENT_ROOT] => /Applications/MAMP/htdocs [sERVER_ADMIN] => you@example.com [sCRIPT_FILENAME] => /Applications/MAMP/htdocs/effortlessEcom/register.php [REMOTE_PORT] => 54336 [GATEWAY_INTERFACE] => CGI/1.1 [sERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => POST [QUERY_STRING] => [REQUEST_URI] => /effortlessEcom/register.php [sCRIPT_NAME] => /effortlessEcom/register.php [php_SELF] => /effortlessEcom/register.php [REQUEST_TIME] => 1330076716 [argv] => Array ( ) [argc] => 0 ) [HTTP_SERVER_VARS] => Array ( [HTTP_HOST] => localhost [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.26) Gecko/20120128 Firefox/3.6.26 [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_KEEP_ALIVE] => 115 [HTTP_CONNECTION] => keep-alive [HTTP_REFERER] => http://localhost/effortlessEcom/register.php [HTTP_COOKIE] => SQLiteManager_currentLangue=2 [CONTENT_TYPE] => application/x-www-form-urlencoded [CONTENT_LENGTH] => 131 [PATH] => /usr/bin:/bin:/usr/sbin:/sbin [sERVER_SIGNATURE] => Apache/2.0.64 (Unix) PHP/5.3.5 DAV/2 Server at localhost Port 80 [sERVER_SOFTWARE] => Apache/2.0.64 (Unix) PHP/5.3.5 DAV/2 [sERVER_NAME] => localhost [sERVER_ADDR] => 127.0.0.1 [sERVER_PORT] => 80 [REMOTE_ADDR] => 127.0.0.1 [DOCUMENT_ROOT] => /Applications/MAMP/htdocs [sERVER_ADMIN] => you@example.com [sCRIPT_FILENAME] => /Applications/MAMP/htdocs/effortlessEcom/register.php [REMOTE_PORT] => 54336 [GATEWAY_INTERFACE] => CGI/1.1 [sERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => POST [QUERY_STRING] => [REQUEST_URI] => /effortlessEcom/register.php [sCRIPT_NAME] => /effortlessEcom/register.php [php_SELF] => /effortlessEcom/register.php [REQUEST_TIME] => 1330076716 [argv] => Array ( ) [argc] => 0 ) [_FILES] => Array ( ) [HTTP_POST_FILES] => Array ( ) [_REQUEST] => Array ( [firstname] => Hello [lastname] => World [username] => HelloWorld [email] => hello@aol.com [pass1] => Hell0123 [pass2] => Hell0123 [submit_button] => Next → [sqliteManager_currentLangue] => 2 ) [live] => [contactEmail] => margo@margonline.co.uk [pageTitle] => register [pages] => Array ( [Home] => index.php [About] => about.php [Contact] => contact.php [Register] => register.php ) [this_page] => register.php [v] => register.php [k] => Register [dbc] => mysqli Object ( [affected_rows] => 0 [client_info] => 5.5.9 [client_version] => 50509 [connect_errno] => 0 [connect_error] => [errno] => 0 [error] => [field_count] => 2 [host_info] => Localhost via UNIX socket [info] => [insert_id] => 0 [server_info] => 5.5.9 [server_version] => 50509 [sqlstate] => 00000 [protocol_version] => 10 [thread_id] => 67 [warning_count] => 0 ) [reg_errors] => Array ( ) [fn] => Hello [ln] => World [un] => HelloWorld [e] => hello@aol.com [pw] => Hell0123 [q] => INSERT INTO users (username, email, pass, firstname, lastname, date_expires) VALUES ('HelloWorld', 'hello@aol.com', '+���v�N�M�|L��O��\\g���i�U��(4`','Hello', 'World', ADDDATE(NOW(),INTERVAL1MONTH)) [r] => mysqli_result Object ( [current_field] => 0 [field_count] => 2 [lengths] => [num_rows] => 0 [type] => 0 ) [rows] => 0 )
×
×
  • Create New...