On my games website i have a line of text under each of my games saying add this game to your website and its the script of a link to the website for ezample <a href="http://www.mygamespage.co.uk/GamesPage/Action/One-I.php">One I</a> i was wondering is there a way that instead of having to edit the line each page when putting in new games is there a way i can imput the same line into all the pages and it will change to match the page... Something like <a href="PAGE-URL-CAPTURE">PAGE-TITLE-CAPTURE </a> thanx peeps
I'm not the greatest with PHP, but if your files end in .php, you could insert something like this on your pages: <a href="http://www.mygamespage.co.uk<?php echo $_SERVER['REQUEST_URI']; ?>">Add this Game to Your Page!</a> And it'll fetch the end part of the URL depending on the page...
Cool, Thats just what i was looking for, But i would like the "add this game to your page " part to be the title of the page ? Would this be possible too ?
You would have to put the title of your page in a php variable like so... <?php $page_title = "This is the title of my page"; ?> somewhere up near the top of your page and then use it in both places like so... <title><?php echo $page_title; ?></title> and <a href="http://www.mygamespage.co.uk<?php echo $_SERVER['REQUEST_URI']; ?>"><?php echo $page_title; ?></a>
but wouldnt i have to change that title php for everypage ? Where as what im looking for is just a line of code that i can paste into everypage.
Don't you have gamename in a variable from mySQL? You could put <title><?php echo("You are now playing $gamename"); ?></title> anywhere in the page