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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.