Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Changing Titles Per Page With Inc Files.


The way my script is set up now, I have an index.php which calls on inc files.  The problem is that each page (inc file) is using the title set in the php.index.

My goal is to have a title for each page.  I've looked and looked but can't find anything. 




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Changing Titles
What I'm trying to do is have a different title per article written on my website.  The way the site is run now, the server calls on an include file, but the browser still reads it as the title for the index.php.

Help With Page Titles
I dont want to have a header for every page and change it manually but i believe we should be able to some how in php set some conditions.

I want to have 1 .php file which is the header.php The on every page i will include it.

How do i get started setting this up.

Not too sure if this makes any sense or not.

I would image that i have to set variables which are the page titles...but after that i have no clue.

Creating Page Titles On The Fly
Does anyone know a way to create page titles on the fly using php scripts? Obviously, I chose PHP so I wouldn't have to make hundreds of individual pages...so I was hoping there was a way to also create dynamic page titles as well.

Changing File Extension With Inc Files?
I know you can select which file extension PHP uses when ur installing PHP, but can you tell to use a custom extension after installation?

Changing Data In Text Files
Is there an easy way in which I can edit values in a text configuration file? I am creating a form based interface to administrate a few text based config files. I can get the values from the file by parsing it line by line, but I cannot find an efficient way to edit data based on changes submitted in the php form. Is there any way to get to a position in a file and then overwrite any information?

Changing Db Within Page
I have a php page that flips between dbs and sometimes it works and sometimes it doesn't... e.g. the first query runs from this db, the second query runs from a different db and then the third query runs from the first db again... the first query will run, the second query will run, but then the third query will not.

Each time that I switch to a query that calls a different db, I used include_once "db_whatever"; before the query, thinking that, that would work, but it doesn't... Is there something I need to do to kill the previous db connection prior to moving onto another one?

Changing Password From Web Page
I have a need to allow a 'email only' user to change their password on the system from my home page. Normally the user does not log in.

1) need them to login to confirm user/pass
2) enable them to change pass using the _passwd_ file.
Since Apache runs as nobody I need a funtion or two to do the above.
NOT using a sql database but just the usual _passwd_ file. using Linix - RH6.0 - Apache with php3_mod I don't mind doing the reading if I know what to read!

Changing Title Of Page
does anyone know how to use PHP to change the title of a page?

Let's say my title is currently "GOGOGO" , but I want to add a string "$x" to it

so it says "GOGOGO $x", using PHP does anyone know how to do that?

Changing Text On Page Via Dropdown Box.
I have a webpage that draws various text decriptions from a mySql database. The description displayed on the page is controlled via a dropdown box. Currently I am using Javascript with a dropdown box (onChange handler) to change the value of a textbox.

Can anybody think of a way that I don't have to use a textbox(with its' scrollbars and background)? How can I change the value of a php variable by changing the selected index of a dropdown box?

Changing The Variable As You Pass It Through To The 2nd Page
I am using a form to push variables through to another page. In the form, (a drop down), the code is:

<select name="1"><option>L</option><option>P</option></select>

Now on the second page I could display the P or the L by saying <?php echo $1 ?> which is fine. What I want is, if someone selects P then it prints 1 on the next page and if they select L then it prints 2. Is this possible?

Changing A More Link Into Page Numbers
I have the following code which I've tried to edit to fit some examples others have posted on here, with no luck. I have a page that displays More and Prev links but not the page numbers. How can I change this code to have page numbers instead of the More Prev? PHP Code:

Access A Secure Page By Changing The Url
how can i stop people getting into a secure logged in page by just typing
www.somesite.co.uk/admin/index.php.

theres a login set up, but i can bypass it by just entering the url location, this is a major security issue that i need to solve relatively quickly before i publish the pages.

what i need/want is if someone isn't logged in it just goes to a page saying "you must be logged in to access this page" then prompts them to login.php.

Changing An If Statement To Html Page
How do I change the following code from my process page to a new page with the detials on it. I made a html page cut and pasted it into this spot but it did not work. What do I need to change in order for it to be a html page is shows. Code:

