Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. You are uploading it through HTTP either way.
  2. It "checks" the radio button.
  3. You can't pass variables between pages. You need to use sessions.
  4. I missed the part where you asked a question.
  5. If there is a limit on the upload size then it doesn't matter what you do after you upload it. It will fail before it even gets to that point. If you have access to the php.ini file you may be able to increase the limits.
  6. Why did you think the upload limit would magically be gone by using FTP instead? You are still uploading a file through a form, and the limit still exists.
  7. Google will penalize for duplicate content. So if domain2.com links to the same page as domain.com, you will have negative effects.
  8. SELECT MIN(column) AS first, MAX(column) AS last FROM table
  9. Make an admin flag in the user table and then just make sure it is set before you let them do anything.
  10. You should store results and matches in different tables. This is called normalization, and is the preferred approach.
  11. When you depend on a file being loaded, like class or function files.
  12. I'm not sure how your question pertains to PHP, but yes USB scales exist. http://www.google.com/search?q=usb+scale
  13. You can do it in one script. Just redirect back to the page after you're done processing it, and then you won't have the page refresh issue.
  14. Because they both have annoyingly long syntax.
  15. Thanks, forgot to remove that after switching the delimiter. Yeah, I had a major derp moment (see my post above).
  16. DOH! I'm an idiot sometimes. The issue was that in the process of switching to this pattern instead of more-complicated-than-needed-to-be code, I accidentally removed the assignment of $link. Derp brb more coffee
  17. I suck at regex, help me out here. I have a pagination function that will build page links. If no link is given (for pages) then it will attempt to guess what it should be. It does this by assuming the end of the string is where you want the page. For instance, if you are on example.com/news/somearticle, it will assume that the pages should be example.com/news/somearticle/2 Obviously if you are already on example.com/news/somearticle/2 it would then make it example.com/news/somearticle/2/3, which is of course wrong. So I need to strip /NUMBER/ off the end of the URL. Seems simple enough, yet for some reason it is stripping the entire segments all the way back to the domain...so it looks like example.com/2 It works perfectly in my Regular Expressions Tester (a firefox addon), so I'm not sure what gives. $link = preg_replace('~\/?\d*\/?$~', '', $link);
  18. Programming is a process that needs to be learned which is separate from the language. It is a unique way of thinking and problem solving. Once you master this, programming in any language is mostly about learning the API and unique quirks/methodology. This doesn't mean that if you master one language that you are Yoda of programming. Every language is a little bit different and still requires sufficient time to learn and become familiar with.
  19. This should be in here: http://www.phpfreaks.com/forums/index.php?board=107.0 Post what you are using for a cart system and relevant code and you will get a better response.
  20. If you want their script to hit off yours and the host doesn't allow it, then you can't do it. You could always go the other direction. Have a script that returns the key when you go to it and then use cURL on your end to go to that script. That's about as good as you're going to get. Just remember that you will never be able to truly make a closed source PHP application. Anyone can just remove whatever attempt you make at doing so.
  21. Can we see where $image came from?
  22. I didn't notice it was WP. Good luck with that bundle of joy.
  23. Why the {1}? You already have the dollar sign to indicate only the end of the string so no repetition criteria is necessary. @John_A: It may not be clear, but with scootstah's replacement solution you do not need to test if there is a -[digit] before trying to remove it. Just run the preg_replace() to remove the -[digit]. If it does not exist it won't be replaced. So, testing for it is a waste of code. For what it's worth, I would use this expression: $str = preg_replace('/-\d$/', '', $str); The \d is a character class for digit. My regex is mediocre at best. Thanks for the optimization.
  24. You should be splitting that data into separate tables instead of serializing it if you wish to perform searches and whatnot on it. It is loads more efficient for the database.
  25. Pretty much all of these free login tutorials have no security in mind whatsoever. So I would be cautious using them. From what I can tell the password does get an encryption and the tutorial allows for pages to only be viewed by users with the right user level. I am not saying that it would be the most secure thing to use and I would by no means use it long term but as a starting point to have a look at and play around with I think its OK. Saying that 'scootstah' has a point and most free tutorials are really only there as a starting point, not to be used as the final thing. At any-rate I hope it helps. I see what you're saying but I still think it is a waste of time. You will spend all that time learning a tutorial that you will then dump and move to something else, when you could have just started with the something else and learn it right the first time.
×
×
  • 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.