Jump to content

kicken

Gurus
  • Posts

    4,704
  • Joined

  • Last visited

  • Days Won

    179

Everything posted by kicken

  1. Your file does not contain any data to be read. Even if you put data into it before running the script, it won't have any in it anymore by the time it reaches the fread call due to: The the manual page for fopen for details on what mode to use and when.
  2. the __get and __set methods defined in the Model class are known as magic methods. Basically PHP will automagically call them under certain situations. For __get and __set, they get called whenever you attempt to read the value of, or set the value of, a property that does not exist. So when the ModelShippingUsps class attempts to access $this->config, PHP realizes there is no accessible config property on either ModelShippingUsps or Model so it attempts to run $this->__get('config') instead which causes the __get method in the Model class to be executed. The get method will attempt to find a value in the $registry collection with the name of the missing property ('config' in this case and return whatever it finds. In this case there must be some sort of configuration object which has a get() method defined within it.
  3. Programmatic Injection is one way to do it from what I can tell.
  4. The point of alt text is to provide a meaningful description of what the image represents to browser that are incapable/configured not to/temporarily unable to display the requested image. Checking for the images existence with PHP doesn't do any good for that.
  5. From the sounds of it, the file is just cached. Whatever you did to clear your cache did not work successfuly. Try a CTRL+F5 or Ctrl+Shift+R to force a reload w/o cache. edit: I should remember to reload before posting when the tab has been open for a while lol.
  6. The problem with trying to do things that change the DB with a GET request is that these things may be done by accident. Say you had a list of users on your site with a delete link next to each one, and somehow google or another search engine found that page. Once it crawled it and tried to crawl all those "Delete" links, oops, there goes your entire user base. There have been cases similar to that in the past. For example Google had released a browser add-on at one point that would "make web-browsing faster" by trying to predict which links a user might click on next and then pre-load them in the background. There were a fair number of people complaining that things kept getting deleted from there db somehow because whoever developed the system just did a a link like delete.php?id=blah with either no verification or just a JS popup which was ignored by the tool (and would be also by bots). Once the addon pre-fetched that URL it would silently delete those items. That is why even though a GET may be easier/more convinent, you need to send actions that might result in a modification of the server data using a POST. Bots and add-ons (unless programmed poorly/maliciously) will not follow anything that makes a POST request.
  7. You should be using the DateTime class (or date_create if you want to stick procedural). Also you want to be using the DateTime::diff/date_diff function, not sub. $d1 = new DateTime($endtime); $d2 = new DateTime($curtime); $diff = $d1->diff($d2); var_dump($diff);
  8. Do you have any addons for firefox running? If so disable them and see if it goes away. I don't use firefox much anymore, but I can't recall ever seeing anything like that when I did. Leads me to believe it's an addon you have that is putting it there.
  9. The PHP code would only run on the server. PHP does have a printer extension for windows that you could use to send print jobs. Similar could be done on linux by using exec calls to the proper commands. As far reading barcode scanners, that would be something you'd have to handle on the local client through some other language. I've no experience with such devices so I can't say much more than that. Basically you can use PHP to do non-web things, but you have to keep in mind the client-server relationship and realize that your PHP code running on the server won't have access to things on the client PC such as scanners or the PC's files.
  10. What happens when you click the button? Does it do nothing at all, or does it run some other file? Perhaps you have an issue with trying to nest <form> tags.
  11. If you want to post the code for your login screen someone may be able to check if for you and see if there is anything you're doing that is slow.
  12. Did you have a point/question in this post? Or just posting an FYI thing? FYI, 1) isset is a language construct, array_key_exists is a function call. Function calls have extra overhead, thus are slower 2) You're not using in_array properly. in_array tests if a particular value exists in an array, not if a particular key exists 3) You should use isset(), except under one condition: If you need to know if the key exists, but NULL is an acceptable value for that key (eg if it can contain say a DateTime object or null for none).
  13. If you have the ability to change the php.ini file or change settings via .htaccess, you could enable output buffering as a work around.
  14. Just make a HTTP request to your site to log the URL/IP of the host. $_SERVER['HTTP_HOST'] will contain the domain name of the server. You can use gethostbyname to get the IP if you want. You can do a simple request using file_get_contents or curl to your server to log the information. Keep in mind that anyone with even just a bit of knowledge of PHP could just comment out that phone-home portion of the script (or modify it to always return a valid domain).
  15. If you're going for a VPS than all you need to worry about spec wise is if it has enough ram/bandwidth/disk space for the most part. You can setup whatever software you need yourself. There is a list of hosts and people's opinions over in the Misc. forum, check there for suggestions.
  16. It validates just fine for me if I copy/paste the css into the direct input box at w3's validator. How are you running your validation?
  17. Missing your , there between the arguments.
  18. You would store your tasks that need done into a database table, then have your cronscript select any pending tasks and run through them. So for the email example you'd store some task indicating that a new CV was submitted, and what the ID number is for that new CV. The cronscript could then use that information to find find the email addresses to send to, compose the email, and send it out.
  19. You've already been given the answer to this question. Read your threads.
  20. Just do a JOIN between the two tables using the title columns as the join's condition.
  21. You should be linking the comments with the article by the article's ID number, not the title. It's quicker to compare a couple of INTs than it is to compare strings. It would also use a lot less space on the system to store those INTs than to store a copy of the title. You also won't have any issues if the article title ever gets changed.
  22. You can save the file to your server when they first post it, somewhere temporary with a unique id to reference it. If there were errors on the form, then print out some message indicating they have uploaded that file and a hidden field to track it's ID. That is pretty much the only way to handle it. There is no way to re-populate a file input or anything similar.
  23. If you want to prevent someone from submitting a form before it has been completed, you need to use an onsubmit handler for the <form> element, not onbeforeunload. Your onsubmit should validate all the fields to make sure they have been filled in.
  24. You need to escape the quotes in concat(rel," ",subRel) or change them to be single quotes.
×
×
  • 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.