Forum Moderators: coopster
I really have myh work cut out for me because my customer does not want to spend the $$ on a comercial solution.. dont even get me started!
The problem i am havin is that that I am trying to add custom metadata to the page. IE:
<meta name="if.classification" content="unclassfied">
<meta name="if.postdata" content="01232004">
I have like 35 of these.
I am using a form for the user to place the appropirate information in a mysql database.
The problem is how do i call these values from the database? How do i define these values andplace them into the content="" area?
like this:
<meta name="if.classification" content="$if.classification">
I tried this once.. but it makes it literal.
I will take any help i can get ... but I am not that seasoned ... so I ask you to please be descriptive...
Thanks much for any help...
Terry
The context of your code isn't clear to me, but if the code you posted isn't within PHP tags, you'll need to open and close the tags before and after a variable, like:
<meta name="if.classification" content="<?php echo $if?>.classification">
...here I'm assuming your variable is
$if because dots are not valid variable characters. Maybe you mean to be concatenating two variables, like $if.$classification, or classification is a defined constant, but I'm not sure. I hope this helps.
yes.. what u are saying and what i did are very close...
here is the code for anyone else who may want it:
<?
mysql_select_db("$myDB") or die("Couldn't open the $myDB database");
$query = "SELECT id, classification, requester, author, be_number, country_codes, start_date, site_name, country
FROM db.db_main WHERE id = '$aid'";
$query_result = @mysql_query($query) or die (mysql_error());
$row = @mysql_fetch_array ($query_result);
// $row = @mysql_fetch_array
echo "
<META NAME=\"IL.title\" CONTENT=\"$row[target_name]\">
<META NAME=\"IL.poc\" CONTENT=\"$row[author]\">
<META NAME=\"IL.keyword\" CONTENT=\"$row[keywords]\">
<META NAME=\"IL.secur.classif\" CONTENT=\"$row[classification]\">
<META NAME=\"IL.secur.ctrl\" CONTENT=\"$row[ctrl]\">
<META NAME=\"IL.secur.relto\" CONTENT=\"$row[relto]\">
<META NAME=\"IL.secur.dissem\" CONTENT=\"$row[dissem]\">
<META NAME=\"IL.secur.declasson\" CONTENT=\"$row[declasson]\">
<META NAME=\"IL.cutdate\" CONTENT=\"$row[cutdate]\">
<META NAME=\"IL.postdate\" CONTENT=\"$row[start_date]\">
<META NAME=\"IL.summary\" CONTENT=\"$row[summary]\">
<title> $row[site_name] </title>
</head>";
?>