rob
Members-
Posts
143 -
Joined
-
Last visited
-
Days Won
16
Everything posted by rob
-
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.
-
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.
- 1 reply
-
- 1
-
Paypal Ipn Trouble With Custom Variable
rob replied to Janice's topic in Effortless E-Commerce with PHP and MySQL
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. -
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.
-
Unable To Export Database
rob replied to Steve Wilkison's topic in MySQL: Visual QuickStart Guide (2nd Edition)
What happens if you try to export one table? Personally, I would use the MySQL command line tool via SSH. -
Mysqli_Fetch_Object Error
rob replied to Antonio Conte's topic in PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
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. -
Mysqli_Fetch_Object Error
rob replied to Antonio Conte's topic in PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
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. -
Phpmyadmin
rob replied to Jonathon's topic in PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
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. -
Phpmyadmin
rob replied to Jonathon's topic in PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
The quotes around users and pass look like they're back-ticks. Also you don't need to quote either. -
Chapter 13 - Eregi Shows Deprecated
rob replied to Gardacus's topic in PHP for the Web: Visual QuickStart Guide (3rd Edition)
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- 2 replies
-
- 1
-
- regular
- expressions
-
(and 1 more)
Tagged with:
-
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.
-
Changing Size Of Text Fields
rob replied to Marie's topic in Effortless E-Commerce with PHP and MySQL
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 -
Changing Size Of Text Fields
rob replied to Marie's topic in Effortless E-Commerce with PHP and MySQL
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.