Hello,
I have an array called $array_of_files.
I want to echo each element of that array as a link to itself.
That way when I click on an element I can send it as an actual value
Here's my code:
for ($counter = 0; $counter < count($array_of_files); $counter++)
{
$category = $array_of_files[$counter];
echo "<a href='$category'>$category</a><br>";
}
exit;
}
Here's an example of the variable $category before I place it in the <a
href>:
/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/php/categories/links1.txt
Once I place the variable $category inside the <a href> statement it
looks like this:
http://www.myserver.com/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/php/categories/links1.txt
Why is it the <a href> adds 'http://www.myserver.com' to the front of
the value of $category?
I worked around this by placing '?file=$category' in the echo statement
above. Just wondered if anyone had any better way to do this...
Thanks in advance,
Roger
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php