zelig Posted March 30, 2012 Share Posted March 30, 2012 Okay, I can't seem to figure out why the form isn't pulling up. Here's what I'm trying to do. Administrator clicks on Add New Item to Inventory, pulling up the shops that are available to add inventory to. (This part appears to be working, because it does list those shops available). Then, the administrator will click on a shop name, opening up a form that will allow them to type in the name of the item they want to add. Instead, it goes to a blank screen, no errors even with error reporting on. adminpanel.php is the main file that houses all these functions. If you're familiar with EZRPG, it's the same basic setup, just with these additions to the list. Any help would be greatly appreciated! Thank you!! function addinv() { $query = doquery("SELECT id,name FROM shop ORDER BY name", "shop"); $page = "<b><u>Add Inventory</u></b><br />Click to add an item to a shop's inventory.<br /><br /><table width=\"50%\">\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin_panel.php?do=addshopinv:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 2; } else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td style=\"background-color: #ffffff;\"><a href=\"admin_panel.php?do=addshopinv:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 1; } } if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No items found.</td></tr>\n"; } $page .= "</table>"; admindisplay($page, "Add Shop Inventory"); } function addshopinv($name) { if (isset($_POST["submit"])) { extract($_POST); $errors = 0; $errorlist = ""; if ($name == "") { $errors++; $errorlist .= "Name is required.<br />"; } else if ($errors == 0) { $query1 = doquery("SELECT * FROM items WHERE name=$name"); $item_id = mysql_fetch_array($query1); $query = doquery("INSERT INTO `sale` SET shop_id=".$row["id"].", item_id='$item_id',"); admindisplay("Inventory Item Added.","Add New Inventory Item"); } else { admindisplay("<b>Errors:</b><br /><div style=\"color:red;\">$errorlist</div><br />Please go back and try again.", "Add New Item to Shop"); } } $name = $page = <<<END <b><u>Add New Inventory Item</u></b><br /><br /> <form action="admin_panel.php?do=addshopinv:$name" method="post"> <table width="90%"> <tr><td width="20%">Name:</td><td><input type="text" name="name" size="30" maxlength="255" value="" />*255 character max</td></tr> </table> <input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /> </form> END; $page = parsetemplate($page, $row); admindisplay($page, "Add New Inventory Item"); } Quote Link to comment https://forums.phpfreaks.com/topic/260004-getting-a-blank-white-screen/ Share on other sites More sharing options...
VTS Posted March 30, 2012 Share Posted March 30, 2012 Right off the bat I see this: $name = You either need to delete that or finish out the statement and assign that variable to something. Quote Link to comment https://forums.phpfreaks.com/topic/260004-getting-a-blank-white-screen/#findComment-1332664 Share on other sites More sharing options...
zelig Posted March 30, 2012 Author Share Posted March 30, 2012 Ok, deleted it, but still getting white screen. Quote Link to comment https://forums.phpfreaks.com/topic/260004-getting-a-blank-white-screen/#findComment-1332679 Share on other sites More sharing options...
Jessica Posted March 30, 2012 Share Posted March 30, 2012 Turn on error reporting Quote Link to comment https://forums.phpfreaks.com/topic/260004-getting-a-blank-white-screen/#findComment-1332680 Share on other sites More sharing options...
zelig Posted March 30, 2012 Author Share Posted March 30, 2012 I've got it on, but nothing is showing. Quote Link to comment https://forums.phpfreaks.com/topic/260004-getting-a-blank-white-screen/#findComment-1332682 Share on other sites More sharing options...
Jessica Posted March 30, 2012 Share Posted March 30, 2012 If you had it enabled and set to the right settings, you wouldn't have seen a blank screen the first time... Quote Link to comment https://forums.phpfreaks.com/topic/260004-getting-a-blank-white-screen/#findComment-1332684 Share on other sites More sharing options...
stenbom Posted March 30, 2012 Share Posted March 30, 2012 Check if there is a whitespace in the beginning of the file. This causes WSoD. Quote Link to comment https://forums.phpfreaks.com/topic/260004-getting-a-blank-white-screen/#findComment-1332688 Share on other sites More sharing options...
zelig Posted March 31, 2012 Author Share Posted March 31, 2012 I've added: error_reporting(E_ALL); ini_set('display_errors', 1); Both at the beginning of the php file and at the beginning of each function, but I'm still getting a white blank screen. I don't know where else to put it, or what else to use to figure this out. I checked for whitespace, and I didn't find any. Any other ideas? Quote Link to comment https://forums.phpfreaks.com/topic/260004-getting-a-blank-white-screen/#findComment-1332995 Share on other sites More sharing options...
PFMaBiSmAd Posted March 31, 2012 Share Posted March 31, 2012 Error_reporting should be set to E_ALL (or even better a -1) and display_errors should be set to ON in your master php.ini on your development system. Stop and start your web server to get any changes made to the master php.ini to take effect. Confirm that the settings actually got changed by using a phpinfo statement in a script in case the php.ini that you changed is not the same one that php is using. The Loaded Configuration File value in the output from a phpinfo() statement is the php.ini that php is using. The reason for setting these settings in the master php.ini is because putting the settings into your script won't show fatal parse errors in your main file (fatal parse errors in included files would be shown) because your main script never runs when there is a parse error in it and the settings won't take effect. Also, by putting these settings in to the master php.ini on your development system, you don't need to remember to put them into your files for debugging purposes and you don't need to remember to remove them when you put your files onto a live server. The post by stenbom concerning white-space at the start of your file causing a blank page is irrelevant. The only time that would cause a blank page is if your page was performing a header redirect. The white-space would prevent the redirect and if error_reporting/display_errors settings are off, you would not get any indication of why the redirect failed. Quote Link to comment https://forums.phpfreaks.com/topic/260004-getting-a-blank-white-screen/#findComment-1333011 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.