Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. You might want to encrypt the password which is stored in the database and use some sort of salt to significantly complicate brute-forcing and dictionary attacks if somebody in a way would get access to the user table.
  2. Try <?php $tracks = new SimpleXMLElement('http://ws.audioscrobbler.com/1.0/user/ronniebrown/recenttracks.xml', null, true); foreach($tracks as $track) { echo <<<EOF Name: {$track->name}<br /> Artist: {$track->artist}<br /> <a href='{$track->url}'>{$track->url}</a> <hr /> EOF; } ?>
  3. If you're using PHP 5 (which you should be!) then I've written a tutorial which explains how to parse XML data using PHP: http://www.phpfreaks.com/tutorials/155/0.php It shouldn't be too hard to follow.
  4. For that you'll need to install Apache and PHP on your computer (MySQL would be a good idea as well). A combination of Windows, Apache, PHP and MySQL is abbreviated WAMP. Similarly is Apache, PHP and MySQL on Linux called LAMP. You can choose to install a WAMP software bundle yourself by installing the individual components manually or you can choose a packaged solution which will install everything for you. A popular one seems to be xampp but there is a comparison of some WAMPs here: http://en.wikipedia.org/wiki/Comparison_of_WAMPs When you have that installed you'll place your PHP file within a folder called the "document root" and then you can access it by going to http://localhost or http://127.0.0.1. The document root can differ. It can be something like C:\apache2\htdocs on Windows and /home/user/public_html or /var/www on Linux. If you choose a packaged solution consult the readme file or documentation for more detailed information.
  5. Although I agree with thorpe, that specific error (unexpected $end) is not particularly descriptive. See: http://www.phpfreaks.com/forums/index.php/topic,100473.0.html
  6. Change if (isset($_POST['tit']) || (isset($_POST['conte'])) to if (isset($_POST['tit']) || isset($_POST['conte']))
  7. Daniel0

    [SOLVED] Cron Job

    How often is it supposed to run? Perhaps it doesn't end before it starts again?
  8. You can think of it a bit like taxonomic ranks in biological classification. E.g. there can be multiple families under a specific class, but a family can only belong to one class.
  9. I can't see anything either. Are there any newer version? It said so the version you have is almost a year old.
  10. <?php printf('%.0f', 1.34078079299E+154); ?> Output: 13407807929900000303292285556480489173702166434470022712912188298402309057064132476718872964460351551886434939009092324761906381094962708370334962038079488
  11. Take this code for instance: <?php echo 1e5; ?> It will output: 100000
  12. 8 * 8 ≠ 16 8 * 8 = 64 Also, 1.34078079299E+154 is a number (cf. http://en.wikipedia.org/wiki/Scientific_notation#E_notation).
  13. That's because I simply wrote the for loop as a replacement for your while loop. The problem still persists with the for loop as explained by revraz. I suppose I should have pointed that out. Yes.
  14. $i is set by the for loop ($i = 0;). $i++ increments $i with 1 (it's equal to $i += 1 which is similar to $i = $i + 1). pow() is a function for exponential expressions. I.e. you can achieve what you want like this: $power = pow(2, 10);
  15. Actually the behavior is correct.
  16. In this case a for loop would be better: $level = 10; $power = 1; for($i = 0; $i < $level; $i++) { if($power == 1) { $power += 1; } else { $power *= $power; } } Why not just use pow() though?
  17. The 200 status code means everything is ok.
  18. I'm sorry. You cannot encrypt things and let the user view it.
  19. Yes.
  20. Well, you could do <?php $link = mysql_connect('localhost', 'user', 'pass'); mysql_select_db('database'); ?> And then include that file.
  21. Ah, I see what he was trying to do now. Disregard what I said above.
  22. Yes, but you should consider connecting in one file and then perhaps include that file.
  23. Try what I have attached. I tested it on my computer and it worked. [attachment deleted by admin]
  24. if($ip == 'ip1' || $ip == 'ip2') OR if(in_array($ip, array('ip1', 'ip2'))
  25. All your input tags look something like this: <input name="message" type="text" Also, don't use the marquee tag. There is hardly a tag more annoying (well, maybe blink).
×
×
  • 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.