PHP Echo current filename without extension
- by Christian Nikkanen
I'm working on a very simple homemade CMS that simply uses a rich text editor and database to save the website contents and displays them to visitors.
Heres the save.php that saves it:
<?php
include 'mysqlconnection.php';
mysql_query("UPDATE Content SET Content='$_POST[edit]' WHERE PageName='$_POST[PageName]'");
mysql_close($con);
?>
<?php
header('Location:http://xxx.com/Kayttoliittyma');
?>
It just saves it to the database. The pagename part is the part where I need to echo the filename without the extension. It would echo to the forms hidden field. But how?