PICS Posted July 6, 2007 Share Posted July 6, 2007 One of my biggest issues is an internal error im receiving. After reviewing the logs i see it's "Premature end of script headers: php-script" I tried turning off high security in ensim and put it to 3.1 which works. Only problem is now every other script working on this server with sessions fails to work. Is it my code or is it in deed a server issue? I have complete access to the server because i do work for the hosting company. I know that the file im trying to create is not being created. I tried using .txt as well but in order for this script to work it must be .html,.htm, or .php. http://picstools.com/t/new.php?name=Jack&url=dog.com <?php #################### ##by Brandon Ryall## #################### $name = ($_GET['name']); $url = ($_GET['url']); $content = ('<html> <head> <title>PICS Tools - URL - '.$name.'</title> </head> <frameset rows="55,*" framespacing="0" border="0" frameborder="0"> <frame name="topper" scrolling="no" noresize src="http://picstools.com/t/top.htm"> <frame name="bottom" src="'.$url.'" scrolling="auto"> <noframes> <body> <p>Please visit '.$url.'</p> </body> </noframes> </frameset> </html>'); $filename = 'index.html'; if (is_writable($filename)) { if (!$handle = fopen($name.'/'.$filename, 'a+')) { echo "Cannot open file ($filename)"; exit; } if (fwrite($content) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($content) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } ?> Quote Link to comment Share on other sites More sharing options...
Yesideez Posted July 6, 2007 Share Posted July 6, 2007 Can you show the error message exactly as it appears in your browser? Quote Link to comment Share on other sites More sharing options...
PICS Posted July 6, 2007 Author Share Posted July 6, 2007 Could it possibly be a dns issue? I know we also have this domain pointed to another location on google. Using www get's you there... Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@pics.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache Server at www.picstools.com Port 80 Quote Link to comment Share on other sites More sharing options...
Yesideez Posted July 6, 2007 Share Posted July 6, 2007 I suggest looking at the error logs just as it says as this should give you more detailed information as to what went wrong. Quote Link to comment Share on other sites More sharing options...
PICS Posted July 6, 2007 Author Share Posted July 6, 2007 all i get in the error log is [Fri Jul 06 11:47:42 2007] [error] [client 192.###.###.#] Premature end of script headers: php-script Quote Link to comment Share on other sites More sharing options...
jscix Posted July 6, 2007 Share Posted July 6, 2007 if you've got access to the server, check the user permissions on the folder for your account. perhaps you/php doesnt have access to the directory. Quote Link to comment Share on other sites More sharing options...
Yesideez Posted July 6, 2007 Share Posted July 6, 2007 Well that's something to start with. Just had a look at the code and I can't see what's wrong - maybe someone else can lend a hand? Quote Link to comment Share on other sites More sharing options...
PICS Posted July 6, 2007 Author Share Posted July 6, 2007 Is it possible to make this into MySql? I'm thinking that it would probably be much easier to throw the name and url into a database rather than creating a folder and index page. Quote Link to comment Share on other sites More sharing options...
Yesideez Posted July 6, 2007 Share Posted July 6, 2007 You can try using chmod() to set/change permissions... http://www.php.net/chmod Quote Link to comment Share on other sites More sharing options...
jscix Posted July 6, 2007 Share Posted July 6, 2007 http://en.wikipedia.org/wiki/Chown Quote Link to comment Share on other sites More sharing options...
PICS Posted July 6, 2007 Author Share Posted July 6, 2007 what do i do with that command? Quote Link to comment 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.