Romestar Posted August 7, 2007 Share Posted August 7, 2007 I have an arcade site that is powered by a PHP script. I also happen to not know crap about PHP. The script makes all the pages have the same title which is not good for search engine optimization and so I am trying to fix it. All of the subpages have a title that is displayed on the page, and I can't get it to put it in the <title> tags. I've been able to make it differentiate between the main page (where it doesn't display anything new) and the subpages (where it's suppose to display the page title). Here's what I have so far: <title><?php if(!isset($_GET['act']) || $_GET['act'] != 'play'){ echo 'main page title here'; } else { if(isset($_GET['id'])){ echo 'Subpage name here'; } } ?></title> while looking at how the script displays the subpage name in the page, it seems to use this code: {$game[\'gName\']} but I can't get the script to echo the value of 'gName.' Any help would be greatly appreciated Quote Link to comment https://forums.phpfreaks.com/topic/63784-n00b-needs-help/ Share on other sites More sharing options...
jscix Posted August 7, 2007 Share Posted August 7, 2007 try doing: print_l ($game); See what results you get in the dumped array.. Quote Link to comment https://forums.phpfreaks.com/topic/63784-n00b-needs-help/#findComment-317881 Share on other sites More sharing options...
Romestar Posted August 7, 2007 Author Share Posted August 7, 2007 try doing: print_l ($game); See what results you get in the dumped array.. This didn't work, if this is what you mean: <title><?php if(!isset($_GET['act']) || $_GET['act'] != 'play'){ echo 'main page title here'; } else { if(isset($_GET['id'])){ print_l ($game); } } ?></title> it gave this message when opening a subpage: Fatal error: Call to undefined function: print_l() in /home/arcade/public_html/index.php on line 16 Quote Link to comment https://forums.phpfreaks.com/topic/63784-n00b-needs-help/#findComment-317892 Share on other sites More sharing options...
Fadion Posted August 8, 2007 Share Posted August 8, 2007 dont know of any print_l() but sure i know about print_r() which u can use to print array values. What i think is that $game is a config variable and to it are assigned site values like: $game['siteName'] = 'Game Site'; $game['siteDesc'] = 'A very good site'; Dont know how the script works but im sure it gets the page title from a database field. Look at the database to find a column 'title' or smth and then look at the code to find where that column is echoed. Quote Link to comment https://forums.phpfreaks.com/topic/63784-n00b-needs-help/#findComment-318018 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.