Changing Pictures On Index-page When Reloading
I am a beginner but quite curious anyway.

My problem: I have seen websites that show different pictures whenever you enter the site. By doing this, the sites look always fresh and attractive and I like the idea a lot. Now I like to have the same function on my site but I do not know how that works...

Is there anybody who can give a good "explanation for dummies" on how to do that?

Titles In Php Pages
First let me say that I am a rank amateur and am learning as I go. That said, I am using a php scripted page to call several different html pages as content. This makes it very easy to edit the look, header, etc...of the 200+ pages on my site but keeps them from having good individual titles that the search engines like.

If I use a "create title" tag I do get individual titles but they show the entire url (http:......com/php?x=....) and I would like plain text in the header. Are there tags I can use on text in the html pages (product names) to extract them to the title?

If so what would I put in the php page to call the title from those tags.

Writing Dynamic Headers (eg Titles)
If I only have control of layout pages that are in effect parts of the <body> of a (dynamic) web site, how can I change the title. I can put a variable in the title but this doesn't seem to work.

e.g.

<html><title><? print $message; ?></title></html>
<body><? $message = "Something"; ?></body>

does not result in a title of Something since the header is parsed before the body.

Is there a way round this so I can put a standard bit in the mainpage but have the title determined by the context?

$_SESSION Variables In A Form Titles Not Updating?
I have a form that updates and the output goes to itself (same page name). It works fine, but when I try pulling some of my $_SESSION variables into the output as text - for the titles and subtitles in the page - they do not reflect what got selected with the radio button.QUESTIONS to clarify:

1) Is there anything wrong in the way I am trying to execute this in the script below (I am new to using $_SESSION variables)?
2) Is there a better way for me to pass information to the titles that is also (succesfully, right now) being passed to my graph files under the system below.

Beginning code which is likely relevant? PHP Code:

Replacing Linked Files In A Page?
trying to come up with a system which will strip out all files on a webpage and replace them with the correct url for said file, this is for use in an include system where i can fake the urls. ie. everything on my site goes through the main index.php file so

http://www.mysite.com/index.php
is the same as
http://www.mysite.com/this/is/a/fake/url/

because this/is/a/fake/url/ is passed as a variable to the index.php (using a modrewrite) which finds the real url in a database and then includes() it!

now because
http://www.mysite.com/this/is/a/fake/url/
might correspond to
http://www.mysite.com/project/1/

all linked files on the page will be lost unless absolute urls are used. Now to avoid absolute urls i want to go through the page, replace all filename with the correct url and then echo out the page. now its the parsing of the page that concerns me, so far i've done this.. PHP Code:

Loading Swf Files Into A Php Page From A Database....
I am wanting to create a games website where all the data is stored in a database.

i want the urls for the swf also in the d.b.

so when the page loads it will show all the games on the site and when clicked it will load the correct swf url depending on the game name.

Creating .xls And .doc Files With Page Breaks Using PHP / MySQL
Our company currently processes a few hundred form submissions through
our site. Up till now, the contents of the form has been sent to our
customer support staff in real-time. Each submission goes to a general
e-mail box where it's printed through our mail client. A copy of the
form is also stored in a MySQL db, although it's not used that often.

I have been asked to figure out a way to stop delivering the form
submissions in real-time and migrate to the following:

Each morning, provide an Excel spreadsheet and word document (or PDF)
with a certain number of form submissions to each customer support
rep. For example, say 200 form submissions were processed the day
before. This morning, I should split those 200 among the 5 support
reps and provide each of them a certain amount (which can change
daily). Assuming each person gets 40 form submissions, each person
would need to be given an excel file and .doc document that contains
their 40 form submissions.

One of the most important things is that the .doc file needs to have
each form submission separated by a page break, so that when they
print the document each form submission is printed on a separate page.

Finally, not all of the fields from the form submission should be
given to the support rep. Maybe date and time is left off.

