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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.