I make finally crossing-over to the PHP world in order to accomplish what I need to do.
I'm seeking to develop two scripts that will:
1) take user form input (a url) and write it to text (a list of urls)
2) take the urls in the text file and convert each into string to be stored in an array.
So far I think I've produced a semi-functional 1) but I'm having a hell of a time with 2).
Here's my code for the 1) script:
<?PHP
$filename = "url_list.txt";
$text = "\n" . $_POST['url1'];
$fp = fopen ($filename, 'a');
if ($fp) {
fwrite ($fp, $text);
fclose ($fp);
}
else
{
echo ("URL was not written!");
}
/* Re-direct to Index */
header("Location: index.php");
exit;
?>
Feel free to criticize it.What I'm having trouble with is accomplishing number 2)
Anyone know how?


Sign In
Create Account

Back to top









