Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. [quote author=thorpe link=topic=109038.msg441036#msg441036 date=1159200568] yeah. nl2br doesnt replace new lines, merely adds a <br /> tag before it. However, Daniel0 is also partly correct in that windows, Linux and Mac all handle newlines differently. To replacate this function you'd need to use regular expressions which Im freaking hopeless at. [/quote] This function would do it. [code]<?php function my_nl2br($string) { return preg_replace("/(\r\n|\r|\n)/","<br />",$string); } ?>[/code]
  2. New functions are added to PHP5, and PHP5 has better OOP.
  3. The difference between those codes you showed is that the user will see a space between the images in example 2, but not in example 1.
  4. To help you, make an infinite loop, that should make it run forever (do not run it from the browser, but from cli).
  5. [quote author=thorpe link=topic=109541.msg441690#msg441690 date=1159280861] You set $price youself so if (isset($price)) will always be true. As for why it always finds a $, why are you using preg_match? A simple.... [code=php:0] if ($price{0} == "$") { [/code] would suffice. [/quote] Cool... thats sort of like Python. Where can you read more about that?
  6. How would that be illegal? Is it illegal if the browser caches the files then?
  7. [quote author=448191 link=topic=109169.msg441673#msg441673 date=1159279981] On a sidenote, my bank uses some sort of browser plugin, know what that might do? [/quote] You probably have some key stored on your computer that the bank verifies over a secure connection.
  8. The only email I have is my Gmail, and I use the web interface for it. On Windows I would probably use Microsoft Outlook 2007 Beta 2, and on Linux I would use Thunderbird.
  9. I just said that if anything would be "Web 2.0" it would be if how the internet works is changed. I never said it will/can/did.
  10. [quote author=steelmanronald06 link=topic=109270.msg441275#msg441275 date=1159216632] The internet is the internet, no questions asked ;) [/quote] If something changes, then it's not the same as before, therefor a new version...
  11. [code]<?php function parse_url_bbcode($string) { $string = preg_replace("/\[url\](.*)\[\/url\]/","<a href='\\1'>\\1</a>",$string); $string = preg_replace("/\[url=(.*)\](.*)\[\/url\]/","<a href='\\1'>\\2</a>",$string); return $string; } echo parse_url_bbcode("[url=http://phpfreaks.com/forums]PHP Freaks[/url]")."<br />\n"; echo parse_url_bbcode("[url]http://phpfreaks.com[/url]"); ?>[/code] The output would be: [code]<a href='http://phpfreaks.com/forums'>PHP Freaks</a><br /> <a href='http://phpfreaks.com'>http://phpfreaks.com</a>[/code]
  12. Jenk, I think you missed the point. You are right that obscurity != security, but the security here do not depend on the obscurity, it just makes it harder for the hacker.
  13. What could actually be a real "Web 2.0" would be if a new protocol was made to replace the current one.
  14. I think it has been like that in quite a while, but I was not sure so I had to verify it by creating a document and validate it. I'm not sure if it is like that in XHTML 1.0 Transitional, but I personally think that you should use the latest version.
  15. No. You would have to change the flash file. I do not know if flash files can have GET parameters, if it can, then you could use that to style the player.
  16. Ehhh, no it doesn't. Try to look at this: http://validator.w3.org/check?uri=http://xaos-ia.com/do_not_validate.html&ss=1 [quote]You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>) or forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes).[/quote]
  17. Have a look at [url=http://php.net/set_error_handler]set_error_handler()[/url] and [url=http://php.net/error_log]error_log()[/url].
  18. Something like this should do it: [code]<?php //... while($u = mysql_fetch_assoc($result)) { echo <<<EOF <p>{$u['username']} <button type="button" onclick="this.href='http://example.com/admin/index.php?act=members&func=delete&id={$u['id']}'">Delete</button></p> EOF; } //... ?> [/code]
  19. I would say bad since [code]<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>test</title> </head> <body> Hello </body> </html>[/code] do [i]not[/i] validate.
  20. [quote author=Jenk link=topic=109169.msg441079#msg441079 date=1159202760] User browses your site in Firefox, now they open IE. Banned. [/quote] No, the session would just not work. The user could log in again. [quote author=Jenk link=topic=109169.msg441079#msg441079 date=1159202760] User has a dynamic IP address, they get discconected and reconnect in the middle of a session. Banned. [/quote] You could check for IP range. Besides, who said anything about banning? The session would just not work if the data didn't match.
  21. You could use third-party commercial products that will encode your source.
  22. I don't believe you could in no possible way be offended by anything he might say.
  23. What do you mean? ???
  24. thorpe, I think what he wants is to run it on an installed operating system, not booting into it.
  25. What is the big deal about this? So what if somebody pretends to be Googlebot. I don't suppose that you grant Googlebot administrative privileges in your applications, so there wouldn't really be any idea in changing your HTTP_USER_AGENT to Googlebot.
×
×
  • 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.