Hello,
1) Is it possible to move the <title></title> out side of the <head> </head>?
2) Is it possible to change your title on every page of your site with one file without changing it on every page?
Please and thank you!
Hello,
1) Is it possible to move the <title></title> out side of the <head> </head>?
2) Is it possible to change your title on every page of your site with one file without changing it on every page?
Please and thank you!
1. its possible, but it won't work and will probably end up in error.
2. yes, if you want i can try to make it.(are your files .php , or .htm and .html)
Last edited by Master_script_maker; 01-02-2008 at 09:45 PM.
[Jasme Library (Javascript Motion Effects)] My Site
/\/\@§†ê® §©®¡þ† /\/\@|{ê®
There are 10 kinds of people in the world, those that understand binary and those that don't.
Hello,
1) No.
2) Yes, if you use a server side scripting system. Or if you just want this to be observable by the users(not the search engines) you can change the document.title property form JavaScript.
Thanks, can you try to make it please! Thank you!
save it as rename.php, upload it to your server, and run it. It will go through all your folders.
Edit: Changed file_put_contents to fwrite for compatablity issuses
Edit: Must have 777 file permisions
PHP Code:<?php
function getdir($dir) {
$title="";//edit this to what you want the title to be
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file=='rename.php'||$file=='..'||$file=='.') {
} else {
if (strpos($file, '.html',1)||strpos($file, '.htm',1)) {
$file_content = preg_replace('/<title>(.*?)<\/title>/', '<title>'.$title.'</title>', file_get_contents($dir.$file));
fwrite($dir.$file, $file_content);
}
if (is_dir($dir.$file)) {
$dirs[]=$file;
}
}
}
closedir($handle);
}
for($i=0;$i<count($dirs);$i=$i+1) {
getdir($dir.$dirs[$i].'/');
}
}
getdir('./');
?>
Last edited by Master_script_maker; 01-06-2008 at 11:06 PM.
[Jasme Library (Javascript Motion Effects)] My Site
/\/\@§†ê® §©®¡þ† /\/\@|{ê®
There are 10 kinds of people in the world, those that understand binary and those that don't.
Thanks a lot. Can you briefly explain how it works please? Thank you!
I really wonder why you want to change the position of title tag?
probably to be able to edit it with javascript.
sure.
if the folder is openable and you can set it to a variable, set it to "$handle" and open itPHP Code:if ($handle = opendir($dir)) {
while there are files not read, set one of their names to a variable($file)PHP Code:while (false !== ($file = readdir($handle))) {
if the file is this one, or a folder above this one do nothing, if it is not continue.PHP Code:if ($file=='rename.php'||$file=='..'||$file=='.') {
} else {
if the filename contains '.html' or '.htm', continuePHP Code:if (strpos($file, '.html',1)||strpos($file, '.htm',1)) {
replace '<title>somethiing</title>' with '<title>your title</title>' from the contents of the file(The '$dir' is the path). then it saves the file.PHP Code:$file_content = preg_replace('/<title>(.*?)<\/title>/', '<title>'.$title.'</title>', file_get_contents($dir.$file));
file_put_contents($dir.$file, $file_content);
if the 'file' is a folder add it to an array of folders.PHP Code:if (is_dir($dir.$file)) {
$dirs[]=$file;
}
close the opened folderPHP Code:closedir($handle);
for each folder, run the function again with that onePHP Code:for($i=0;$i<count($dirs);$i=$i+1) {
getdir($dir.$dirs[$i].'/');
}
run the function in the current folderPHP Code:getdir('./');
[Jasme Library (Javascript Motion Effects)] My Site
/\/\@§†ê® §©®¡þ† /\/\@|{ê®
There are 10 kinds of people in the world, those that understand binary and those that don't.
Does it matter what my page extention is? Mine is .php
if you want php change this:
to this:PHP Code:if (strpos($file, '.html',1)||strpos($file, '.htm',1)) {
PHP Code:if (strpos($file, '.html',1)||strpos($file, '.htm',1)||strpos($file, '.php',1)) {
[Jasme Library (Javascript Motion Effects)] My Site
/\/\@§†ê® §©®¡þ† /\/\@|{ê®
There are 10 kinds of people in the world, those that understand binary and those that don't.
Bookmarks