Oh you could use preg_replace() with some regular expression trickery...
Roberdin 9 Supreme Evil Overlord Team Colleague
Roberdin 9 Supreme Evil Overlord Team Colleague
Oh you could use preg_replace() with some regular expression trickery...
htmlentities()
Go to downloads... downlaod what you need... absolutely free and open source.
PHP is compiled at run time. The Zend Optimiser merely cleans up the code to make it compile faster... but it is always compiled at run time; ie, when a user accesses the webpage.
Could we see the code for this report?
You've missed out a dot between the "surname" and the $surname.
But... why not just have "Surname: $surname Firstname: $first_name" etc rather than bothering with the dots... otherwise you're wasting resources.
Due to a restriction in the HTTP Protocol, YOU HAVE TO SEND COOKIES AND OTHER HEADER DATA BEFORE ANY OUTPUT. The best way I can think of doing that without to many drastic changes would be to move the first php line to the very top. If that chnges the overall output, then put it back and add <?php ob_start(); ?> to the very top, which tells PHP to hold onto output until ob_flush(), ob_end() or the end of the script is encountered, thereby allowing you to define cookies where you want. BTW, ob stands for Output Buffering, in case you were interested.
Books can only take you so far, and they're often quite outdated - though I'm surprised that it's assuming request (sent in forms, urls, cookies) variables have been assigned to normal variables automatically. It's been default not to since PHP4, and the PHP people have been blathering on about it since early PHP3.
But anyway, just come back here if ya need any more help.
ok, have you covered arrays? I will assume you have for the moment. Otherwise, the following will only confuse you. :p
AFAIK, as is only used in a foreach() statement.
Let's say that you have an array of people's names and that you want to correctly capitalise each name (for the moment we'll exclude Scottish People who are McSomething for simplicty).
One way of doing it, would be as follows.
/* The names are defined below. I prefer to write arrays out like that to ensure they're easy to read, but the format is up to personal preference. Because you may have a different monitor size to me, I'm using /* instead of // to comment. (So you can see that all this is actually supposed to be one line) */
$people = array(
'JAsmine',
'cROwsteN',
'sylvester',
'aPple',
'Snoopy'
);
/* Next, we want to look at each item in the list and correct the capitialisation. */
foreach( $people as $person )
{
/* What's happened here? Well, this is a special kind of loop that loops through each item in the array $people, and assigns the value each time to $person. So, the first time this loops, $person will be equal to 'JAsmine'. The next; 'cROwsteN', and so forth. */
echo '<br />Person: ' . ucfirst(strtolower($person));
/*That essentially turns the value of $person to completely lower case (strtolower) and then changes the first letter to upper case (ucfirst), the echos it following '<br />Person: '. */ …
Well it's no doubt because the server administrator is sane.
Try changing $username to $_POST. By default PHP won't assign external variables passed through forms, cookies, and URLs for security reasons. It's pretty obvious why - otherwise, anyone who had seen the script (or who hadn't and was just guessing) could add something like &admin=1 or something and find themselves granted admin access. Additionally, it means that you can tell where the varibales came from - be a form ($_POST), a URL ($_GET), or a cookie ($_COOKIE).
Note, however, that if your form's method is set to get instead of post, that you'll need to retreive the variable through $_GET. But this will rarely, if ever, be an issue.
some guy's big
u got a 1280x1024 version of the above wall paper?
u could encrypt the password
I try to get people to sign up, but mostly so they'll stop bothering me and go away rather than to help Daniweb prosper. :P But, of course they're all far too lazy to do that . *me grumbles some more*
I am planning to buy more RAM, but I prefer to buy as much as I can at once, on the same stick, because I only have a couple of slots left. But thanks for the tips. :)
a terrible 256MB ram and now 3GB swap.
But before you all gut me for having a huge and probably mostly empty swap (;)), I've decided that a format and reinstall is probably the best solution anyway.
Flame > Smoke
Actually, it does seem to have made a significant improvement - before when I played Rise of Nations over the net, it was very jittery, subject to constant freezes of varying length, most eventually threw me out of the game. However, I've just played it after donating a 3GB partition on my second drive to the swap (and removing the swap on my primary partition), and there were only a couple of freezes and none of any significant length at all.
But perhaps it was just a conincidence. I'll inform you of how this turns out in the long run sometime.
Are you supposed to have a directory structure in the remote file?
done all of them. No effect. And I need that second harddrive for when i want to test MS Longhorn.
Well if you wanna be like that, you should have included some alt text. :P
Besides, come to think of it, there's anotherr new standard which is something like <object type="image/gif" src="smilie.gif" alt="Smile!" />
I currently have two Hard discs on the same IDE channel thingy. One's 120GB, which I use for my current OS. On the Slave, I have a 40GB harddisc, which i don't really use at all.
It seems logical to me to move the Swap over to the 40GB one, especially as my Computer seems to have gotten very slow recently (would buy new RAM, but i'm looking for a cheapass solution here ;) ). Are there any disadvantages to that?
Make sure your code is compatible with more browsers than just IE. And Dani, the code should be: <img src="smiley.gif" /> :p :)
celebrate -> celebrations
(Am I allowed to do that? :P)
It might be more helpful just go get phpMyAdmin. It's completely free, and offers all the facillities you desire (and lots more).
And I thought you were the pc gal. You disappoint me Dani...
:P
While this goes against my general feelings about it, you'd be well advised to steer clear of phpBB for a while, because it's rather outdated and lacks features such as subfora that most other board software has supported for a while. (Though, a new version is close to completion that will offer those kind of features and more besides, and obviously old versions are upgradable).
Cat ---> Dog
only idiots have register globals enabled. And obviously it's best to be content specfic, eg $send_mail or whatever.
can't u move that \ ?
or prefeably, true or false. Then, it's just a matter of
if( $send )
{
// send
}
Here's the problem:
$to ="[email="you@yourdomain.com"]you@yourdomain.com[/email]";
Change to (and change the you@yourdomain.com appropriately)
$to ='[email="you@yourdomain.com"]you@yourdomain.com[/email]';
and I will add that the script is unecessarily resource intensive; hard to follow due to improper indentation and using " where ' would have been preferable; doesn't teach how variables and strings ARE different (you don't need to and shouldn't put a variable inside a string on it own); uses outdated and depreciated HTML standards (without even a <!DOCTYPE>); and doesn't use TRUE and FALSE definitions ( $send = "no"!? What kind of rubbish is that? )
Harmless or Required?!
I've run dozens of scans on dozens of PCs and have always remeoved everything I find and it's done nothing but good.
ergh. That is pehaps the worst script I've seen in a long time.
Comics > Cartoons
echo "<table cellpadding="2" cellspacing="2" border="1" style="text-align: left; width: 400px;">
The problem is that you're using double quotes inside double quotes (and you also forgot to end the statement properly). PHP thinks you've finished echoing, when you obviously haven't. Just change the outer pair to single quotes, like so:
echo '<table cellpadding="2" cellspacing="2" border="1" style="text-align: left; width: 400px;">
and obviously the closing ".; to '; (why was that . there in the first place??)
Another solution is slightly simpler - get rid of the echo altogether, and close the php with ?> just before your table code, and <?php again afterwards.
Infact, I recommend you only use double quotes when neccessarily, as they add to execution time - the difference is as follows:
$var = 'cool';
echo "The var is: $var"; // It returns: The Var is: cool
echo 'The var is: $var'; // It returns: The Var is: $var
So, with double quotes, the parser checks for any variables inside, which very slightly slows things down.
Doesn't look like it would take me more than a few minutes to pick this langauge up, but then I've been programming in php, which is very close to C++, for years.
...what's wrong with addslashes()? It add slashes to already existing slashes
Smoking -> Cancer
Uh huh
it sounds like it's missing an extention. You could try adding a few, and see if any work.
Some claim that God is punishing use for Ede's sins (ie: eating the apple). Others claim that we cannot appreciate heaven without first expierencing evil.
It's NOT encryption. It's a hash. That means that it's not mathematically possible to decrypt an md5() encoded string. MD5() is designed to be a secure way of storting data for authentication, not for encryption. So, yes, a few times the same hash will come up for more than one string. But it's highly unlikely that you'll find more than one, and they would have to be so drastically different that they'd never be used in the same context anyway.
No probs.
Actually that isn't too secure - you may wish to change
$starting_letter = $_GET;
to
$starting_letter = addslashes($_GET);
Do u mean a mysql table?
Try something like this
Letters:
<a href="<?php echo $PHP_SELF; ?>?letter=a">A</a>
<a href="<?php echo $PHP_SELF; ?>?letter=b">B</a>
<a href="<?php echo $PHP_SELF; ?>?letter=c">C</a>
...
<a href="<?php echo $PHP_SELF; ?>?letter=z">Z</a> <br /><br />
<?php
// Connect to DB... blah blah blah
$db_host = 'localhost'; // Probably OK
$db_user = 'Bob'; // Change to your MySQL Username
$db_pass = 'bar'; // Change to your MySQL Password
$db_name = 'database'; // Change to your MySQL Database name
$db_connect = mysql_connect($db_host, $db_user, $db_pass);
$db = mysql_select_db($db_name);
// END DB Connection
// Find the letter=whatever stuff in the URL and assign it to
// the $starting_letter variable
$starting_letter = $_GET['letter'];
// Create + execute SQL
$sql = "SELECT * FROM clans
WHERE LEFT(name, 1) = '$starting_letter'";
$result = mysql_query($sql);
// While there are results, keep looping...
while( $row = mysql_fetch_assoc($result) )
{
// Echo the results...
echo 'Clan: <a href="' . $row['url'] . '">' . $row['name'] . '</a><br />';
echo '<img src="' . $row['logo'] . '" /><br />';
echo $row['description'] . '<br /><br />';
}
// End
?>
Also, if you share your computer amongst multiple users, you can restrict access to certain files and folders to yourself only, for example.
gud gud
Hmmm, you could download, install Apache, spend three hours poking it until it works, then setup PHP, go back to poking Apache, and learn how to do some absic PHP scripting, and persuade your host to install it.... or you could do this:
<script type="text/html" src="header.htm"></script>
and
<script type="text/html" src="footer.htm"></script>
Ah we all know you meant me really :p
Remember that php is a run-time interpretted language so everything, including the stuff within if() blocks is parsed during page execution, and that vB can afford to have very powerful servers - they hardly want to look slow on their own site ;)
However, I must admit that the new vBulliten theme looks much better than before, though having vB in half the icons is slightly annoying - I want to know that a forum contains new topics, subforums, or is locked, not that it is powered by vB. :P
Dani did this just to annoy me. :P
While I agree that phpBB 2.0.x offers few features that most other boards offer, it's important to keep in perspective that it's quite old - several years or more in fact. phpBB 2.2, the newest version they plan to release, offers many more features, in fact practically all those that most people require of a forum (including some new ones that neither vB or IPB offer ;)). But the developers been very careful not to "overburden" the software - they like to think of it strictly of forum software, and therefore decline to add features such as calendars and so forth - this means that phpBB 2.1 (development version of 2.2, as per Linux Version Numbering Scheme) runs very quickly compared to say, vB, which has every feature under the sun thrown in ;).
Though one thing I might add is that subSilver, the phpBB default style looks far more "professional" than vB's. But that's just a matter of opinion.
Alternatively provide it as a download on your site so that when opened it opens in the browser window.