Jump to content

error reporting not working


chopficaro

Recommended Posts

nothing shows when this script runs, and the first thing i do in it is turn error reporting on

im running it  on my server and it was working until i inserted a little php in there to populate a field if isset(SESSION['user'])

are there other debugging methods i can use?

<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
session_start();
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>mysql test</title>
</head>
<body>

<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form id="form1" name="form1" method="post" action="add_topic.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3" bgcolor="#E6E6E6"><strong>Create New Topic</strong> </td>
</tr>
<tr>
<td width="14%"><strong>Topic</strong></td>
<td width="2%">:</td>
<td width="84%"><input name="topic" type="text" id="topic" size="50" /></td>
</tr>
<tr>
<td valign="top"><strong>Detail</strong></td>
<td valign="top">:</td>
<td><textarea name="detail" cols="50" rows="3" id="detail"></textarea></td>
</tr>
<tr>
<td><strong>Name</strong></td>
<td>:</td>


<td><input name="name" type="text" <?php if(isset(SESSION['user'])){echo ' value=SESSION['user']} ' ?> id="name" size="50" /></td>


</tr>
<tr>
<td><strong>Email</strong></td>
<td>:</td>
<td><input name="email" type="text" id="email" size="50" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Submit" /> <input type="reset" name="Submit2" value="Reset" /></td>
</tr>
</table>
</td>
</form>
</tr>
</table>

</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/188192-error-reporting-not-working/
Share on other sites

whats it currently doing?

 

<td><input name="name" type="text" <?php if(isset(SESSION['user'])){echo ' value=SESSION['user']} ' ?> id="name" size="50" /></td>

 

 

no value set?

<td><input name="name" type="text" value ="<?php if(isset(SESSION['user'])){echo ' value=SESSION['user']} ' ?>" id="name" size="50" /></td>

theres a mistake there but i see what ur saying u mean

<td><input name="name" type="text" value ="<?php if(isset(SESSION['user'])){echo SESSION['user']} ?>" id="name" size="50" /></td>

and i tried that and still nothing showed up

 

im more interested in why error reporting isn't working so i can fix these mistakes myself

Session variables (all variables) start with a $. You should be using $_SESSION

 

Because a form tag is a block level HTML element, text (including php error messages) won't necessarily be rendered in the browser, but will appear in the "view source" in the browser. Also, the use of isset() prevents some php errors from being produced.

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.