Can the Title of the page (within the head, not a random title) be dynamic?
I was thinking that PHP could return the value of the current page and then echo it into the Title tag after amending it.
I say amending it as I use camel case and I'd need a way of turning userProfile.php into User Profile
Can anyone point me in the right direction please?
I've used :
public function findCurrentPageURL(){
return substr($_SERVER["SCRIPT_NAME"], strpos($_SERVER["SCRIPT_NAME"], "/")+1);
}//end to return current page
as a function and thought that the same principle could be applied.
EDIT: I'm not sure how to word this but here goes, I'm hoping on a simple answer as I can't see this being a rare issue.
I have an init.php file that includes various classes and other files.
This gets called at the top of every page.
It works fine when all the pages that call it are in the same folder. Now I need to create a subdirectory within the main so:
coreFolder
->init.php
->classes
->->class.php
index.php
other.php
otherFolder
->otherPage.php
is an example of what I have now.
In index(and others) my call is require'core/init.php'
In init.php I have
require 'core/connect/dbConnect.php';
require 'core/classes/users.php';
etc etc
The problem I'm now having is when I try and call init from my otherPage.php I have to use include'../core/init.php'
I then get errors as it cannot locate the other includes within init.php.
Is there a solution for this please? I really would prefer to not have one uber great big long list of php files
I can then combine the two and voila