-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
LOL, that's a class method. You don't use the var keyword at all when assigning values to variables within class methods.
-
When you define class properties, you can only assign fixed/constant values as part of the declaration. You cannot assign variables, the result of functions... when you define the class properties. Also, the var keyword is php4 syntax. You should be using public, private, or protected
-
Pulling A Single Varible Out Of A Fanction Help
PFMaBiSmAd replied to 50r's topic in PHP Coding Help
I think that if you use the full editor (not the quick editor) the indentation is kept as is. Edit: That is until you click on any buttons, such as the preview button, then the posted source has the tabs removed. -
There Is A Problem With Your Queryno Database Selected
PFMaBiSmAd replied to 50r's topic in PHP Coding Help
You are not calling your class method. You have been told this a few times now. You have defined your class method, but have not called it. Your config file has nothing to do with the problem. -
Inserting Textbox Values With Special Characters Into Mysql
PFMaBiSmAd replied to Stoty's topic in PHP Coding Help
The error is because you have an extra ' after the 8 in ingredient8' I recommend that you build your query statement using sprintf, like in the example at the link to the mysql_real_escape_string function that trq posted, so that the sql syntax is separated as much as possible from the php. This would allow you to more easily see what the sql syntax is. -
Please see the sticky post at the top of this forum section - http://forums.phpfre...ode-repository/ Topic locked.
-
I don't use Wamp either, but you should be able to do this through the Wamp control panel. Left-click the Wamp icon in your system-tray area.
-
Are you browsing to the file using a URL in your browser? What exactly does the address bar of your browser show for this page?
-
Your file must end in .php (or you must specifically configure your server to parse .html files as php code.)
-
The Loaded Configuration File line in the phpinfo output is the php.ini that php is using.
-
Without the code that produces that error, best guess is you are trying to use the array as a string, rather than to iterate over the array to access each element.
-
Someone already mentioned using trim on the data. That does assume that you are then testing to make sure that the data isn't an empty string.
-
Then, you need to set php's error_reporting to E_ALL (or even better a -1) and display_errors to ON in your master php.ini on your development system to get php to help you by reporting and displaying all the errors it detects. Stop and start your web server to get any changes made to the master php.ini to take effect and use a .php script with a phpinfo statement in it to confirm that the two settings actually got changed in case the php.ini that php is using isn't the one that you changed.
-
Since comments would normally contain white-space and punctuation, no, using those two functions wouldn't help.
-
Register_globals were turned off by default over 10 years ago (unfortunately web hosts and 'php coders' didn't get and follow the loose recommendation.) If you have access to the master php.ini, that's where you should turn them off at. If you are on shared web hosting, you can turn it off in a local php.ini (when php is running as a CGI application) or in a .htaccess file (when php is running as an Apache Module.) The syntax for a php.ini would be register_globals off The syntax for a .htaccess file would be php_flag register_globals off As a test, you can change the name of your session variable to something else.
-
As part of your filtering logic that you should apply before validating the submitted data, you should trim the values and/or filter out any characters that are not within the expected range of characters for the type of the data field.
-
The problem is most likely due to register_globals being turned on. When you store the hashed value to $_SESSION['pass_phrase'] (or it already has a value in it), php sets $pass_phrase to that same value. What does a phpinfo statement show for the register globals setting on both systems?
-
You would make it an array - $_SESSION['totalnameqty'][]=$name . " " . $qty . " " . $total;
-
You would use an array with the array key/index being the username and the value being the password. $admin['user_name_1'] = 'password_1'; $admin['user_name_2'] = 'password_2'; The logic test would then become - if(isset($admin[$user]) && $pass==$admin[$user])
-
Also, you should escape data right before putting it into your query statement, not before validating it as any escape characters will alter the length of the string. Also, if you redisplay the entered data in the form fields upon an error condition, the escape characters would need to be removed.
-
Your form code is outputting a space after the <?php ?> code in each value attribute, so of course none of the fields are actually empty. A) You need to remove those spaces from the form code. B) As part of your filtering logic that you should apply before validating the submitted data, you should trim the values and/or filter out any characters that are not within the expected range of characters for the type of the data field.
-
Your file is missing the following, starting after the } else, on line 777 - { tablestyle($caption, $text, $mode); } } } }
-
The problem is because the definition of the e107table class has been edited/cutoff so that all the remaining code after that point is considered to be part of the e107table class.
-
I would only recommend it when you know the scope of what variables will be created/overwritten (kicken's example usage) or use it with one of the option flags/prefix that prevents overwriting existing variables. What happens if you have a pagination script that sets up a variable named $page (or any other variable a script might be using - $user, $id, ...) and at some time in the future you or someone else working on the project needs to add a column named page to a database table or the column id in your table isn't the same meaning as the exiting $id variable? Using extract on the data from the query just broke your script and you now have to troubleshoot (or remember) exactly where each variable is being set at.
-
How Can I Save Ringtone From Zedge.net Site Using Curl In Php.
PFMaBiSmAd replied to hdthanh's topic in PHP Coding Help
Topic locked...