Problem

Started on the old forum in February 2011 · view the original in the archive · old links redirect here

2 replies · 396 views · started 15 years ago · 1 min read

3 participants
alin90 Junior · 31 posts #1

Hi, I want to modify the header of a script, when i am downloading a file, in header( to be seo friendly, in description and key words to display the name of th file . but i cannot figure what is wrong pls corect me where i am wrong

$file = intval(trim($_GET['file']));
$file1 = mysql_query("select * from `download` where type = 'file' and id = '" . $file . "';");
    echo "\n" . '<meta name="description" content="free download 2011 ' . $file1['name'] . '" />';

Ps. is john cms 4.0

frostymarvelous Senior · 266 posts #3

You need to fetch the data in the query.

$file1 = mysql_fetch_assoc($file1); 
Echo $file1['name']; 

Btw. Filter your input better. You could run is_numeric() on it. Always make sure the value is in the format you want.

Perfection comes at a cost

I accept liberty!

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close