Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
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.
-
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; } ?>
-
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.
-
view index.php file from my machine?
Daniel0 replied to paulmo's topic in PHP Installation and Configuration
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. -
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
-
Change if (isset($_POST['tit']) || (isset($_POST['conte'])) to if (isset($_POST['tit']) || isset($_POST['conte']))
-
How often is it supposed to run? Perhaps it doesn't end before it starts again?
-
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.
-
<?php printf('%.0f', 1.34078079299E+154); ?> Output: 13407807929900000303292285556480489173702166434470022712912188298402309057064132476718872964460351551886434939009092324761906381094962708370334962038079488
-
Take this code for instance: <?php echo 1e5; ?> It will output: 100000
-
8 * 8 ≠ 16 8 * 8 = 64 Also, 1.34078079299E+154 is a number (cf. http://en.wikipedia.org/wiki/Scientific_notation#E_notation).
-
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.
-
$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);
-
Actually the behavior is correct.
-
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?
-
The 200 status code means everything is ok.
-
I'm sorry. You cannot encrypt things and let the user view it.
-
Well, you could do <?php $link = mysql_connect('localhost', 'user', 'pass'); mysql_select_db('database'); ?> And then include that file.
-
[SOLVED] ORDER BY Clause.....something is amiss here.
Daniel0 replied to maliary's topic in MySQL Help
Ah, I see what he was trying to do now. Disregard what I said above. -
Yes, but you should consider connecting in one file and then perhaps include that file.
-
Try what I have attached. I tested it on my computer and it worked. [attachment deleted by admin]
-
if($ip == 'ip1' || $ip == 'ip2') OR if(in_array($ip, array('ip1', 'ip2'))
-
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).