Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. Still regular expressions. $str = 'ghi-jkl-4567-1'; preg_replace('/-[0-9]{1}$/', '', $str);
  2. Pretty much all of these free login tutorials have no security in mind whatsoever. So I would be cautious using them.
  3. Regular expressions. $str = 'ghi-jkl-4567-1'; if (preg_match('/-[0-9]{1}$/', $str)) { echo 'match'; }
  4. varchar and text can store the same kinds of data, there should be no issue there. The only thing I could see being an issue is the amount of characters allotted to varchar.
  5. It helps massively to have a good IDE that has code highlighting... much easier to spot little syntax errors like that.
  6. No it shouldn't. mysql_query() returns a resource. To return a result you need to use one of the fetch functions. $sql = " SELECT COUNT(URL) AS count FROM gw_geog WHERE URL = '$MyURL' "; $sql_result = mysql_query($sql,$conn); $result = mysql_fetch_assoc($sql_result); // DO SOMETHING WITH THE RESULTS switch ($result['count'])
  7. Well, he did this: Since neither domain can access public_html directly now, he should be okay.
  8. Then don't. This is why libraries exist. Find something that is already battle tested and use it in your app. Perhaps you can port a user auth library from some of the popular frameworks. Ion auth is simple and secure.
  9. Then ask more specific questions. We aren't here to Google things for you. Where are you stuck?
  10. Is $target_path writable by the server?
  11. Back in the day, Geocities had one. It sucked. So did Homestead, and a whole bunch of others. They've mostly all died because Dreamweaver pretty much dominated the WYSIWYG market.
  12. You have a syntax error in your query. fab2 = '$fab2' , fab3 = fab3' , non = '$non' Should be: fab2 = '$fab2' , fab3 = '$fab3' , non = '$non'
  13. We're not going to write it for you. So you'd be better off posting what the problem is and we can help to resolve it.
  14. For the same content, yes. But it looks like he has changed the root for each domain so they no longer point to the same content.
  15. http://bit.ly/AueG5p
  16. http://phpsec.org/projects/guide/4.html
  17. What does $_FILES['softwarePath']['error'] give you?
  18. If you want to store the array, use serialize()
  19. Why would that matter? Google will just treat it as an external link.
  20. Are you sure this data needs to be saved? Could you not just work on the current request? Anyway, if you are storing this is a varchar you need quotes in the value. INSERT INTO table (data) VALUES ('1,2,3,4,5')
  21. You are needlessly accessing the database way too much. Like Psycho said, you can do mostly everything with just sessions. The sessions aren't going to change, so they are perfectly reliable. User authentication is risky business. It's easy to get wrong, easy to inadvertently create security holes. If you don't know what you are doing, it is best to use someone elses library that has already been under extreme scrutiny. Maybe take a look at how some of the popular frameworks do authentication. Here is an example to get you started: Ion Auth Ion auth is pretty simple, so it shouldn't be too hard to pickup the logic.
  22. Then just write the function to the file. file_put_contents('file.php', '<?php function blah() { echo "hello world" } ?>');
  23. I would save the new data to a database. That way you can compare it later and graph it out or whatever.
  24. Set the cookie to the past. setcookie('cookie', '', time()-60); Note that you can't force a cookie, the browser chooses to accept it or not.
×
×
  • 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.