PHP newbie, what isn't correct here? -
i don't know question should asking. i'm looking "how should php documents start" , similar i'm not turning helpful. have following file set in mamp "htdocs" folder should allow me access through localhost. however, whenever load in chrome server error http 500. if delete whole thing no error. if load first php block still error. questions need asking?
edit clarity. without debug block, code doesn't load. debug block code doesn't load
edit: updating code fixes
<?php ini_set('display_errors', 'on'); error_reporting(e_all | e_strict); ?> <?php if ($_server["request_method"] == "post") { $text = $_post["email_text"]; include "etext.php"; //run etext $output_file_path = "#"; //set running etext header("location: index.php?status=submitted"); exit; } ?> <h1>etext email converter</h1> <?php if (isset($_get["status"]) , $_get["status"] == "submitted") { ?> <p> file located at: <?php echo $output_file_path; ?> </p><br> <a href=<?php echo $output_file_path; }?> >click here access</a> <?php else { ?> <form method="post" action="index.php"> <textarea rows="30" cols="40"></textarea> <input type="submit" value="submit"> </form> <?php } ?>
the reason don't see error is fatal error, meaning php did not execute of code not interpreted.
your php.ini has display_errors
turned off. if turn on in php.ini, see errors in browser. note should use configuration development. in general, best configure php write errors log file, , tail log while building application.
Comments
Post a Comment