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
/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?
It is the browser trying to help by completing what it sees as a relative link.

I worked around this by placing '?file=$category' in the echo statement
above.  Just wondered if anyone had any better way to do this...
Looks like an excellent way.

Other ways might include making associated arrays but i see no reason to do it differently.

By the way, i don't know what you do with the rest of the code but what happens if some joker links to
'?file=etc/passwd' ?




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to