947740 Posted January 26, 2010 Share Posted January 26, 2010 I do not know what is going on....I have this code but when I pull it up in the browser the page is completely blank. No errors, no page source, nothing. There might be a couple of coding errors, but I don't think that would explain why there is NOTHING on (or in) the page. PHP version 5.1.11 <?php $correct_path = "../"; include("../includes/header.php"); include("../includes/connect.php"); if(!isset($_POST["submit"])) { // We need to get the editing data echo <<< CONTENT <form name='form' action='edit.php' method='POST'> CONTENT; $ID = $_GET['ID']; $query = "SELECT * from pictures WHERE ID = $ID"; $result = mysqli_query($cxn,$query) or die(mysqli_error($cxn)); $row = mysqli_fetch_assoc($result)); foreach($row as $column) { $th .= "<th>$column</th>"; $td .= "<td><input type='text' name='$column' value='$row[$column]' /></td>"; } echo <<<CONTENT <table> $th <tr> $td </tr> </table> <input type='hidden' name='id' value='$ID' /> <input type='submit' name='submit' value='Change' /> CONTENT; } else { // We are changing the data in the database foreach($_POST as $key => $value) { if($key != "id" && $key != "submit") { $query = "UPDATE pictures set $key = $value WHERE ID = $ID"; $result = mysqli_query($cxn,$query) or die(mysqli_error($cxn)); echo "Data for column $key has been updated.<br />"; } } } include("../includes/footer.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/189808-blank-page/ Share on other sites More sharing options...
oni-kun Posted January 26, 2010 Share Posted January 26, 2010 ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); Turn error reporting on by adding this to the top of your code It should display errors then. Quote Link to comment https://forums.phpfreaks.com/topic/189808-blank-page/#findComment-1001634 Share on other sites More sharing options...
947740 Posted January 26, 2010 Author Share Posted January 26, 2010 And, still absolutely nothing. Something is telling me this is not a PHP problem, but I don't know WTH it is. Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/189808-blank-page/#findComment-1001637 Share on other sites More sharing options...
teamatomic Posted January 26, 2010 Share Posted January 26, 2010 Better hit the manual on error reporting. $row = mysqli_fetch_assoc($result)); because an extra round bracket is an error any way you look at it. HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/189808-blank-page/#findComment-1001642 Share on other sites More sharing options...
947740 Posted January 26, 2010 Author Share Posted January 26, 2010 It....works now. I did not know a parentheses could freak out the code that far into the script...I thought it would have done SOMETHING. Thanks for your help....now I just have to wade through countless other errors due to the fact I couldn't test my script. Thanks a lot. Quote Link to comment https://forums.phpfreaks.com/topic/189808-blank-page/#findComment-1001643 Share on other sites More sharing options...
black_ice Posted January 26, 2010 Share Posted January 26, 2010 no have the tags .. </form> or,you try 3 steps 1.only have html (show it?) 2.add php (show it?) 3.add mysql ? Quote Link to comment https://forums.phpfreaks.com/topic/189808-blank-page/#findComment-1001646 Share on other sites More sharing options...
teamatomic Posted January 26, 2010 Share Posted January 26, 2010 Thats not the way php works. Simply put, it first runs through the entire script doing a run time compilation. If there is an error it returns the error to apache else it starts outputting to apache. HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/189808-blank-page/#findComment-1001647 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.