-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Unfortunately that doesn't completely secure you against SQL injections. Also consider that mysql_real_escape_string() returns a string, and you may sometimes wish to compare numeric data. Input validation should be performed on a per-input basis.
-
Edit: Try this: if (preg_match('#^/([^\s]+)\s(.+?)#', $input_str, $matches)) { print_r($matches); }
-
You mean to only return the first line? Just modify the reg exp slightly: #^/([^\s]+)\s([^\s]+)#
-
Provided there's no white space allowed within the username, you could use: if (preg_match('#^/([^\s]+)\s(.+?)$#', $input_str, $matches)) { print_r($matches); }
-
Sorry, missed the comma part. Rather than echo'in straight out, store the output in a variable and rtrim the end text off: $tags = explode(',', $tag_str); foreach ($tags as $tag) { $tag = trim($tag); $output .= '<a href="/search/'.$tag.'">'.$tag.'</a>, '; } $output = rtrim($output, ', ');
-
Do you mean to critique the functionality (better suited to the BETA test forums) or the look of it?
-
Review every external request made and you'll probably find your answer.
-
[SOLVED] If Condition iframe src ="example.php"
Adam replied to markvaughn2006's topic in PHP Coding Help
Yeah, quite easily: <?php if (your condition here) { $iframe_src = 'example.php'; } else { $iframe_src = 'different.php'; } ?> <iframe src="<?php echo $iframe_src; ?>"></iframe> -
You're using it wrong. These days you don't need to use addslashes / stripslashes for escaping your inputs for use within MySQL queries. mysql_real_escape_string does a much better job.
-
Take a look at GeoIP.
-
You could use: $tags = explode(',', $tag_str); foreach ($tags as $key => $tag) { $tag = trim($tag); echo "<a href=\"/search/$tag\">$tag</a>, "; if (($key +1) == count($tags)) { // do something different } }
-
[SOLVED] Favorite List, How to sort lots of numbers from one field?
Adam replied to olli460's topic in PHP Coding Help
$ids = explode(',', $id_str); foreach ($ids as $id) { echo trim($id) . '<br />'; } -
Yeah, a good method may be to offer similar websites a link swap. Try to aim for websites with higher PR than you as well, as I read somewhere 1 website linking to you with a PR of 5 is better than a hundred PR 1s - or something to that affect.
-
If the content is presented in the same way in both situations, the source of the data doesn't matter.
-
For me it starts with just "N" and the next letter appears about every 7 seconds.
-
Ah its's changed - must have been cached. Does look better, still though the background image is a little ugly and in your face. What's with the very slow scrolling title? Marquees and such are best avoided all together in my opinion. There's also a weird mouse over problem with the content, the background disappears. Definitely getting better though!
-
It's definitely coming along, but I think it's still missing a little something .. a mix of colors in my opinion. I'd see if you can squeeze a few more in there, even if it's just a shade of gray, it's better than all black. I think once you've got a bit more variety in there, you've done it!
-
Bit much.. It's supposed to be a 'background' image. The contrast between the text and the image is too much, and the text is centered still. The colors used for the nav menu don't match in. Why are the links 'users' and 'extra' stood out from the rest? You still have the scrolling text on the register page which is really annoying. The logo is very bland and plain, no imagery used at all. Basically what I think you need to do is make it look more.. boxed in. At the moment it looks like you've used drag 'n' drop software which gives it no flow or, readability. Should scrap this and start over.
-
Despite the bark of orders to 'find the solution' for you, you've given a big chunk of fairly complex looking code (may well not be) with little explanation and no code to show how these functions are called.. that I'm sure no one *wants* to work their way through and find what your problem is.. without a little please and thank you at least.
-
Heh, would help if we could see the pagination code... include("pagination.php");
-
[SOLVED] working with arrays - storing lots of information?
Adam replied to citricsquid's topic in PHP Coding Help
How exactly are they entering the data? You say they could enter up to 100 people, what would your form look like? -
[SOLVED] working with arrays - storing lots of information?
Adam replied to citricsquid's topic in PHP Coding Help
Well yeah, easily possible. Have you actually read up on arrays at all? http://uk2.php.net/manual/en/function.array.php -
Ha Yes, definitely! The best defense is a good offense!
-
Hahah! http://www.slightlywarped.com/crapfactory/curiosities/2009/rollercoasterfunnies.htm
-
Uh yeah, but something has to trigger the change after the page has loaded. Ey? I think what DEVILofDARKNESS was meaning was to manually edit each file, as opposed to a single template that you just edit once?