Jump to content

Blank Page


947740

Recommended Posts

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");
?>

Link to comment
https://forums.phpfreaks.com/topic/189808-blank-page/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/189808-blank-page/#findComment-1001643
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.