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"; } ?> Link to comment https://forums.phpfreaks.com/topic/58724-solved-need-some-help/ 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? Link to comment https://forums.phpfreaks.com/topic/58724-solved-need-some-help/#findComment-291280 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, [email protected] 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 Link to comment https://forums.phpfreaks.com/topic/58724-solved-need-some-help/#findComment-291283 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. Link to comment https://forums.phpfreaks.com/topic/58724-solved-need-some-help/#findComment-291286 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 Link to comment https://forums.phpfreaks.com/topic/58724-solved-need-some-help/#findComment-291296 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. Link to comment https://forums.phpfreaks.com/topic/58724-solved-need-some-help/#findComment-291306 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? Link to comment https://forums.phpfreaks.com/topic/58724-solved-need-some-help/#findComment-291309 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. Link to comment https://forums.phpfreaks.com/topic/58724-solved-need-some-help/#findComment-291315 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 Link to comment https://forums.phpfreaks.com/topic/58724-solved-need-some-help/#findComment-291319 Share on other sites More sharing options...
jscix Posted July 6, 2007 Share Posted July 6, 2007 http://en.wikipedia.org/wiki/Chown Link to comment https://forums.phpfreaks.com/topic/58724-solved-need-some-help/#findComment-291324 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? Link to comment https://forums.phpfreaks.com/topic/58724-solved-need-some-help/#findComment-291347 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.