Jump to content

PHP and MySQL - Not pulling correct filename


rwachowiak

Recommended Posts

it was working before, but now for some reason this script is not adding the spaces in the file name when you click the download link... heres the script:

 

		// this variable has an if statement built in. (If Key is not found, set keyword to tax, otherwise set to keyword given.
	$Keyword1 = (isset($_GET['Key']))? mysql_escape_string($_GET['Key']) : "Tax";
	$query  = "SELECT * FROM files WHERE Keyword1 = '$Keyword1' OR Keyword2 = '$Keyword1'";
	$result = mysql_query($query);

	while($row = mysql_fetch_array($result, MYSQL_ASSOC))
	{
echo 	"<span class='titlebar3'>File Name:</span>    <span class='titlebar3'><a href='index2.php?id={$row['id']}'>{$row['Filename']}</a></span> <br>" .
	"<span class='titlebar2'>Keywords:</span> <span class='description'>{$row['Keyword1']}, {$row['Keyword2']}</span> <br>" .
	"<span class='titlebar2'>Description:</span> <span class='description'>{$row['Description']}</span> <br>" .
	"<span class='titlebar2'>Date Added:</span> <span class='description'>{$row['DateAdded']}</span> <br><br>";
	}
	include 'libs/dbclose.php';
	?>

 

Say i try and download "Equipment Log.xls" it downloads "Equipment" but if i try "notes.txt" it will download "notes.txt"

 

any ideas?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.