snlildude87
Apr 18 2005, 12:53 AM
I'll set up the background for the question: I have a separate file that I include on all the webpages on my site which I call with PHP using the include() function, so everything will be much easier to maintain and update. Well, I have three include files for each page: header.php (includes stuff like meta tags, googlebot/spider info), footer.php (the footer/copyright thing), leftnav.php (includes the navigation bar). I also like the titles of my pages to be as descriptive as possible so I try to include the path of a page (how the user got to that page: "Excite Yourself : Games : Reaction") between my <title> tags. Problem: The thing is that I've recently decided to change my site title to something less generic and more creative. I was thinking about moving the title tag in all my pages to the header file first. Is there a way so I can change all the "Excite Yourself"'s without having to update every single page on my site? Like, include the <title> tags in my header.php file? What I was thinking: I was thinking about putting this code in my site: CODE <html> <?php include("header(title of page).php"); ?> However, I don't think the code above is legal in PHP syntax. Then, in header.php, I can have a statement that takes in title of page and append that to "New Title Name : Games : Reaction" As you can tell, I'm not really good with PHP, but I did my best to try to explain to you my situation. Any help/suggestion is appreciated 
Reply
OpaQue
Apr 18 2005, 01:15 AM
How about declare a variable $title before including the header file CODE $title="This is the title of my new page"; include("location-of-header-file.inc.php");
Inside the header file, You can use this variable $title. HTML <!-- Contents of Header file --> <html> <head> <title><?=$title?></title> </head>
Try this out, I haven't tested it. But it should work.
Reply
snlildude87
Apr 18 2005, 01:36 AM
Such a simple solution to what seemed to be a complex question. Thanks, OpaQue! I'm voting for you in my own poll Problem solved -> thread closed
Reply
Recent Queries:--
write your own php functions example include - 2.63 hr back. (1)
-
writing php function - 11.03 hr back. (1)
-
writing a php spider - 12.04 hr back. (1)
-
writing javascript in php - 41.24 hr back. (1)
-
writing validation functions in php - 83.83 hr back. (1)
-
writing my own class in php - 91.33 hr back. (1)
-
writing functions to validate form in php - 91.96 hr back. (1)
-
php variable title tags - 92.41 hr back. (1)
-
write my own stripslashes function - 117.48 hr back. (1)
-
php own function for loop - 123.86 hr back. (1)
-
query database "title tags" php - 125.57 hr back. (1)
-
php "function in function" - 91.78 hr back. (2)
-
writing your own googlebot like spiders php - 170.86 hr back. (1)
-
how to write header files in php - 173.35 hr back. (1)
Similar Topics
Keywords : writing, functions, php, write, php, functions, takes, arguments, php
- Functions
??? (9)
Php Email Validation
A PHP data validation class with many functions (1) I've been reading through my old php book (PHP 4.1) and came across this data validation class.
It can check a number of things ranging from telephone numbers , credit card number formats, email
address and some others. I checked out some of the methods although I didnt expect it to work 100%
because I've found source code errors thoughout the book and CD. I tested out a few of the
methods to check and some of them did return expected results but some didnt either so the data
validation class was not perfect and it didnt really bother me. The cool thing I found....
Php Functions To Send Mail
(9) Which other methods to send mail from a form? I just know mail function, like: mail(string to,
string subject, string message) Has anyother?....
Arrays Outside A Function
Need to have arrays available to all functions. (3) I've got a bunch of arrays that i want to use for more then 1 function. when i declear the
arrays outside a function i cant use it in a function. This code was originally written in
javascript by another person but since I plan to use it and extend it with php I had to change it
from javascript to php code. In the javascript code the arrays were decleared outside the functions
with 'var arrayname' I read somewhere that declearing javascript variables with
'var' gives it global access. Any ideas on how I can go about declearing 1 set of these
arrays t....
Security Issue Writing Files
Security issue writing files (1) Hi, first, sorry about my english. i am a beginner with php and i have some question about writing
files using php in a shared hosting. is a risk?, use database to store data is a better way? i just
want make an interface (in php) that write the data in a .html extension file to show to everybody
the html page and just the php interface is to the content manager. thanks in advance ....
Encrypt Functions
(0) Here is my 3rd Code: By this code you can encrypt your text: CODE <?php $a =
md5("hello"); $b = base64_encode("hello"); $c =
base64_decode("hello"); print "md5 = ".$a." base64_encode =
".$b." base64_decode = ".$c; ?> EASY!....
[php](simple) Using Functions To Combine Values In A Form
Really simple example on how to combine values with function (2) I just learned this simple method on how to use functions to combine two values from a form. First
we create ourselves a simple POST form CODE <form method="POST"> Name:
<input type="text" name="nickname"> Location: <input
type="text" name="location"> <input type="submit"
value="Input"> </form> Now we add this php to that same file CODE
<?php $nick = $_POST['nickname']; $location =
$_POST['location' ....
Writing To Files And Such
(3) Ok lets say i have a config.php file, i want to edit something without open it, i know every line
number and that, now how would i do this? I will show you a example: CODE <?php
$CONFIG['user'] = 'root';
$CONFIG['server'] = 'localhost';
$CONFIG['pass'] = '******';
$CONFIG['db'] = '******';
$CONFIG['install'] = '1';
$CONFIG['lang'] ....
Gd Functions
Questions (2) Hi all I want begin a new project , my new project is Photo blog ( weblog and image album ) in one
script for example you can post many image in one post at once case . so its very good and very easy
but we have some problems . if you can plz help me to fix this problems for example : we need
change image size for page speed ( we dont want show 16 image in one page ) * we need GD functions
to change image size to smaller and then show smaller image at page if you know source or tutorial
about change image size plz post here . thankx we know we can change image size (w....
Wappy's Php Snippets
I will place here usefull php snippets and functions that i learn/use (13) Here is a function you can use to generate a simple random password for whatever use ;-) CODE
<? function rand_pass($numchar){ $string = str_shuffle
("abcdefghijklmnopqrstuvwxyz1234567890"); $password = substr ($string,
1, $numchar); return ($password); } //example echo
rand_pass('8'); // will return an 8 character long random password of numbers and
letters like c8k4ss42 ?> CODE tags added. Here is an extremly usefull search function
that will search a directory and....
Some Php Functions Explaination Required
(2) Can some one please tell me what is the purpose of the following functions , although there's a
little explaination with everyline but i cant understand, can some one exaplin it bit clearly and
tell me that why it is needed in config.inc.php.. what is its purpose and will it work if i dont
include these files in config.inc.php thanks QUOTE ### Url were Website has been installed, not
'/' in end! define('C_URL','http://www.test.com/Website'); ### Internal
path to Website directory define('C_PATH','Z:/home/www.test.com/www/....
Globals Inside Functions
(4) I've got the following function, that has a function inside of it, when I run it I get the
followin error: PHP Code: CODE Fatal error: Call to a member function on a non-object in
See the code below where I get the error message. I'm guessing the scope of my varaibles is
messed up, but I'm not sure how to fix it. I've abbreviated the code so as to make it easier
to read. PHP Code: CODE function getMemberRegistrationForm( &$tpl, &$db ) {
function displayRegistrationForm( $action, &$db, $defaults =....
Using The Image Editing Functions Of Php
Specifically, lines or regular polygons. (4) I've been experimenting a little with PHP's image functions and I was trying to see if I
could make something that looked 3D, so I started with a cube because it's simple. To make an
isometric picture of a cube, you need to start with a regular hexagon. However, making a regular
hexagon isn't the easiest thing. Is there a function to create a regular polygon, or specify an
angle and magnitude for a vector?....
Writing To Database Problem With Mysql - Not Writing Forum Post
(3) I'm making a forum and I've had several problems tonight which I've come here to ask
then found the answer to myself, but this one is stumping me. Whenever it goes to write the post to
the database, it saves the poster, and the time, but the part where the message would go is empty.
Here's the code, with comments about what it's supposed to do (what I wanted it to do and
thought it did): CODE $imsg = stripslashes($_POST['msg']);
//Get message if(strlen($imsg) > 5 && strlen($imsg)....
Confused...
some php functions that i am confused (5) First of all, if you have answers to the following QUOTE
http://www.trap17.com/forums/A-Lot-Of-Php-...ions-t7653.html
http://www.trap17.com/forums/A-Lot-Of-Html...ions-t7651.html Feel free to answer them all. Now,
in PHP i know there's microtime, srand, float, array_rand, arrays, foreach, or any other loop
functions. i'm really confused . Please help me!....
Looking for writing, functions, php, write, php, functions, takes, arguments, php
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for writing, functions, php, write, php, functions, takes, arguments, php
*MORE FROM TRAP17.COM*
|
advertisement
|
|