derrick1123 Posted March 18, 2008 Share Posted March 18, 2008 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 More sharing options...
matto Posted March 18, 2008 Share Posted March 18, 2008 The 'user' php is running as doesn't have the right permissions to perform chmod() on that file. Link to comment https://forums.phpfreaks.com/topic/96632-chmod/#findComment-494522 Share on other sites More sharing options...
eddierosenthal Posted March 18, 2008 Share Posted March 18, 2008 you should have ability to chmod your own files, as long as you have x permission on it. i was wondering why you were able to execute the raw unix command inside your php script without a 'system' or 'exec' call and pass the "chmod" as an argument. Link to comment https://forums.phpfreaks.com/topic/96632-chmod/#findComment-494547 Share on other sites More sharing options...
derrick1123 Posted March 18, 2008 Author Share Posted March 18, 2008 OH, I will just make them manually do it. Link to comment https://forums.phpfreaks.com/topic/96632-chmod/#findComment-494551 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.