Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Which two do you want? The first two alphabetically? The two with the lowest city_id? Two random ones? You have got to be specific when you ask a question involving programming and data.
  2. The value="..." attribute only applies to your original type='text' field. It is not used for a <textarea></textarea> For a textarea, you output the content between the two tags.
  3. read is a reserved mysql keyword. If you truly have a column by that name, you should rename it to something else or you can enclose it in back-ticks everywhere you reference it in a query.
  4. You need an exit; statement after your header() redirect to prevent the remainder of the "protected" code on the page from being executed when the page is requested. Without an exit; all a hacker needs to do is ignore the header() redirect and he can still use anything on the protected page the same as if he was logged in.
  5. No. It won't. At least try something first.
  6. Browser's don't read php code because php is a server side scripting language. Perhaps if you explained exactly what you are trying to accomplish with a real example of the code you want to use.
  7. It always pays to browse the documentation first for answers to basic "can php/how to do this in php" questions - http://www.php.net/manual/en/function.range.php
  8. You have got to be freaking kidding. How would you expect it to get downloaded with the proper extension in every possible browser and in every possible situation.
  9. @dad00 - If you literally output < and > using any method, the browser will treat them as the start and end of a html tag. You must convert them to html entities to so that they are not operated on by the bowser.
  10. Use htmlentities() with the 2nd parameter set to ENT_QUOTES The < and > of the php tags look like html tag delimiters and cause the php code to be treated as a html tag.
  11. The value='...' attribute needs to be enclosed in quotes and you should use htmlentities() with the 2nd parameter set to ENT_QUOTES
  12. http://www.php.net/manual/en/function.ignore-user-abort.php And you would need to actually test it on your server to make sure it works as expected.
  13. A slight correction to the above, apparently the filename= attribute MUST use double-quotes. Using single-quotes actually created a target file with single-quotes as part of the name. I tested using an actual .doc file and $type = 'application/msword';. With both IE8 and FF3.5 and both left-clicking and right-clicking/save link as... resulted in the file being saved with the correct filename and extension. I can recall that older IE browsers wanted to use the name of the .php file that was in the link when you did not correctly specify the attachment; filename=\"$name\"" Something specific to what or how you are doing this is causing the symptom. I would examine the actual filename and type in the database to see what it actually is.
  14. It works for me in both IE8 and FF3.5 using some made up data. Does $name include the extension or not and what exactly is the type and extension as the problem could be specific to the content-type and extension. The only thing technically wrong with the posted code is that the filename='...' attribute needs to be enclosed in quotes.
  15. Running your code and dumping the $salts array gives the correct values - Array ( [0] => re [1] => st [2] => ma [3] => sy [4] => ex [5] => tr [6] => ha [7] => un [8] => co [9] => ru )
  16. No. It doesn't. The leading 'r' is under the 2nd character in the line above it because 10 in wwuser10 has one more character than all the other lines above it.
  17. That's because <optgroup> tags don't have name and value attributes. Only <option> tags have values. Ref: http://w3schools.com/tags/tag_optgroup.asp Whatever you are trying to do, you must do using the value="..." attribute of each <option> tag.
  18. When you do a "view source" of the page in your browser, what do you see? If you see the raw php code - <? echo $rows['datetime']; ?>, then please, please, please only use full opening php tags <?php as the short open tag <? is not always enabled and you won't always be on a server where you will have the ability to enable them.
  19. That's because it is a reserved word and should not be used as a column name - http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html
  20. Query to accomplish the above statement - $query = "SELECT your_column, ABS(10-your_column) as dif FROM your_table HAVING dif <= 5";
  21. Take the absolute value of the difference between the desired value (10 in your example) and the value in the table. Then return those rows with a result that is less-than or equal to 5.
  22. Each page that sets or references a $_SESSION variable needs a session_start() statement. Based on the space before the <?php tag in the code posted for action.php, you likely have a header error that prevented the session from starting. Are you developing php code and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON in your php.ini so that php would help you? Stop and start your web server to get any change made to php.ini to take effect and use a phpinfo() statement to confirm that the settings were actually changed in case the php.ini that you are changing is not the one that php is using.
  23. In programming, it is not enough just to look and see that something is present, you must check that it is correct. How about doing this part - Until you find out why the two values are not matching on your server with your database, you will never solve this.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.