PHP - Php Not Displaying Errors
Hello all!
Very frustrated PHP newbie here. I am trying to simply get my code to display errors. I have gone into the php.ini file, changed error_reporting to E_ALL, changed display_errors to On, changed display_startup_errors to On, and even added the line ini_set('display_errors', 'on'); to my code. I restarted the server after every change, and still I see no errors. My boss wants me to reach out to the community for answers rather than handing them to me himself. So here I am. Please advise! Thank you very much in advance. Similar TutorialsBeen screwing around on Google for about 3 hours trying to find a tutorial on what I am trying to do with absolutely no luck! I am simply trying to get my test script to echo errors from an array when a form criteria does not validate. This is my final revision which is still not working! Can someone please tell me what I am doing wrong? No matter what I do, I can't get away from this error: Notice: Undefined variable: error in C:\wamp\www\php\form_validation.php on line 13 <?php $o = $error[]; // test echo $o; // test if(!preg_match('/[^0-9A-Za-z]/',$_POST['first_name'])) { $error[] = "Please enter a valid First Name"; ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> First Name:<br /> <input name="first_name" type="text" size="50" maxlength="50" /><br /><br /> <input type="submit" /><br /><br /> </form> I've got a basic form setup on my site that requires the user to fill out the required fields. When one of the fields isn't filled out, the error message for that specific input area is displayed, etc. However, all the information from the form that the user filled out is removed.. I want the user to be able to fill out the form, hit submit, and if any errors, show the specific error but also keep the input boxes populated with the data the user filled out so he/she does not have to re type everything. if(!empty($_POST['submitFeature'])) { // set variables $featurename = mysql_real_escape_string($_POST['featurename']); $name = mysql_real_escape_string($_POST['name']); $email = mysql_real_escape_string($_POST['email']); $email2 = mysql_real_escape_string($_POST['email2']); $age = mysql_real_escape_string($_POST['age']); $city = mysql_real_escape_string($_POST['city']); $state = mysql_real_escape_string($_POST['state']); $src = $_FILES['featureupload']['tmp_name']; $featuresize = $_FILES['featureupload']['size']; $limitsize = 3000000; if(!empty($featurename) && !empty($name) && !empty($email) && !empty($email2) && !empty($city) && !empty($state) && ($email == $email2) && !empty($_FILES['featureupload']['tmp_name']) && ($featuresize < $limitsize)) { // IF ALL IS CORRECT, SUBMIT INFO } else { print ' <ul class="errorlist"> <li class="alert">Please fill out the required fields.</li> '; if (empty($name)) { echo ' <li>* Full Name</li>' . "\n"; $errorname = 'TRUE'; } if (empty($email)) { echo ' <li>* Email</li>' . "\n"; $erroremail = 'TRUE'; } print ' </ul> '; } // 1 - B. END REQUIRED FIELDS ERROR CODES } ?> <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data"> <div style="float: left;"> <span class="copy-answer">Your Information</span> <div class="formSec"><label for="name" class="required">Full Name: <?php if(isset($errorname)){echo '<span class="error">*<span>';}?></label> <input type="text" name="name" id="name" value="" maxlength="25" /></div> <div class="formSec"><label for="email" class="required">Email: <?php if(isset($erroremail)){echo '<span class="error">*<span>';}?></label> <input type="text" name="email" id="email" value="" /></div> <input class="submit" type="submit" name="submitFeature" value="Submit Your Feature" /> </form> How do I display the actual errors in IIS 7.5? If I miss a semicolon, I get: "HTTP Error 500.0 - Internal Server Error" absolutely useless. In prior versions, I could see the line and get to the PHP error. How do I display PHP errors? I've added: set_ini('display_errors', '1'); but it doesn't help. When I am trying to update a record in the database i get this error after I submit the form that is populated from the database. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc = 'SFR ANNOUNCES 3RD ANNUAL \"12 DAYS OF CHRISTMAS FOOD DRIVE\"', body = '<' at line 1 Hello. I am at beginning with php and now trying to make an ecommerce website. I know it's a bit stupid but it works until now. This site work perfect on localhost using xampp but then I transfered it to webhost, I get a lot of errors. The code below returns the correct results, which are in this case are email addresses. After each displayed value there is a br eg. emai1@hotmail.com<br>email2@hotmail.com<br>email3@ etc. So the quesion is, can i change the below codeing to prevent this. I have tried changing $message .= "<br>". $row['email'] to $message .= "\n". $row['email'] but this results in; Warning: mail() [function.mail]: SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html $code = $_GET['postcode']; $message = $_GET['message']; $emailad = "email@hotmail.co.uk"; $shortcode = substr($code,0,2); $result = mysql_query("SELECT email FROM treesurgeons WHERE postcode like '%" . $shortcode . "%' ORDER BY companyName LIMIT 3") or die(mysql_error()); echo "<h2>Business Names:</h2>"; while ($row = mysql_fetch_array( $result )) { $message .= "<br>". $row['email'] ; } echo "\n"; echo $message; mail( "$emailad", "Header","$message" ); echo "<br>" . "Thank you for using our mail form."; Does anyone know what would cause this error: Notice: Undefined index: file in C:\Inetpub\wwwroot\Upload\uploader3.php on line 2 No file specified with these files for uploading images: uploader.htm <html><head><title>File Uploader</title></head> <body><h3>File Upload</h3> Select a file to upload:<br> <form action="uploader.php" method="post" enctype="multipart/form-data"> <input type="file" name="file" size="45"> <br> <input type="submit" value="Upload File"> </form> </body></html> and, uploader.php <?php if( $_FILES['file']['name'] != "" ) { copy ( $_FILES['file']['tmp_name'], "C:/Inetpub/wwwroot/Upload/" . $_FILES['file']['name'] ) or die( "Could not copy file" ); } else{ die( "No file specified" ); } ?> <html> <head><title>Upload Complete</title></head> <body> <h3>File Upload Succeeded...</h3> <ul> <li>Sent: <?php echo $_FILES['file']['name']; ?> <li>Size: <?php echo $_FILES['file']['size']; ?> bytes <li>Type: <?php echo $_FILES['file']['type']; ?> </ul> <a href="<?php echo "C:/Inetpub/wwwroot/Upload/".$_FILES['file']['name']; ?>"><img src="<?php echo "C:/Inetpub/wwwroot/Upload/".$_FILES['file']['name']; ?>" height="200"></a> </body> </html> Thanks! Does anyone know of a function that I can use to get all occurring PHP errors during script execution into a string. Also, does anyone know what's wrong with php.net? It keeps saying service is down. Hi I'm in need of help with some errors that the admin page of my cms is spitting out, I'm very new to php but I'm great understanding directions so any help that anyone can provide will be greatly appreciated.
These are the errors being displayed:
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/mysite/public_html/includes/joomla.php on line 437 i m facing this 2 errors in the below script
Notice: Undefined index: media in D:\server\website\htdocs\wefondyou\themes\grape\layout\story\content.phtml on line 107 Warning: Invalid argument supplied for foreach() in D:\server\website\htdocs\wefondyou\themes\grape\layout\story\content.phtml on line 107 I had tried add isset and is_array to line, the errors gone away, but image also gone away. any ideas?? <div id="story_<?php echo $sk['story']['id']; ?>" class="story-wrapper story_<?php echo $sk['story']['id']; ?>" data-story-id="<?php echo $sk['story']['id']; ?>"> <div class="publisher-wrapper"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="48px" align="left" valign="top"> <a href="<?php echo $sk['story']['publisher']['url']; ?>" data-href="?tab1=timeline&id=<?php echo $sk['story']['publisher']['username']; ?>"> <img class="avatar" src="<?php echo $sk['story']['publisher']['thumbnail_url']; ?>" width="40px" height="40px" alt="<?php echo $sk['story']['publisher']['name']; ?>"> </a> </td> <td align="left" valign="top"> <a class="name" href="<?php echo $sk['story']['publisher']['url']; ?>" data-href="?tab1=timeline&id=<?php echo $sk['story']['publisher']['username']; ?>"> <?php echo substr($sk['story']['publisher']['name'], 0, 35); ?> </a> <?php if ($sk['story']['recipient_exists'] == true) { ?> <i class="icon-arrow-right recipient-indicator-icon"></i> <a class="name" href="<?php echo $sk['story']['recipient']['url']; ?>" data-href="?tab1=timeline&id=<?php echo $sk['story']['recipient']['username']; ?>"> <?php echo substr($sk['story']['recipient']['name'], 0, 35); ?> </a> <?php } echo $sk['story']['activity_text']; ?> <div class="other-data"> <span class="time-wrapper ajax-time" title="<?php echo date('c', $sk['story']['time']); ?>"> <?php echo date('c', $sk['story']['time']); ?> </span> <?php if ($sk['story']['location_exists'] == true) { ?> <abbr class="space3">·</abbr> <span class="location-wrapper" title="<?php echo $sk['story']['location']['name']; ?>"> <i class="icon-map-marker"></i> <?php echo $sk['story']['location']['name']; ?> </span> <?php } ?> </div> </td> </tr> </table> <?php if ($sk['logged'] == true) { ?> <div class="setting-buttons"> <?php if ($sk['story']['admin'] == true) { ?> <span class="remove-btn cursor-hand" title="<?php echo $lang['remove']; ?>" onclick="SK_deletePostWindow(<?php echo $sk['story']['id']; ?>);"> <i class="icon-remove progress-icon"></i> </span> <?php } elseif (!SK_isPostReported($sk['story']['id'])) { ?> <span class="report-btn cursor-hand" title="<?php echo $lang['report']; ?>" onclick="SK_reportPost(<?php echo $sk['story']['id']; ?>);"> <i class="icon-flag progress-icon"></i> </span> <?php } ?> </div> <?php } ?> </div> <?php if ($sk['logged'] == true) { ?> <div class="options-wrapper"> <?php echo SK_getPostLikeButton($sk['story']['id']); ?> <abbr class="space6">·</abbr> <?php echo SK_getPostShareButton($sk['story']['id']); ?> <abbr class="space6">·</abbr> <?php echo SK_getPostFollowButton($sk['story']['id']); ?> </div> <?php } if (!empty($sk['story']['text'])) { ?> <div class="text-wrapper"> <?php echo $sk['story']['text']; ?> </div> <?php } if ($sk['story']['media_exists'] == true) { // If it is photos if ($sk['story']['media_type'] == "photos") { ?> <div class="photos-wrapper"> <?php $photo_class = 'width-' . $sk['story']['media_num']; if ($sk['story']['media_num'] >= 3) { $photo_class = 'width-3'; } LINE HERE 107 -----> foreach ($sk['story']['media'] as $photo) { ?> <a href="javascript:void(0);"> <img class="<?php echo $photo_class; ?>" src="<?php echo $photo['url']; ?>" alt="Photo" onclick="javascript:SK_openLightbox(<?php echo $photo['post_id']; ?>);"> </a> <?php } ?> </div> <?php } elseif ($sk['story']['media_type'] == "soundcloud") { ?> <div class="soundcloud-wrapper" align="center"> <iframe frameborder="0" src="https://w.soundcloud.com/player/?url=<?php echo $sk['story']['media']['url']; ?>&color=f07b22" width="100%"></iframe> </div> <?php } elseif ($sk['story']['media_type'] == "youtube") { ?> <div class="youtube-wrapper" align="center"> <iframe src="https://www.youtube.com/embed/<?php echo $sk['story']['media']['id']; ?>?ap=%2526fmt%3D18&disablekb=1&rel=0" width="100%" height="300px" frameborder="0" allowfullscreen></iframe> </div> <?php } } elseif ($sk['story']['location_exists'] == true) { ?> <div class="google-map-viewer-wrapper" align="center"> <img src="http://maps.googleapis.com/maps/api/staticmap?center=<?php echo $sk['story']['location']['name']; ?>&zoom=13&size=600x300&maptype=roadmap&markers=color:red%7C<?php echo $sk['story']['location']['name']; ?>" width="100%" alt="<?php echo $sk['story']['location']['name']; ?>"> </div> <?php } ?> <div class="activity-wrapper"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="middle"> <span class="story-like-activity"> <?php echo SK_getPostLikeActivityButton($sk['story']['id']); ?> </span> <abbr class="space6">·</abbr> <span class="story-comment-activity"> <?php echo SK_getPostCommentActivityButton($sk['story']['id']); ?> </span> <abbr class="space6">·</abbr> <span class="story-share-activity"> <?php echo SK_getPostShareActivityButton($sk['story']['id']); ?> </span> </td> <td align="right" valign="middle"> <?php if ($sk['story']['via_type'] == "like") { ?> <a class="via-name" href="<?php echo $sk['story']['via']['url']; ?>" data-href="?tab1=timeline&id=<?php echo $sk['story']['via']['username']; ?>"> <?php echo $sk['story']['via']['name']; ?> </a> <?php echo $lang['likes_this_label']; ?> <?php } elseif ($sk['story']['via_type'] == "share") { ?> <a class="via-name" href="<?php echo $sk['story']['via']['url']; ?>" data-href="?tab1=timeline&id=<?php echo $sk['story']['via']['username']; ?>"> <?php echo $sk['story']['via']['name']; ?> </a> <?php echo $lang['shared_this_label']; ?> <?php } elseif ($sk['story']['via_type'] == "tag") { ?> <a class="via-name" href="<?php echo $sk['story']['via']['url']; ?>" data-href="?tab1=timeline&id=<?php echo $sk['story']['via']['username']; ?>"> <?php echo substr($sk['story']['via']['name'], 0, 15); ?> </a> <?php echo $lang['tagged_on_this_label']; ?> <?php } ?> </td> </tr> </table> </div> <div class="comments-container hidden"> <?php if ($sk['story']['view_all_comments'] == true) { ?> <div class="view-more-wrapper" align="center" onclick="SK_loadAllComments(<?php echo $sk['story']['id']; ?>);"> <i class="icon-lightbulb progress-icon hide"></i> <?php echo $lang['view_all_comments_label']; ?> </div> <?php } ?> <div class="comments-wrapper"> <?php echo $sk['story']['comments']; ?> </div> <?php echo $sk['story']['comment']['publisher_box']; ?> </div> </div> im getting following errors:
Warning: DOMDocument::load() [domdocument.load]: Opening and ending tag mismatch: property line 6 and xsl:for-each in /home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/apartment.xsl, line: 25 in/home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/transform1.php on line 9 Warning: DOMDocument::load() [domdocument.load]: Opening and ending tag mismatch: for-each line 5 and property in /home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/apartment.xsl, line: 26 in/home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/transform1.php on line 9 Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: compilation error in /home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/transform1.php on line 14 Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: xsltParseStylesheetProcess : empty stylesheet in /home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/transform1.php on line 14 Warning: XSLTProcessor::transformToXml() [xsltprocessor.transformtoxml]: No stylesheet associated to this object in /home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/transform1.php on line 16 Fatal error: Call to a member function saveXML() on a non-object in /home/students/accounts/s4909321/cos80021/www/htdocs/Assignment3/transform1.php on line 18 the xslt file is as following: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/19...XSL/Transform"> <xsl:output method="xml" indent="yes"/> i get this when i tried to retrive a venue id so admin can edit them Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource Warning: session_start() [FUNCTION.SESSION-START]: Cannot send session cache limiter - headers already sent Code: [Select] <?php include 'scripts/connect.php'; if(isset($_GET['vid'])){ $query = mysql_query("SELECT * FORM venue"); while ($row = mysql_fetch_array($query)){ $id = $row['id']; $venuename = $row['venuename']; $address = $row['address']; $phone = $row['phone']; $vemail = $row['vemail']; $state = $row['state']; $town = $row['town']; $zip = $row['zip']; $seats = $row['seats']; } } ?> <?php require "header.php"; ?> Hi, I'm trying to output some details from my database, along with a BLOB image. At the moment I'm having some warnings and notices and I don't know how to solve them. Here's the warnings and notices: Notice: Undefined index: id in G:\xampp\htdocs\xampp\dsa\search_func.php on line 38 Notice: Undefined variable: terms in G:\xampp\htdocs\xampp\dsa\search_func.php on line 13 Warning: mysql_query() expects parameter 2 to be resource, object given in G:\xampp\htdocs\xampp\dsa\search_func.php on line 16 Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in G:\xampp\htdocs\xampp\dsa\search_func.php on line 22 Notice: Trying to get property of non-object in G:\xampp\htdocs\xampp\dsa\search_func.php on line 27 Notice: Trying to get property of non-object in G:\xampp\htdocs\xampp\dsa\search_func.php on line 27 Notice: Trying to get property of non-object in G:\xampp\htdocs\xampp\dsa\search_func.php on line 27 Notice: Trying to get property of non-object in G:\xampp\htdocs\xampp\dsa\search_func.php on line 27 Notice: Trying to get property of non-object in G:\xampp\htdocs\xampp\dsa\search_func.php on line 28 Notice: Trying to get property of non-object in G:\xampp\htdocs\xampp\dsa\search_func.php on line 28 Notice: Trying to get property of non-object in G:\xampp\htdocs\xampp\dsa\search_func.php on line 28 Here's the function code: Code: [Select] <?php /* return the details of an employee parameter empno - employee number eg empHTML.php?empno=7521 This is very basic e.g no error checking */ function search($dbc, $id) { // define the query string $query = "SELECT * FROM stick, location, identification WHERE make LIKE '%$terms%' AND stick.sid = location.lid AND identification.stickID = stick.sid "; // execute the query and return a pointer to the resultant SQL relation $dbresult = mysql_query($query,$dbc); // return the result as a simple HTML table $output = Array(); // get each tuple in the table as an object $image = mysql_fetch_object($dbresult); // interpolate the required employee values -> is the equivalent of the java DOT notation $output[] = '<ul>'; $output[] = '<li> Type: '.$image->make .'<br />Size: '.$image->size .$image->type .'<br />Colour: '.$image->colour . '<br /> Street Missing in: ' .$image->street.'<br />Town missing in: '.$image->town .'<br />City missing in: '.$image->city.'</li>'; $output[] = '</ul>'; return join('',$output); } // connect $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); // get the department name from the URL $id = $_REQUEST['id']; // print the table of employees for this department // put it ina div HTML element with an emp class to support CSS styling print search($dbc, $id); print "<img src='getPhoto.php?id=$id'/>"; // close the database mysql_close($dbc); Quote Notice: Use of undefined constant d - assumed 'd' in /home/rayth/public_html/forum/shout.php on line 11 Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /home/rayth/public_html/forum/shout.php on line 11 Notice: Use of undefined constant F - assumed 'F' in /home/rayth/public_html/forum/shout.php on line 11 Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /home/rayth/public_html/forum/shout.php on line 11 Notice: Use of undefined constant Y - assumed 'Y' in /home/rayth/public_html/forum/shout.php on line 11 Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /home/rayth/public_html/forum/shout.php on line 11 I keep getting this. Line 11: $Date = date(d)." ".date(F)." ".date(Y); Im trying to make a login box for my website and i have a problem here it is: I put all my info in the file. Code: [Select] <?php $host = "localhost"; $user = "scape4le"; <--- thats my username $pass = "********";<--- my pass covered it out $db = "scape4le_members";<------ My DATABASE. ?> Is there any problem with the code? When i put it on my website i get this error. Code: [Select] Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'DB_HOST' (1) in /home/scape4le/public_html/Login/login-exec.php on line 15 Failed to connect to server: Unknown MySQL server host 'DB_HOST' (1) Theres more codes for the whole login box but too much. But thats the file were the problems at. Here is the code that it says it has a error in Login-exec.php Code: [Select] <?php //Start session session_start(); //Include database connection details require_once('config.php'); //Array to store validation errors $errmsg_arr = array(); //Validation error flag $errflag = false; //Connect to mysql server $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } //Select database $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } //Function to sanitize values received from the form. Prevents SQL injection function clean($str) { $str = @trim($str); if(get_magic_quotes_gpc()) { $str = stripslashes($str); } return mysql_real_escape_string($str); } //Sanitize the POST values $login = clean($_POST['login']); $password = clean($_POST['password']); //Input Validations if($login == '') { $errmsg_arr[] = 'Login ID missing'; $errflag = true; } if($password == '') { $errmsg_arr[] = 'Password missing'; $errflag = true; } //If there are input validations, redirect back to the login form if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; session_write_close(); header("location: login-form.php"); exit(); } //Create query $qry="SELECT * FROM members WHERE login='$login' AND passwd='".md5($_POST['password'])."'"; $result=mysql_query($qry); //Check whether the query was successful or not if($result) { if(mysql_num_rows($result) == 1) { //Login Successful session_regenerate_id(); $member = mysql_fetch_assoc($result); $_SESSION['SESS_MEMBER_ID'] = $member['member_id']; $_SESSION['SESS_FIRST_NAME'] = $member['firstname']; $_SESSION['SESS_LAST_NAME'] = $member['lastname']; session_write_close(); header("location: member-index.php"); exit(); }else { //Login failed header("location: login-failed.php"); exit(); } }else { die("Query failed"); } ?> If anyone could help i would appreciate that, Thanks Hi everyone I am pretty new to php but have been playing around with it for awhile. I have been trying to include a offline script from codecanyon located (http://codecanyon.net/item/web-construct/61643). The problem I am having is when I try to include the file as per the scripts instruction (<?php include("offline.php");?>) I get all sorts of errors on mysite (please see below for one error). I read his discussion section were one person is having the same problem I am having the script developers answers was (Place the webconstruct include after the session_start() line). I have tried that or think I did it right but still getting the same errors as before. Can someone please help me in getting this script installed? I will copy the session code below and if someone can point me to the right direction in how to resolve this issue I would be thankful. (error) Notice: Use of undefined constant (my session code) <? if ( isset($_SESSION['url']) && $_SESSION['url'] != $SITE_URL ) { session_destroy(); ?> <script language="javascript">window.location.href="index.php";</script> Thanks in advance for anyone's help! I have a fairly complicated Q&A Form with 10 Inputs. If there is a data entry error, then I re-load the Form display an error-message beneath the corresponding field. No problems there. Normally, if there was a more serious error (e.g. INSERT failed), then I would re-direct to a new page and display the error (or success) message there. No problem again. But here is where I am confused... Because my code iterates through each of the 10 Inputs on my Q&A Form, there could conceivably be an error on each loop. If I had two serious errors (e.g. INSERT error and UPDATE error), then how should I handle displaying the error?! For those types of errors, I would usually re-direct, however there would usually be only one error to display, e.g. Quote Your profile answers could not be added due to a System Error. Should I display every error that might occur for every one of the 10 Input fields, or does it make sense to just display one error, with the understanding that if one thing fails then everything does. Hope that makes sense?! Thanks, Debbie i seem to get the following errors: Notice: Undefined index: submit in C:\wamp\www\registration\register.php on line 12 Notice: Undefined index: fullname in C:\wamp\www\registration\register.php on line 14 Notice: Undefined index: username in C:\wamp\www\registration\register.php on line 15 Notice: Undefined index: password in C:\wamp\www\registration\register.php on line 16 Notice: Undefined index: repeat_password in C:\wamp\www\registration\register.php on line 17 its only in the php section that i am getting them <?php //Form Data echo "<h1>Registration</h1>"; $submit = $_POST['submit']; $fullname = $_POST['fullname']; $username = $_POST['username']; $password = $_POST['password']; $repeat_password = $_POST['repeat_password']; if ($submit) { } ?> <html> <form action='register.php' method='POST'> <table> <tr> <td> Choose a Username: </td> <td> <input type='text' name="username"> </td> </tr> <tr> <td> Password: </td> <td><input type='password' name="password"> </td> </tr> <tr> <td> Repeat Your Password: </td> <td><input type='password' name="repeat_password"> </td> </tr> <tr> <td> Your Full Name: </td> <td><input type='text' name="name"> </td> </tr> </table> <p><input type='submit' name='submit'></p> </form> </html> The bit of code I'm using it on is: if((@include("languages/".LANGUAGE.".php")) != 1) { require("languages/".DEFAULT_LANG.".php"); } But the error is still be produced. I'm using a custom error handler, is there anyway to include the @ in the custom error handler? |