chopficaro Posted January 12, 2010 Share Posted January 12, 2010 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> Quote Link to comment https://forums.phpfreaks.com/topic/188192-error-reporting-not-working/ Share on other sites More sharing options...
dropfaith Posted January 12, 2010 Share Posted January 12, 2010 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> Quote Link to comment https://forums.phpfreaks.com/topic/188192-error-reporting-not-working/#findComment-993529 Share on other sites More sharing options...
chopficaro Posted January 12, 2010 Author Share Posted January 12, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/188192-error-reporting-not-working/#findComment-993582 Share on other sites More sharing options...
PFMaBiSmAd Posted January 12, 2010 Share Posted January 12, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/188192-error-reporting-not-working/#findComment-993587 Share on other sites More sharing options...
chopficaro Posted January 12, 2010 Author Share Posted January 12, 2010 ok well i have this now <td><input name="name" type="text" value ="<?php if(isset($_SESSION['user'])){echo $_SESSION['user']} ?>" id="name" size="50" /></td> and still nothing appears. is there an alternative to isset? Quote Link to comment https://forums.phpfreaks.com/topic/188192-error-reporting-not-working/#findComment-993619 Share on other sites More sharing options...
PFMaBiSmAd Posted January 12, 2010 Share Posted January 12, 2010 and still nothing appears. That would indicate that the session variable is NOT set and that you would need to troubleshoot the code that is supposed to be setting it. Quote Link to comment https://forums.phpfreaks.com/topic/188192-error-reporting-not-working/#findComment-993639 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.