Settings

Theme

Show HN: Source small php page that shows the public source code of a Web page

umbcnow.com

3 points by Goldenromeo 10 years ago · 2 comments

Reader

GoldenromeoOP 10 years ago

Hi guys, I did this little self contained script in a little over a week to enhance my php knowledge.

Some problems I've found are: redirects and non 200 status codes.

I plan on redoing the whole thing in JavaScript or any other client side technology and add color coding.

krapp 10 years ago

PHP already has a filter (FILTER_VALIDATE_URL) for validating urls using filter_var[0], however, it doesn't work on international URLs. You can also break up a url with parse_url()[1]

You might also want to look into PHP's curl wrapper which is a lot more powerful[2].

[0]https://secure.php.net/manual/en/function.filter-var.php

[1]https://secure.php.net/manual/en/function.parse-url.php

[2]https://secure.php.net/manual/en/book.curl.php

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection