rwachowiak Posted March 10, 2008 Share Posted March 10, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/95463-php-and-mysql-not-pulling-correct-filename/ Share on other sites More sharing options...
rwachowiak Posted March 10, 2008 Author Share Posted March 10, 2008 update: downloading "Equipment Log.xls" in firefox gives: "Equipment" with no extension... and in IE8, it gives "Equipment_Log.xls" HMMMMMM im gonna go test with IE7 brb Quote Link to comment https://forums.phpfreaks.com/topic/95463-php-and-mysql-not-pulling-correct-filename/#findComment-488720 Share on other sites More sharing options...
MadTechie Posted March 10, 2008 Share Posted March 10, 2008 that code has nothing to do with the download from what i can see.. your probably need to urlencode the filename or your not quoting it in the header! Quote Link to comment https://forums.phpfreaks.com/topic/95463-php-and-mysql-not-pulling-correct-filename/#findComment-488724 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.