BlackKite Posted July 31, 2006 Share Posted July 31, 2006 For some reason the script I wrote up is causing the files it creates to not be editable in Cpanel. Cpanel gives the following error...[QUOTE]a fatal error or timeout occurred while processing this directive[/QUOTE]I really dont know if this is the script itself, the host i just moved to, or the current version of cpanel, but sice my other files i have that werent uploaded with the script work. So my guess is either the host or the script because i didnt have this problem before.[code] //Check for file existence;$ourFile = $_POST['title'];$filename = "/home/USER/public_html/$ourFile";if (file_exists("$filename")) { echo "The file $filename already exists. Please hit the back button and choose a new one"; exit();} else { echo "<center> Thank you for uploading your guide $ourLinkName ($ourFile). I has been posted to the neohound site. Please click <a href=\"http://www.neohound.com/staff2\">HERE</a> to returne to the staff panel.</center>";} //If it doesn't exist, login to FTP and chmod;############################ ftp settings #$ftpServer='ftp.SITE.com'; //ftp server, without ftp://$ftpPort=21; //the ftp port (don't change if you don't know what it is)$ftpUser='USER'; //ftp username$ftpPass='PASS'; //ftp password# end ftp settings ######################################################## file settings #$dir='public_html';$nav='public_html/index.php';# end file settings ############################//connect to server$connection = ftp_connect($ftpServer, $ftpPort);ftp_login($connection, $ftpUser, $ftpPass);//chmod directory so that the server can create a fileftp_chmod($connection, 0777, $dir); //Create file$ourFileHandle = fopen("/home/USER/public_html/$ourFile", 'w') or die("can't open file");fclose($ourFileHandle);$ourFileName = $_POST['name'];$ourLinkName = $_POST['link']; //Post content feild to the file created;$myFile = "/home/USER/public_html/$ourFile";$fh = fopen("$myFile", 'w') or die("can't open file");$stringData = $_POST['content'];$help = stripslashes ($stringData);$newStringData = strip_tags($help, '<img><div></div><font></font><p></p><br></br><hr></hr><a></a><b></b><i></i><u></u>');fwrite ($fh, $newStringData);fclose($fh);//reset directory permissionsftp_chmod($connection, 0750, $dir); //Post navigation link on index;//chmod directory so that the server can create a fileftp_chmod($connection, 0777, $nav);$SData = "<br> » <a href=\"http://www.neohound.com/index.php?id=$ourFileName\">$ourLinkName</a><!-- game -->";$data = file_get_contents('/home/USER/public_html/index.php');$data = str_replace ('<!-- game -->', $SData, $data);$fp = fopen ("/home/USER/public_html/index.php", 'w');fwrite ($fp, $data);fclose ($fp);//reset directory permissionsftp_chmod($connection, 0644, $nav);//close connectionftp_close($connection);[/code]Thanks,-BlackKite Quote Link to comment https://forums.phpfreaks.com/topic/16060-uploads-wont-edit-in-cpanel/ Share on other sites More sharing options...
lordphate Posted July 31, 2006 Share Posted July 31, 2006 looks like its your host... Quote Link to comment https://forums.phpfreaks.com/topic/16060-uploads-wont-edit-in-cpanel/#findComment-66178 Share on other sites More sharing options...
BlackKite Posted July 31, 2006 Author Share Posted July 31, 2006 Lol thats gay. Guess i'll be visiting the support system again. I dont even know what im asking them though. Anyone know exactly why this problem would be happening? Quote Link to comment https://forums.phpfreaks.com/topic/16060-uploads-wont-edit-in-cpanel/#findComment-66183 Share on other sites More sharing options...
BlackKite Posted July 31, 2006 Author Share Posted July 31, 2006 ... Quote Link to comment https://forums.phpfreaks.com/topic/16060-uploads-wont-edit-in-cpanel/#findComment-66416 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.