Jump to content

Recommended Posts

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 :)

 

Link to comment
https://forums.phpfreaks.com/topic/63784-n00b-needs-help/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/63784-n00b-needs-help/#findComment-317892
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/63784-n00b-needs-help/#findComment-318018
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.