Jump to content

chmod();


derrick1123

Recommended Posts

I had a problem were it auto chmoded the script. Can you check over my code and see what is wrong?

 

<?php
include("db_settings.php");
$next = $_POST['next'];
$filename = "install.php";
chmod($filename, 0777);

if($next==0 || $next==""){
//click to install
echo "Click the '<tt>install</tt>' button to auto install.<br>";
echo "Make sure you edit your '<tt>db_settings.php</tt>' before continuing.<br>";
echo "<form method='POST' action='install.php'>";
echo "<input type='hidden' value='1' name='next'>";
echo "<input type='submit' value='Install!'>";
echo "</form>";
echo "<br><br><br>Created by <a href='http://smfhost.info'>derrick1123</a>";
}

if($next==1){
$q = "CREATE TABLE remember (
                  id int(20) NOT NULL auto_increment,
                  name varchar(50) NOT NULL,
	  msg varchar(255) NOT NULL,
	  email varchar(50) NOT NULL,
	  website varchar(100) NOT NULL,
	  time int(255) NOT NULL,
                  PRIMARY KEY  (id)
                ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Message Reminder';";
$go = mysql_query($q);

if(!$go){
echo "SHIT!!! Did you forget to edit your <tt>db_settings.php</tt>?";
} else {
echo "YAY!!! The '<tt>rememberall</tt>' table has been installed in your database.<br>";
echo "Click '<tt>Delete Install</tt>' to try delete the install automaticaly.";
echo "<form method='POST' action='install.php'>";
echo "<input type='hidden' value='2' name='next'>";
echo "<input type='submit' value='Delete Install!'>";
echo "</form>";
echo "<br><br><br>Created by <a href='http://smfhost.info'>derrick1123</a>";
}
}
if($next==2){
unlink("install.php");
if(file_exists("install.php")){
echo "Please remove the '<tt>install.php</tt>' manually!";
echo "<br><br><br>Created by <a href='http://smfhost.info'>derrick1123</a>";
} else {
echo "YAY!!! You may now start remembering things <a href=index.php>here</a>.";
echo "<br><br><br>Created by <a href='http://smfhost.info'>derrick1123</a>";
}
}
?>

 

error:

Warning: chmod() [function.chmod]: Operation not permitted in /home/ser1123/public_html/my_site/remember/install.php on line 5

Link to comment
https://forums.phpfreaks.com/topic/96632-chmod/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.