Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. To remove the error do: if(isset($_COOKIE['cookiesessionID'])){ //cookie is set }else{ //cookie is not set } Why it's not working if you changed the name, I can't tell. If you are using Firefox you can view what cookies are set. Do you allow cookies to be set on your browser?
  2. When you get a variable from a form use $id = $_POST['id']; when the field is name="id". If it's in the URL use $id = $_GET['id']; when your url has ?id=x
  3. The cookie for a session ID is default named PHPSESSID.
  4. Loop through the list of files and use a technique like this for placing your table rows: http://www.phpfreaks.com/forums/index.php/topic,157422.msg685107.html#msg685107
  5. The comments on http://php.net/header contain many of them. Wikipedia has a list: http://en.wikipedia.org/wiki/Internet_media_type#List_of_common_media_types
  6. You could use substring and strpos to remove everything between <style> and </style>[code] [/code]
  7. Are you planning on submitting a form anyway? If so, make a hidden field and use javascript to set the value of it. Then you can get it when you POST the form. If you're not submitting a form You'll need to use AJAX.
  8. You just copied and pasted the docs. You didn't actually write new code. bool is what type it returns, strings are what you send it. You don't just C&P without understanding
  9. I don't think it's the FOUC, it's just the plain white screen before the page loads.
  10. require('file.php') OR die("error message");
  11. That's what IE does. It happens on any page, it's just more noticeable on some. Nothing you can do, AFAIK.
  12. http://us.php.net/manual/en/function.move-uploaded-file.php
  13. You can't update an auto-increment field, AFAIK. It will break the table.
  14. If you change the numbers, then any other table which references those rows will be meaningless. There is a good reason to keep the numbers the same. Why do you want to change them? You can sort them in PHP to make new arrays, but don't try to edit the tables in MySQL.
  15. You just said you are running 5 or 4...I have no idea what version you have. The code is old, but it is not version specific. It is just poor code.
  16. Yes, it's old. It's relying on register_global being enabled, which it is not by default for security. Try $_POST['name']; Also, add this to the top of your pages for error_reporting: ini_set('display_errors', 1); error_reporting(E_ALL);
  17. So you know one part of it you want to remove - anything before and including website.com. So find the position of website.com - using strpos. Then make a substring which goes from the end of website.com to the end of the string. Remember strpos gives you the start of the string so you'll need to add the strlen of website.com to the strpos to get the END of website.com Then we'll go from there. Can you give more examples of what you're trying to get? like, 5 example URLs and which part you want. I know you said always the last, but one example you gave was index.php?
  18. Well, post your code and what the problem is. We're not going to write it for you.
  19. The slashes it strips are \. Not / Also, you don't STRIP slashes before entering data into a database. You ADD them using mysql_real_escape_string() in order to protect yourself against SQL injection.
  20. Did you try your code? You say it "should give news" - DOES it? No. It doesn't: http://grady.us/temp/test.php If you want to fix it go ahead. My code works fine, and is perfectly dynamic. I use it as the base for my framework I use on every site I do.
  21. That's just one of the problems with it. Read the docs dude. Also, I will repeat: Those functions are for working with FILES. Not the current url of the page a visitor is viewing. Not going to work here. The OP is obviously off working on the code, and if he needs help he'll post. The requirements he posted were a bit confusing but with some more url examples we can probably get it working.
×
×
  • 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.