Link To Local Files Through A Dynamic Page
I decided to flesh out my php skills by building a web application
which could scan through local files on my intranet (specifically
mapped drives on my server) and generate a list of Movies or pictures
or music, etc. Which worked fine, I created the code to do that and to
store the results in a mysql database. I can even print it out to a
..php page and sort it however I like.

What I can't seem to do is to create links to the data I've indexed in
a way that will let me open them from the generated php page. I've
searched and searched and there just doesn't seem a way to do this.
I'm pretty sure I've exhausted the obvious options.

The following trials did not work when the document was served from an
apache web server.

<?php
echo "<h1><a href=file:///c:/temp.txt> HEY </a></h1>";
echo "<h1><a href=file:///c: emp.txt> HEY </a></h1>";
?>
<a href=file:///c: emp.txt target="_top"> temp.txt </a>
<a href=file:///c:/temp.txt target="_top"> temp.txt </a>

When the same page was loaded directly from the file instead of served
through apache the bottom two links worked. This doesn't really help
me however. I need to be able to dynamicly generate pages that link to
the files.

I've read that browser security is the restricting factor in this but
changing all of my security settings in IE to low didn't seem to affect
it (not sure what the equivalent of security settings is in Firefox).
Does anyone know of a way to link to local files directly in a way that
lets you open them directly from the source instead of by downloading
them to a temp file or saving the file to somewhere locally? Is it
even possible in PHP?

Hyperlink From Intranet Web Page To Local Files On My Computer
I'm creating a company intranet, and every employee has certain
program we want them to be able to run from it, meaning we want the
link to the program to be on the intranet page. For example, Adobe
Photoshop resides on all the employees computer under "C:Program
FilesAdobePhotoshop 7.0Photoshop.exe"

However, when I enter that as a hyperlink on the page, it does not run
the program.

Is there a way to get a web page to run a program on the local host?

Wnat To Embed Full HTML Page In Email, But Migrating Style From Css Files To Element Style Attributes
My web pages of course use css files, but Webmail services require
style to be in element style attributes.

How do I convert a standard HTML page to HTML suitable for delivery to
webmail services?

Perhaps another way to ask the question is:

How to I walk the DOM and for every element, for every style, set the
element's style attribute to the values that are looked up in the css
file in normal rendering.

Anyone know of any tools, or examples to do this?

Changing Php.ini
is there a way to change values in php.ini (like adding support for certain things) if you are not hosting your site yourself, like using a pay host?

Including Files In Different Direcories That Include Files From Teirs
Okay, I made a simple AJAX shoutbox and I want to include it on all my pages. To insert the shoutbox I simply type <? include('/shoutbox/shoutbox.php');?> into my HTML page.

The problem is, that in /shoutbox/shoutbox.php I also include settings.php, functions.php, and some other files, and when I include /shoutbox/shoutbox.php into my index page, /shoutbox/shoutbox.php tries to call settings.php from the same folder that my index file is in, since I just 'included' it in index's source.

So my question is, is there any way, without using frames, to include a PHP file as it would be if you link directly to it in the address bar, but placed into another file in a different directory?

How Do I Hide Database Connection Files Using PHP Include Files?
I have the following at the beginning of the PHP page:

<?php require_once('Connections/conn.php'); ?>

I want to hide the connection file, "conn.php", so it's out of the web
accessible file structure. I understand putting them in the php include
directory shoudl do this. For example, let's say the directory I put them
in is /www/phpIN/, and /www/ht/ is the root web directory.

So I put "conn.php" in the inlcude directory (/www/phpIN/conn.php) and
removed it form CONNECTIONS directory.

How Do I Hide Database Connection Files Using PHP Include Files?
I have the following at the beginning of the PHP page:

<?php require_once('Connections/conn.php'); ?>

I want to hide the connection file, "conn.php", so it's out of the web
accessible file structure. I understand putting them in the php include
directory shoudl do this. For example, let's say the directory I put them
in is /www/phpIN/, and /www/ht/ is the root web directory.

