Going mad...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
nick2
Forum Contributor
Posts: 118
Joined: Fri Jul 25, 2003 2:34 pm

Going mad...

Post 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:
User avatar
nick2
Forum Contributor
Posts: 118
Joined: Fri Jul 25, 2003 2:34 pm

Post 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?
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

Code: Select all

$file = str_replace(".txt", "", $file);
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

html address should use forward slashes: http://www.bla.com/dir/file.ext
Post Reply