Web Developers Forum & SEO Help
Web Developers ForumArticlesBlogLinks
topmenu

Programming and Scripts: Web Developers Forum

Go Back   TalkWebDev: Web Developers Forum for Web Designers & SEO Information > Web Development > Programming and Scripts
User Name
Password


Reply
 
Thread Tools Search this Thread
Old 06-17-2005, 03:46 PM   #1
Archaic Sage
Super Moderator
 
Join Date: Mar 2005
Location: England
Posts: 182

Send a message via AIM to Archaic Sage Send a message via MSN to Archaic Sage Send a message via Yahoo to Archaic Sage
Default Automated Title Names

I use the page.php?id= method one of my websites, except the main code looks like:
Code:
<?php $page = $_GET['page']; $your_site = ""; if ($page) { if (file_exists("$page.php")) { include("$your_site/$page.php"); } else { include("404.php"); } } else { include("$your_site/index.php"); } ?>

So that it's more secure. Anyway, with this method, you only get one title name, if you want to keep your site coding compliant. I was wondering if there was a way of defining the title page automatically with php. Such as if the files name was: apache.php that the title would become Apache.

Any help would be appreciated.
Archaic Sage is offline   Reply With Quote
Old 06-18-2005, 12:27 AM   #2
Purple Haze
TalkWebDev Enthusiast
 
Join Date: Mar 2005
Posts: 37

Default

Look up regular expressions. You would want to use the preg_match() function.

http://php.net/manual/en/function.preg-match.php
__________________
Sticky Icky
Purple Haze is offline   Reply With Quote
Old 06-18-2005, 12:52 AM   #3
Archaic Sage
Super Moderator
 
Join Date: Mar 2005
Location: England
Posts: 182

Send a message via AIM to Archaic Sage Send a message via MSN to Archaic Sage Send a message via Yahoo to Archaic Sage
Default

Would that be able to define something inbetween two HTML tags, such as <h2>?

I was looking into basename($_SERVER["PHP_SELF"]); but that's not what I wanted.

Preg-match seems good, but I couldn't see what I was looking for in that area of the manual.
Archaic Sage is offline   Reply With Quote
Old 06-18-2005, 06:27 AM   #4
Purple Haze
TalkWebDev Enthusiast
 
Join Date: Mar 2005
Posts: 37

Default

I suggest you learn regular expression; a great site for it is http://regexlib.com. It has a cheat sheet for regex characters (http://regexlib.com/CheatSheet.htm).
__________________
Sticky Icky
Purple Haze is offline   Reply With Quote
Old 06-22-2005, 01:45 PM   #5
Archaic Sage
Super Moderator
 
Join Date: Mar 2005
Location: England
Posts: 182

Send a message via AIM to Archaic Sage Send a message via MSN to Archaic Sage Send a message via Yahoo to Archaic Sage
Default

Thanks for that. I'm looking into it now.
Archaic Sage is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT. The time now is 06:00 PM.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

 
Admin CP Mod CP About Us Contact Us Top