So I put "conn.php" in the inlcude directory (/www/phpIN/conn.php) and
removed it form CONNECTIONS directory.

Now it doesn't work.

What do I need to change?

Creating Dir, Copy Files And Pass Variables To 2 Files
I need to create a folder on the server weekly named by the user. To this folder copy the contents of an /Original folder. Inside the new folder edit one of the files to insert a data with a XML path generated in another application, copied (via memory) and pasted within the very first form and passed to the file in question.

<param name="FlashVars" value="xmlfile= $lanofile" />

the $lanofile is the value that I need to pass from the form to be read by this file.
I have created an form (n.php) that POST the name of the folder to a second file (creatdir.php) everything is cool until I have to edit the third file.

How can I pass the value of one of the formfileds to a second file and them read this value as a variable to be consumed as mentioned above? Or actually right whatever is on the third field to this position (not using variables).

Changing Passwords
I'm using proftpd with mysql, it's working great. I creaded a site that a proftpd user can use to change his password, I also wrote another PHP script that monitors passwords and if a password is about to expire (90 days), it sends out an email to the user.

Now, what I need help with is when a user enters a new password, I don't want this new password to match his previous 6 passwords.

Changing The From Name In Mail()
I know how to send mail with the mail() function. I have looked at the documentation for php and I can not seem to get the right syntax for changing the return name. I am sending mail from my server and it uses the nobody user for the admin of apache. because of this all mail comes in from "nobody". This is really annoying me and if anybody knows the syntax I would sure appreciate it.

Changing Colors
I have this form where you can submit a DJ line up for an event. I want the user to be able to change the font color whenever they wish, and when they hit enter, for it to skip a line. I would like the to be able to do this without them knowing how to use the <br> and <font> commands. Kind of like you see on a phpBB board or something


But is there a way to make this button, and when the click it, it keeps the text that they have already entered into the textarea adds a [ i ] or whater and then when they click the button again, it inserts the [/ i ] without altering the text they already typed. it would be much like the buttons you use to do your PHP and color changes in this forum, but without the pop-up window to enter your code into.

Changing Date?
In MySQL database the date format is as follows:

YYYY-MM-DD

But how can I make it so that when I see it on the page it will be as follows, which is English format:

DD-MM-YYYY

Changing The ROOT_DIRECTORY
I am using XAMPP (latest version) I have got MySQL, PHP, Apache etc..

I wanted to change the root directory shown in PHPINFO(); for XAMPP for my
localhost://

Is there an easy way to do this? i am a complete novice and first timer and
I assume that if I change it to 'C:web' my php files (in that directory
will be shown)

Changing Between Times
does anyone know to convert a time string in the form
dd-mm-yyyyThh:mm:ss i.e 2006-08-01T15:45:11-00:00 to a normal unix time
stamp or something that at least I can use to compare to a unix
timestamp.

Changing Php3.ini !!
I need to enable magic_quotes_gpc. I have learned to get to php3.ini through FTP, have changed it's value, and uploaded the file again. However, the value does not seem to change. I am running a dedicated server, and have attempted to reboot the server. Any ideas to why the settings won't change? Could permissions be a factor?

Changing Session Name
Anyone know how vBulletin changes their session name from the default PHPSESSID to just a simple 's', I thought it would just be a case of: PHP Code:

Changing A String
I've got a form to upload a file. When a file is submitted I need to change the file name before I add a reference of it to the database or copy it to a location on the server.

So let's say I submit the file "test.txt" I need change the file name to "test revision 1.txt" So I need to find the last instance of "." then move back 1 space and add " revision 1" to the string. Anyone know which functions I would have to use?

Changing The Location Of Php.ini
Does anybody know how to change where PHP looks for the php.ini file? It currently looks for the .ini file in /usr/local/lib. I need to change this so it looks at /home/john/usr/local/lib.

