Page 1 of 1

Going mad...

Posted: Fri Jul 25, 2003 7:07 pm
by nick2
sorry for third thread.. but I am going mad.. i am tryng to display this link correctly as:

/php/Serverlist/data/file.txt

but this code:

Code: Select all

<?php
echo "<a href=\php\Serverlist\data"\$file">$file</a><br />\n";
?>
gives me errors and when i do get the parsing right it gives me:
/php/Serverlist/data"file.txt"


help would be greatful.. i tried over 50 different ways.. for half anhour!! :evil:

Posted: Fri Jul 25, 2003 7:54 pm
by nick2
i found out how to fix it.. before the " $file

you put foward slash / instead of a blackslash...

only took 2 hours to find out by myself.

anyway does any1 know how to remove the .txt exstention?

Posted: Fri Jul 25, 2003 8:05 pm
by qads

Code: Select all

$file = str_replace(".txt", "", $file);

Posted: Fri Jul 25, 2003 9:44 pm
by evilcoder
html address should use forward slashes: http://www.bla.com/dir/file.ext