Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. Vague questions get vague answers. What is the formatting supposed to be and what is it showing?
  2. You don't need to use Javascript - it will just make the user experience a little nicer. Creating a blog is just basic PHP with MySQL interaction. Learn how to insert rows into a database, and retrieve them later and you have a blog.
  3. // set session_name session_name($uuid); // get session name session_name();
  4. padding.
  5. json_decode?
  6. http://namecheap.com of course. I think I'll keep my domains at GoDaddy for now. I don't like the fact that they support SOPA, but I can't really afford double the cost of my domains per year either.
  7. <div class="correctNotification"> Your password has been sent. <span class="close"></span> </div> .correctNotification .close { width:50px; height:50px; background:url(fotos/close.png); display:inline-block; } Then you can use an onclick event with the span.
  8. Use a function in the onSubmit event in the form element to disable the submit button.
  9. You could put it in a span or div and give that all those properties.
  10. What kind of sorting to do you want to do? You could use strtotime to make it a unix timestamp and then sort it that way.
  11. You mean like the background property?
  12. Why would you ever want to store dates in this fashion? Either use unix timestamps or MySQL's DATE/TIME/DATETIME. And to answer your question, sorting varchars that contain numbers doesn't yield good results.
  13. The code works for me.
  14. True, but there are other ways to prevent duplicate form submissions. What about AJAX forms? Using AJAX would change the CSRF token in the session but not the form, and then it wouldn't be valid.
  15. Usually this is done with cookies, with an expiration time of say 2 hours or something...so that you don't have to regenerate a token on every request. The main advantage of this is what if someone submits a form, and then refreshes and resubmits? Since it's a new request, you'd have a different token and it wouldn't work - and to me, this is extremely irritating. There are times when you want to resubmit a form.
  16. Seems to work: <?php $pattern = '~<a href="http:\/\/www\.site\.com\/page\.php\?action=p\&id=[0-9]+">[a-zA-Z]+<\/a>~i'; $text = 'So I would like to scrape a page to make a list of URLs. The source has lots of URLs in the following format: <a href="http://www.site.com/page.php?action=p&id=99">TEXT</a>, <a href="http://www.site.com/page.php?action=p&id=97">TEXT</a>, <a href="http://www.site.com/page.php?action=p&id=98">TEXT</a> and carries on in exactly the same format. Can someone help me with the code I need to scrape the page and extract just the links into a list using regex?'; if (preg_match_all($pattern, $text, $matches)) { echo '<pre>' . print_r($matches) . '</pre>'; }
  17. $files = glob('images/{*.gif, *.jpg, *.bmp}', GLOB_BRACE);
  18. Storing passwords in cookies is a big no-no. Especially with MD5...
  19. It is relatively common logic, but I'm not sure there is a specific name for it.
  20. It's not even in a loop, so I don't know what you're getting at. I still don't understand how 100 duplicated classes is okay but 100 switch cases is not.
  21. Why hide it?
  22. This looks pretty neat: http://extplorer.sourceforge.net/ Or maybe one of these: http://devsnippets.com/article/7-free-powerful-file-managers.html
  23. So why not do if (!file_exists("../images/upload/upimg/$folder")) { so that you make sure you are checking the right place?
  24. This isn't really true. There are plenty of common patterns and designs to use.
  25. But put a limit on it, so you don't have an infinite loop.
×
×
  • 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.