Jump to content
Larry Ullman's Book Forums

rob

Members
  • Posts

    143
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by rob

  1. Yes, scope issues. mysqli_real_escape_string requires the database connection, so you'll either need to pass the connection into the function or make $dbc global. As it stands you're not returning any values ($errors, $input_name) so they are not accessible outside of the function. Again you could make $errors global and return the sanitized value if $input_name triggers else in your empty conditional.
  2. Because that removes the flexibility of being able to pass in a filename as a function parameter and will only ever point to the script executing it. The login.php script redirects to loggedin.php, on successful validation of submitted user details, by setting: $url = absolute_url('loggedin.php'); header("location: $url"); The HTTP spec requires location headers to be absolute urls.
  3. Clue is in the error message: output started at /Applications/XAMPP/xamppfiles/htdocs/php/mysqli_connect.php:4 Check your mysqli_connect.php script for whitespace: make sure there's no whitespace before the opening <?php and remove the closing ?> if the file doesn't contain any html.
  4. If you pass a custom variable to paypal it should be included when it sends information to your ipn script. I would start by dumping all the information being sent to your ipn script into a text file to see exactly what you're getting from paypal - I'm guessing you checked your logs already and nothing is showing? Could be an issue with how you're setting and sending the value to paypal. If it is being sent and is correct, then it's an issue with your ipn script - I'd start with mysql query debugging. You don't mention how you're storing the shopping cart information - I don't have the book to hand and cannot remember how that example in the book does it. If it's in a database, there's nothing in your script to remove it.
  5. I'd alternate css class names and set different background images in each: $class = ($class=='blue' ? 'green' : 'blue'); echo '<tag class="' . $class . '">'; You can't set a background image using an <img> tag, you need to set it in your css: .blue { background: url(path_to_image) 0 0 repeat; } Antonio's method is good, unless you have to support IE8,7. You could also achieve the same effect using javascript.
  6. I read it as string length without spaces rather than word count. But I'll include methods for both. For string length without spaces: $string_length = strlen($string) - substr_count($string, ' '); For word count: $word_count = str_word_count($string, 0);
  7. What happens if you try to export one table? Personally, I would use the MySQL command line tool via SSH.
  8. You need to remove the semicolon from the start of the line: ;magic_quotes_gpc = Off You can also turn magic quotes off in a .htaccess file using a php_flag
  9. Did you remove stdClass from SeasonList::addObject when specifying 'season' as the name of the class to instantiate, set the properties of and return? public function addObject( stdClass $object ) { I get a blank screen with error reporting off if stdClass is not removed.
  10. Your season object constructor is expecting 2 parameters $id and $season. The fetch_object method takes a second (when using OOP style) parameter for the object constructor: object mysqli_result::fetch_object ([ string $class_name [, array $params ]] ) However, you don't really need to set id and season through a constructor in your season object, they'll be set as object properties anyway.
  11. What is the field type setting? I notice your hashed passwords are 65 characters long what are you using? Also, I'm actually not sure if it's a factor but check your encoding for both php and mysql.
  12. The quotes around users and pass look like they're back-ticks. Also you don't need to quote either.
  13. You could set error reporting to ignore E_DEPRECATED notices or better yet, take a look at the PCRE extension: http://www.php.net/manual/en/function.preg-match.php
  14. Just uploaded one, no issues. 29kb / 267 × 236 Try uploading a small test image, if it works there's a limit somewhere between that and your last attempt.
  15. You could pass the function an array. Or, you could use func_get_args within the function. http://www.php.net/manual/en/function.func-get-args.php I've also seen functions taking pipe delimited strings "var1|var2|var3"
  16. Crikey, HartleySan using IE6 must be 'interesting' for general browsing. Thought this was an interesting site regarding IE6: http://www.ie6countdown.com/ Explanation of the forum: http://www.larryullm..._3333#entry3333
  17. Just to clarify there are two input attributes being discussed here: size & max-length. Size sets the visual width of the input and absolutely should be styled using CSS (keep markup and styling separate). Max-length determines the maximum number of characters that can be entered by the user. Max-length cannot be set using CSS. Interestingly, the new HTML5 specs have included a new attribute called pattern which allows you to set rules via a regular expression; I wonder over time if max-length will be deprecated and you'll have to test maximum input length against a PCRE. I would strongly advise the use of <label> instead of <b> around, well labels; that's what it's for (huge usability advantage too). I don't know which page you were referencing on w3schools; but, I've found a number of errors on their website in the past. I go to the specs or books now.
×
×
  • Create New...