PHP and MySQL

For about the last 2 months or so I've been learning PHP and MySQL to create server side scripting for Web sites with a database backend. Let me just say that this has been very fun and challenging at the same time. I have written a quiz that tracks who takes the quiz and what their answers are. I have written a Web crawler that will crawl a site for Hyperlinks and put them onto the Web page (useful if you want to start a search engine or if you're harvesting links for a database). I wanted to get started with JSP with a Tomcat Web Server but I've been having issues with it. Someone at school suggested that I try PHP. I found a great book called "Build Your Own Database Driven Website Using PHP and MySQL" by Kevin Yank. It can be found at http://www.sitepoint.com/books/phpmysql1/

Here is the code for my Web Crawler:


/
<html>
<head><title>Web Crawler</title></head>
<body>
<form id="form1" method="post" action="">
<label>URL:
<input name="url" type="text" id="url" value="<?php $url; ?>" size="65" maxlength="255" />
</label>
<br
/>
<br />
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
<label>
<input name="Reset" type="reset" id="Reset" value="Reset"
/>
</label>
<br
/>
</form>
<
/body>
</html>
<?php
if (isset($_POST['url'])) {
$url = $_POST['url'];
$f = @fopen($url,"r");
while( $buf = fgets($f,1024) )
{
$buf = fgets($f, 4096);
preg_match_all("
/<\s*a\s+[^>]*href\s*=\s*[\"']?([^\"' >]+)[\"' >]/isU",$buf,$words);
for( $i = 0; $words[$i]; $i++ )
{
for( $j = 0; $words[$i][$j]; $j++ )
{
$cur_word = strtolower($words[$i][$j]);
print "$cur_word<br>";
}
}
}
}
?>