Hi,
I am a total newbie when it comes to PHP. My background is in ASP. However I have taken on a website for a customer which is written in a bespoke PHP package (by the previous developer).
Basically, it is a CMS where you are suppost to be able to edit the title, keywords and description in the admin system. However when I set something in the admin system, it doesn't show up on the public web pages. This is the following code which is supposed to retrive the meta data set by the user and stored in the database. However it doesn't seem to be working. There are default settings (as you will see below in lines 1-3). However if I comment (//) out lines 4-6, the proceeding lines do not set what is in the database as the title tag, meta desc, or keys. I can't see, from my point of view, anything wrong with the code, and I just wondered if any of you guys could help me out as to why the code on lines 7-25 isn't working? The data is in the database yet it just comes back with blank fields/data.
Look forward to hearing your suggestions. Matt
1 define ("PAGE_TITLETAG","Demo Titletag");
2 define ("PAGE_METAKEYS","Demo Metakeys");
3 define ("PAGE_METADESC","Demo Metadesc");
4 public $strTitleTag = PAGE_TITLETAG;
5 public $strMetaDesc = PAGE_METADESC;
6 public $strMetaKeys = PAGE_METAKEYS;
7 function __construct($intPage = 1){
8 session_start();
9 $this->objConn = mysql_connect(MYSQL_HOSTNAME,MYSQL_USERNAME,MYSQL_PASSWORD);
10 mysql_select_db(MYSQL_DATABASE,$this->objConn);
11 $this->strRssFile = 'rss/cache/bbc-world.xml';
12 $strQuery = "SELECT page_titletag,page_metadesc,page_metakeys,page_heading,page_body,page_section,page_action FROM page WHERE page_id=".$intPage;
13 $this->arrPage = mysql_fetch_assoc(mysql_query($strQuery));
14 $this->strUID = $_COOKIE['lib_log'];
15 if($this->arrPage['page_titletag'] != ''){
16 $strTitleTag = $this->arrPage['page_titletag'];
17 }
18 if($this->arrPage['page_metakeys'] != ''){
19 $strMetaKeys = $this->arrPage['page_metakeys'];
20 }
21 if($this->arrPage['page_metadesc'] != ''){
22 $strMetaDesc = $this->arrPage['page_metadesc'];
23 }
24 $this->startTask();
25 }