PHP script adding a slash at the end of url?
Posted: Tue Sep 20, 2011 6:32 am
I have created an install.php file that creates a table in a MySQL database and it's adding a slash to the add of the URL for some reason. So it looks like install.php/
This doesn't happen on the other pages. I tried creating a random file called random.php and there was no slash added to the end so it doesn't seem to be a domain issue.
The code on the install.php file is as follows:
Is there something in there that is somehow creating the slash at the end?
This doesn't happen on the other pages. I tried creating a random file called random.php and there was no slash added to the end so it doesn't seem to be a domain issue.
The code on the install.php file is as follows:
Code: Select all
<?php
define('SHIELD', true);
require('settings.php');
$sql = "SELECT * FROM $db_table";
$result = @mysql_query($sql);
if ($result) {
exit('This script has already been installed. Please delete <b>install.php</b> from the directory for security reasons.');
} else {
$create = ("CREATE TABLE IF NOT EXISTS `".$db_table."` (
`id` int(4) NOT NULL auto_increment,
`question` text NOT NULL,
`answer` text NOT NULL,
`dateasked` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`ip` varchar(20) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;");
if (mysql_query($create, $connect)) {
echo 'The script has been successfully installed. <a href="admin.php">Click here to proceed to the admin panel.</a>';
} else {
die("Error: ". mysql_error());
}
}
?>