Changing Sizes
I have included the content on my site from another file and want the divide to automatically adjust its self to the size of the included content. In internet explorer this is not an issue, however in Firefox, Opera and I suspect Mozilla, the content overflows and the divides of the page do not automatically adjust.....

Changing Tables
I have my main index.php page and I've been looking around for the simplest way to do this but haven't been able to find anything that suits the purpose. Perhaps you guys can help, since you're the best..

All I want to do is switch the table that is in the middle of the page that displays the content of the page. So if someone clicks on, for example, index.php?files it'll change the table to the files table that I have in an html file or something.

Changing Header
I have a website that I need to change the Header and center it. How do I do that? The files are in the CMS files.

Changing Linebreaks To &lt;BR&gt;
When submittin a form, is there a way to change linebreaks to a <BR>? I know you can use ereg_replace() to replace certain characters, or set of characters, but how to specify a line break?!?

Changing Permission
I have been working with uplaoding of images which creates the folder automatically during uplaoding, but iam unable to change the permission of the folder. when i try changing from cpanel i get the below error.
"a fatal error or timeout occurred while processing this directive"
Kindly suggest me where iam wrong.

Session Id Keeps Changing
--when i set session.cache_limiter = private i get this
Set-Cookie: PHPSESSID=61fdf683fef689d5371a1c01fd46e678; path=/; secure
Expires: Thu, 19 Nov 1981 08:52:00 GMT
No idea where it's pulling that date from. (Clearly already expired)

--when i set session.cache_limiter = private_no_expire i get this
Set-Cookie: PHPSESSID=61fdf683fef689d5371a1c01fd46e678; path=/; secure
(no Expires line)
But my session ID still changes every time i refresh the page.

What do I have set wrong?

php.ini
[Session]
; Handler used to store/retrieve data.
session.save_handler = files
session.save_path = /tmp
session.cookie_secure = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
;session.serialize_handler = php
session.serialize_handler = wddx
session.gc_probability = 1
session.gc_divisor = 100
session.gc_maxlifetime = 1440
session.bug_compat_42 = 0
session.bug_compat_warn = 0
session.referer_check =
session.entropy_length = 16
session.entropy_file = /dev/random
;session.cache_limiter = nocache
session.cache_limiter = private_no_expire
session.cache_expire = 180
session.use_trans_sid = 1




Changing To HTML?
I have a piece of text which is entered into my database, this text contains HTML.

When I output it onto the page I want the HTML to turn into HTML and do what it is supposed to do, instead of just being normal text. How would I do this?

Redirecting And Changing The URL
I have a login page which remembers what you were trying to access, then uses header('Location: url here') to redirect the user back to what they were trying to access after a successful password.

However, the URL remains my.domain.here/login.php, instead of where they were redirected to... which breaks my relative links if they are redirected to a page within a subdirectory.

Changing From Alphabetical
I have had a developer to create a back end for my website.  I can't get hold of him, and to be fair I have bothered him enough, as I am trying to learn as well   That was not his job to teach me!!

What I have is three pictures and text title sitting next to each other, and they are in alphabetical order...What I want to do is place the picture and text title in a different order. Code:

Changing An Array Name.
If I have an array called my_array1, how do I call it within a for cycle? Something like this:

for($a=1;$a<=5;++$a){
$my_array = 'my_array'.$a;
          //prints $my_array
}

I know that doesnt work, so, I tried something like the following:

for($a=1;$a<=5;++$a){
$my_array = 'my_array'.$a;
          //prints $$my_array
}

That does work with variables, but doesnt work with arrays. I know that in Java and ActionScript what I'm trying to acomplish is pretty simple, but I cant seem to find the correct syntax for php.

Changing Timezones
I have the date being pulled in an echo statement but I'm trying to use the date_add() function somewhat unsuccessfully... Declaring the current time...

<?php
$time = date("h:i A");
?>

and then echoing it..

<?php echo $time date_add(INTERVAL 2 HOUR)"; ?>

And as guess, it isn't working and even after searching on google, I can't seem to get this one.


Copyright © 2005-08 www.BigResource.com, All rights reserved