Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. Although Spain did a wonderful job, Germany had to win
  2. Only works if you have the SUPER privilege, you don't want to use this account. Instead use SET time_zone = 'Europe/Stockholm' Which sets the time_zone per session. You can however login to your mysql server using the SUPER-account and change the time_zone using the GLOBAL-keyword so you don't have to declare it in your application.
  3. Alex code creates this: Array( [0] => user1, [1] => user1, .., [11] => user1, [12] => user2, [13] => user3, .. [55] => user3, [56] => user4, .. [62] => user4 ) Then shuffle's the array and prints out the first one. You could also do: print $pot[ array_rand($pot) ]; // winner
  4. Something along the lines of: function get_all_href($URL,$recursive=true){ $links=array(); $html=new DOMDocument(); if($html->load($URL)){ $xpath=new DOMXPath($html); foreach($xpath->query('//a') as $a){ $links[]=$a->getAttribute('href'); if($recursive) $links_r=__FUNCTION__($a->getAttribute('href'),$recursive); $links+=$links_r; } } return $links; } foreach(get_all_href('http://domain/path') as $href){ echo $href,'<br>'; }
  5. ignace

    No Dupes

    Nope, don't print them store them in an array. At the end of your function do a check for duplicates.
  6. http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
  7. So if you want to limit access to your website for you (82.16.15.78) and 2 of your friends (86.57.15.63, 87.15.75.98) is more then the rest of the internet (~4 billion, as only your friends are allowed) to cycle through?
  8. Would it not be easier to create a whitelist instead of a blacklist as it's about a few select users?
  9. I have no idea what you mean by that, here's a link to the wikipedia article on NoSQL
  10. First off SE like Google do not use MySQL they use a "NoSQL"-alternative like BigTable. Second their DB structure is not normalized (or not much) for performance.
  11. p{float:left;width:600px;}/** total-width-100(+padding+margin+border)=width **/ img{float:right;width:100px;height:100px;} #mainbox{overflow:hidden;}/** assuming #mainbox is the parent of p+img **/
  12. Store everyone's session in the database along with their user name, then if someone is acting suspicious just delete his session so that on the next request he needs to log-in again. Or ban him and then log him out.
  13. 1. How to call two database at the same time? Pass the value TRUE for $new_link $db1 = mysql_connect(host, username, password, TRUE); $db2 = mysql_connect(host, username, password, TRUE); Or if you literally mean two databases, either: mysql_select_db('...'); //do stuff mysql_select_db('...'); // do stuff Or mysql_query('SELECT .. FROM database.table WHERE ..'); mysql_query('SELECT .. FROM database2.table2 WHERE ..'); 2. How to use one form to write to two databases? Same as above 3. How to login to two scripts with one form? Point to one script that will call both login procedures, you can however still only use one session so on each successful login you will have one obsolete session identifier (possible threat for session hijacking?)
  14. LOL I'll tell my Firefox to send a IE user-agent header
  15. If you have RoR experience it would be best to switch to Symfony otherwise I would suggest Kohana as it's a fork of CodeIgniter. As you have little time to learn a new framework I do not recommend you go for Zend framework, the learning is pretty steep and if you haven't got any idea of most, if not all, OO patterns you'll find yourself in way over your head. However, if you are not planning on using Zend framework as a full-stack framework (use Zend_Application, Zend_Controller, Zend_View) you can still benefit from most of their supplied components like Zend_Form, Zend_Auth, .. The good thing about the Zend framework is that it plays well with other frameworks, Zend_Loader for example can load your CodeIgniter/Kohana libraries. While developing your application consider Zend framework components to speed-up your development. Try them and see if you can get them to work (in a reasonable amount of minutes/hours) the way you want them to, if you can't no problem as you can just fall-back to your base framework.
  16. You have the gap due your floated div's being larger then the parent element. Rule of thumb: width + padding + border + margin = totalwidth Count the totalwidth for both div's and you'll see you'll have a number greater then the width of your parent element. Open firebug, hit the HTML tab, then hit the markup tab on your right.
  17. There are no books or tutorials (?) out there that teach you how to write a Facebook clone simply because any novice would not be able to comprehend most (if not all) taught stuff.
  18. <div id="wrapper"> <div id="dead-center">dead centered</div> </div> #dead-center { position: absolute; left: 50%; width: 300px; margin-left: -150px; top: 50%; height: 200px; margin-top: -100px; }
  19. In that case Dreamweaver CS5 for Dummies Not going back?
  20. Alex's code was a joke, only you didn't see it that way. If you run his code you'll notice the page keeps loading.. and loading.. and loading... until by coincidence it hits 73
  21. Reverse your thinking, create a view helper pass the appropriate models they will do the actual rendering.
  22. In one e-mail? Or is this a global limit that you can't send to more then 300 people?
×
×
  • 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.