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
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>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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.