Putting Form Error Messages Into A List
I have some form validation and I want to put all the error messages that are displayed into a bulleted list. I have seen it done with more complicated validation using OOP but I don't know enough to do that. How would I add these error messages to a list if they occur? Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Get List Of Messages From One Table, Message List Indicator From
I have two tables. One has a list of messages left by users using fields named mbxno for the mailbox and msgno for the message number. I have another table that has mailbox settings for each user that contains a field named "messagelist" to indicate if they want to be included on the message list or not. What I'm trying to create is a list of the most-recent messages with a lookup on the users table to indicate whether a message in the list should be included in the message list based on the user's mailbox settings. SELECT messages.msgno, messages.mbxno, users.messagelist FROM messages, users WHERE (users.messagelist = Ƈ') ORDER BY msgno DESC LIMIT 100 What I'm getting, though is a list that looks like this: mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 1114 msgno: 0412141623 msglist: 1 I think what's happening is that I'm using the wrong type of join and more rows are being created than necessary. If I add "DISTINCT" to the query, I get a list of the most-recent messages as I expect, but the "messsagelist" value is sometimes wrong (again, probably because the data is getting jumbled). For example, the messagelist value for the second row (2214) should be 0, not 1. mbxno: 1114 msgno: 0412141623 msglist: 1 mbxno: 2214 msgno: 0412141622 msglist: 1 mbxno: 2189 msgno: 0412141408 msglist: 1 mbxno: 0000 msgno: 0412141213 msglist: 1 mbxno: 0003 msgno: 0412141213 msglist: 1 mbxno: 2265 msgno: 0412132029 msglist: 1 mbxno: 0000 msgno: 0412131950 msglist: 1 How should I be doing this? If nothing else, what kind of join will work with a long list compared to a value from a short list?
Putting List Into Drop Down
I am working on a directory of businesses which has 8 main categories and each category has several sub-categories. Example: Dining is a Category with Pizza, Fast Food, Chinese, etc. I have the sub-categories brought up in just a list on the left side of the page and when the user clicks on a sub-category it takes them from client_list.php to client_filter.php only showing businesses in that sub-category of the main category. So only pizza places listed under dining. However, I want to change the list to a (form) select box and then have the user click on the sub-category they want and then it takes them to the client_filter.php page to list only those bussinesses in that sub-categorie. So after that long explanation how do I change my code to do that. Here is my current code:
Error Messages
I set to php.ini this error_reporting=E_ALL & ~E_NOTICE to be a list of error messages and some warnings/tips on the code written. All good, but if I have code like ------------------------ function foo(string $x) { echo($x); } foo("hi"); ------------------------ I got this error ------------------------ Catchable fatal error: Argument 1 passed to foo() must be an instance of string, string given, called in E:WorkphpphpFramework est.php on line 8 and defined in E:WorkphpphpFramework est.php on line 3 ------------------------ !!!but... is not "hi" a string? What kind of *Catchable fatal error* would be this? :) I write foo(string $x) exactly to say that the function need a string!
Suppressing Error Messages
Could any one please tell me a command in php to suppress error messages that come because of any reason like query invalid or any other problem .i would like to see none of the error message s to come, even if there are errors(sounds weird but i need that).
PHP 5.0 - No Error Messages Under Apache
PHP 5 beta under Apache 2 on 'doze - and get no error messages from my PHP scripts. Whenever there's an error they simply silently stop outputting. Running earlier versions under Linux works fine. Version details: Apache/2.0.47 (Win32) PHP/5.0.0b1 <-- note the beta s/w. Is this a known problem? Is there a work-around?
Suppressing Error Messages
I keep getting an error that I don't want to show up, i have not been able to get rid of it either and i was just currious of how I might go about suppressing this error PHP Code:
Storing Error Messages
I know how to turn off error reporting to stop php from printing the error messages but what if I also want to store the error messages into an mysql table? What's the variable that stores the error message?
Not Displaying Error Messages
Is there a simple way to prevent error messages (falsely connecting to database etc.) being diplayed? My own build in messages are enough...
Turn Off Error Messages
I get this error message Warning: getimagesize() [function.getimagesize]: Read error! in /mnt/w0400/d11/s01/b02a5c57/www/familyclick.ca/messageCenter/writeMessage.php on line 95 Warning: Division by zero in /mnt/w0400/d11/s01/b02a5c57/www/familyclick.ca/messageCenter/writeMessage.php on line 102 The problem I'm having I'm having a hard time preventing the error. Is there a way to turn error messages off on certain pages. Ideally I would like to log these errors any idea how to do this.
No Error Messages In Mamp
Im trying to use the mamp set up on a mac. For some reason error messages dont display in the browser which make development quite difficult. Does anyone know how to turn error messages on?
How To Suppress Error Messages Without Using Error_reporting(0) ?
This line: if (file_exists($fileName)) { is (on some web servers) giving me this kind of error: Warning: SAFE MODE Restriction in effect. The script whose uid is 1022 is not allowed to access /home/www owned by uid 0 in /home/www/krubner/ppKernel/McControllerForAll.php on line 454 This only happens when the software is checking directories that are above what where PHP is allowed to check. I want this software to work on all servers and I don't want the end user to have to know PHP, and so I don't want them to have to set error_reporting() on their own. I also feel like I shouldn't have to do this: error_reporting(0); because my software should capture all errors on its own and store all the error messages that I write in the resultsObject that my software uses. Turning off error reporting is cheating, in my view, the programmer should capture all errors on their own. So how do I suppress errors on a line like this? if (file_exists($fileName)) {
PHP Error Messages As String In A Variable
Can I put all errors which PHP outputs when error_reporting(E_ALL); is activated into a variable? I want to react if an error occurs. I'm working on a Script to check if an ftp is running or not. The only way to get the error message of the ftp when the connection fails is if error_reporting(E_WARNING); or error_reporting(E_ALL); is activated. I want to format the Error Message. E.g. The errormessage is: Warning: ftp_login() [function.ftp-login]: Sorry, Over 2 connection not allow in c:inetpubwwwrootscriptsvbb_ftp.php on line 13. I only want this output: "Status: Sorry, Over 2 connection not allow "
Apache/PHP Not Giving Me Error Messages
I have just recently installed Apache2 and PHP5 on my computer. Normally when I make a syntax mistake on my webspace it gives me an error message on the .php page when i load it and the line the error is on. When i load a page on my own computer through http://localhost it just stops outputing the code on the page where the error is and leaves the rest blank. Do i need to configure Apache or PHP to display errors? If so, how?
Mail(): Error Messages NOT Back To Wwwrun?
a friend was so kind to host my php scripts. but when they use mail() or phpmailer (or whatever) to email e.g. to an invalid address, the returning error message appears in *my friend's email inbox* (recipient - or sender? - is "wwwrun" of my friend's machine). I guess you understand which problem I mean. To fix the problem, I would like to understand what is going on here - in the mail header, i did set replyto, x-sender and from to *my* email address, but it doesnt help. so where must I change what to free my kind friend from this "spam"?
Interpreting Error Messages From Include Files...
lets say i have the following files: 1. error.php: that is routed to for all errors. this page should display proper and explanatory error messages to the user based on the parameter provided. 2. errordef.php: has all the error codes and their explanations "defined" as constants. now, say if i have 3 different files viz. a.php, b.php and c.php, and when any error occuring in either these files, i want to route to error.php for detailed explanation. each a.php, b.php and c.php passes error code to error.php, but error.php should interpret the code from the definition file errordef.php!
Links Pointing On PHP Manual Not Shown In Error Messages
I have html_errors set On and it's visible that it's on because I get some parts of the error messages bold. The problem is I can't get any links to point to the PHP manual. docref_root = "/php_manual/" docref_ext = ".html" are set but no links are appearing. By that I mean there are absolutely no <a> tags or anything of that sort in my error outputs. I tried generating almost every type of error but please if somebody could post a line or two of code that produces some clickable error message on their box so that I can test it on my. (send the output also, please) if my script is: <?php $var1 = 'var1' $var2 = 'var2' ?> I get this output <br /> <b>Parse error</b>: syntax error, unexpected T_VARIABLE in <b>e:www estarray.php</b> on line <b>3</b><br /> shouldn't there be any links in that pointing to PHP manual in my php_manual dir? :-(
Strange Apache Error Log Messages When Viewing PHP Scripts
Whenever I would view any of my PHP scripts on any of a number of servers that I run, the Apache error logs on each of them would have this rather strange error: [Tue Mar 28 13:01:33 2006] [error] [client *.*.*.*] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/tools/myapp/tools, referer: http://www.myappworld.com/tools/myapp It never generates any PHP-related errors, warnings, notices, anything related to this of any kind; furthermore, all of my apps on all of my servers run with no problems whatsoever, however, multiple instances of this very same error message occurs at each page that I visit. there is no such file nor directory, of course, as "../htdocs/tools/myapp/tools", however, there is "/htdocs/tools/myapp".
"Cannot Find Module" Error Messages In PHP
Red Hat Enterprise Linux 4.X. I'm writing command-line PHP scripts for the first time. I get the messages below. What do they mean? Are these operating system library modules, or something in PHP that I don't have? Do I need to install more Linux packages? Or adjust PHP in some way? [dashley@pamc standalone]$ ./sitehashkeygen.php No log handling enabled - turning on stderr logging Cannot find module (IP-MIB): At line 0 in (none) Cannot find module (IF-MIB): At line 0 in (none) Cannot find module (TCP-MIB): At line 0 in (none) Cannot find module (UDP-MIB): At line 0 in (none) Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none) Cannot find module (SNMPv2-MIB): At line 0 in (none) Cannot find module (SNMPv2-SMI): At line 0 in (none) Cannot find module (NOTIFICATION-LOG-MIB): At line 0 in (none) Cannot find module (UCD-SNMP-MIB): At line 0 in (none) Cannot find module (UCD-DEMO-MIB): At line 0 in (none) Cannot find module (SNMP-TARGET-MIB): At line 0 in (none) Cannot find module (NET-SNMP-AGENT-MIB): At line 0 in (none) Cannot find module (HOST-RESOURCES-TYPES): At line 0 in (none) Cannot find module (LM-SENSORS-MIB): At line 0 in (none) Cannot find module (IPV6-ICMP-MIB): At line 0 in (none) Cannot find module (IPV6-MIB): At line 0 in (none) Cannot find module (IPV6-TCP-MIB): At line 0 in (none) Cannot find module (IPV6-UDP-MIB): At line 0 in (none) Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none) Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none) Cannot find module (UCD-DLMOD-MIB): At line 0 in (none) Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none) Cannot find module (SNMP-MPD-MIB): At line 0 in (none) Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none) Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none) Cannot find module (SNMPv2-TM): At line 0 in (none) Content-type: text/html X-Powered-By: PHP/4.3.9
Error Correction On Drop Down List & Sessions
Hi I'm doing a site at the mo and I have to do error correction on a form. I have most of it done except one or two bits. What I'm having trouble with is drop down lists. What happens is someone fills in the form, it's not done properly so it gets redirected back to the form. Everything works right except the drop down list. The sessions carries over alright but I can't get the drop down list session to work. It marks the session as selected but it's not displayed the first option is displayed. So if you picked Germany and America was first on the list. After being submited America would be displayed but Germany would be checked. Here is what I got Correction page $_SESSION["country"] = $_POST["country"]; if($_SESSION["country"] == Ɔ'){ header("Location: /acc1.php"); } Form page echo ' <td><select name="country" id="country" style="width: 150px;">' if (!isset($_SESSION["courtry"])){ echo '<option value="0" checked="checked"></option>' } $rslt = mysql_query($dscntry); if($rslt){ while ($rws = mysql_fetch_array($rslt)) { if (!isset($_SESSION["country"])){ echo '<option value="'.$rws["countryid"].'">'.$rws["countries"].'</option>' } elseif(isset($_SESSION["country"])){ if($_SESSION["country"] == $rws["countryid"]){ echo '<option value="'.$rws["countryid"].'" checked="checked">'.$rws["countries"].'</option>' // else{ // echo '<option value="'.$rws["countryid"].'">'.$rws["countries"].'</option>' // } } } } } echo '</select>'
List Subscribe Form
trying to make a simple subscribe form for an email list like so... $to = "news-subscribe@mysite.org"; mail($to, "subscribe", "subscribe", "From:$subscribe Reply-To:$subscribe"); but the email list never confirms the subscription by email so can't figure out whether its getting the email or not? nether the subject or body text are necessary, its the address that does the command, any ideas anyone?
Form Entry List
I have a form with one box into which users type a few words (an email address). That entry is emailed to me. I need to copy each entry into one text file automatically so I do not have to copy them manually out of each email one at a time. The result would be one text file with the entries listed down the page, one by one.
Dynamic Form Option List
I want to create a dynamic drop down option list in a form, but I just can't wrap my head around this. Both of the below scripts work as intended, but how do I make the mySql query results work with my existing script? Yes, I know I must replace the "$options = array" part in the top piece of code, but I need a little more guidance than that. Code:
How To Post A Form To A List Document
I'm not looking to learn alot of PHP right now but i am learning enough to get done what needs to be done. I need to no how to make a list document that gets and posted form from a different document and puts it into a list, . heres my form from my input.htm Code:
Dynamic Form - How To Set Values Of A List
I have a form with a list/menu in it that is populated with records from a database. The items in list#2 are based upon what is selected in list#1. I have been able to use a combination of php and javascript to get it to work, but the javascript reloads the page to get list #2 to refresh - and that clears out any other fields that have been filled in. Instead of javascript being called for the 'onchange' event for list #1, I'd rather it call php when list#1 is changed and so reset the values in list#2. OPTIONS: 1. I thought I could have a php function that is called (i.e. onchange="<?php reload();?>" but I can't figure out how to set the values of the list from within the php function. How to reference form objects with php?
Problems With Form Processing: Array_key_exists() And While (list($k,$v) = Each($arr))
I have an HTML form I'd like to process. <select name="items[]" multiple> <option value="doughnuts">Hot Doughnuts</option> <option value="coffee">Hot Brewed Coffee</option> <option value="tea">Hot Tea</option> <option value="cake">Sponge Cake</option> <option value="chips">Hot Chips</option> </select> The problem I have it where I follow the Programming PHP book: // Should the 's' be the name of the select tag, or the name of // the submit button? if (array_key_exists( 's', $_POST )) { $selected = "User selected these options: "; while (list($k, $v) = each($_POST['items'])) { // Is $v "doughnuts" or "Hot Doughnuts"? $selected .= "$v " } // ... }
Retrieve Array From FORM List Of Values?
I have created a form where a user selects 2 items from a list of 8 values. That form field is called "choices" and returns a value to the php file as $choices. This form posed no problem when I only allowed a single item to be selected, but the client now needs to have 2 items selected at a time. The problem I'm having is that I don't know how to turn the multiple selections on the form in to an array. I thought the $choices variable would automatically become an array, but Using[color=blue] > for ( $i = 0; $i<2; $i++ ) > echo "$choices[$i] ";[/color] only returns the first two letters of the last selected item value. And [color=blue] > foreach($choices as $articles) > echo $articles. ' ' ;[/color] Returns an invalid argument. While echo $choices returns the second item selected in the list, but not the first. It appears that the variable is replacing the first item selected with the second rather than returning an array.
Calling A Php Function From A Form Selection List
I have a function that will read records from the database and populate an area of my webpage based on a value selected from a list box. I have got it to work fine if the user hits a submit button but I was wondering if it possible to perform the function dynamically each time the user changes the value in the list box.
Print Array In List/menu Form Object
how i print a full column array into a list/menu form object, so that the text links to their respective page.....it is basically for a list of interviews so you click on the band name and then goto the interview page.
Retrieving Contents Of Select List On Form Submit
On an HTML form, I have a select list that is fed dynamically with detail records when the master record is displayed on the form. There is also a second lookup list, and want to allow the user to dynamically select from this list and add to the first list. I also want the user to be able to dynamically remove from and reorder the first list. I think I can do all of this with JavaScript. The question I have, is how can I retrieve the contents of the first list when the user submits the form? I need to get it back into a php array so I can update and add the proper database records.
Populate A Drop Down List In A Form On The Basis Of A First Selection
I have developed a form to register a property in a db. The form needs the selection of a country and then based on that selection the selection of regions from the selected country. I have a program which allows selection of a country and then a region but it uses java script which I would like to avoid. I also just wanted one submit button if possible. Code:
Displaying Data From Mysql Database In A Drop Down List On Form.
I'm trying to do is display data from two different mysql tables from the same database in a drop down list on a html form. I have a fixtures table with the player1(userid), player2(userid), gameid, game, score1 and 2, what I want is to use the userid to get the players first name and surname from the members table (as it is a unique id), I need to do this bit before displaying it in the drop down. I think i need 2 querys to do this but when I have tried it it just echo's a blank value or the userid not the forname and surname that I want. I'm using the fetch_array function but just can't see where I'm going wrong, Code:
Putting A Word Doc In A Mysql Db?
This one has been bugging me for months everytime i've tried i've had to give up and do something else. Anyone know how to do this, any help would be much appreciated. I think that I need to use a blob field is that correct?
Putting URL To Site On My Page
I am trying to pass the url of a page actually on to the page and I was using this: <?php echo print $PATH_INFO = str_replace("/", "-", $_SERVER['REQUEST_URI']);?> but I want to include this on an include file - so lets say that that code is on a page here: "/includes/page1.php" and then on page2.php I have this: <?php include('/page1.php'); ?> what happens is the URL on my page is written on the page as like "-page1.php" but what I want is it to say "-page2.php"
Putting Text Into A File
This code is supposed to create a file and insert some text into it. I had it working, but the file was not being put in the right place, so when I went to change it, this is what I got, and it doesn't put it there. Code:
Putting Results Into Columns
I am creating a directory of businesses for a web site. There are 8 main categories (dining, bars, entertainment, etc) and when a user clicks on a category it takes them to a page that lists all the businesses (and phone numbers) in that category in alphabetical order. The problem I have is that it does so in one big long column. Can anyone help me alter the code to display the results in 3 columns? I do want to keep them in alphabetical order, however if that is straight across or down does, it does not really matter to me. And I am fine with losing the Character (A, B, C, etc) header above each set if needed. Code:
Putting An Argument In $_POST[] ?
What I'm trying to do is combine two strings within the $_POST superglobal. I would like to add the variable '$id' and and a string of characters like 'GDP' in $_POST. If $id = 3, then the outcome should be $_POST[3GDP]. This value would then be inserted into MySQL. I don't know if this is at all possible.
Putting Multiple File In Array
Is there anyway to put the contents of several file into one array? Say I have 3 files, and I want the information in each of them loaded into the same array, possible using a wildcard like *.txt. Is this possible?
Exploding String, Then Putting It In Array
I have a script that reads the files in a dir, then explodes each file name. The files look like this: Artist - Album I want the explode the characters before the " - " (the artist) so I can collect a list of artists without the album info. I'm trying to explode the filename and then have it pushed into an array but it's not working. PHP Code:
Putting A Loop In A Fputs Function
I am trying to write a string to a text file. That string consists of a first and last name and then depending on the character length of those two strings a certain number of spaces after the two strings. The $namePad represents the number of spaces needed to fill in the line. So I set up a for loop inside the fputs function to write out however many spaces $namePad represents. This code fails when it hits the for loop line with a parse error. PHP Code:
Putting Content From Database Into Array
I have a problem with the following code, what i try to reach is that i want to compare a value with a value out of the database and if equal then display that else display that. The problem is that i can't put the content from a database row into an array, the following: PHP Code:
Putting/retriving Files Into A Database
its been a while since I posted/looked here... my normal email client doesn't handle newsgroups :( (ximian evolution) I was wondering how you stick a file into a database, and then retrive it again for the user with PHP/MySQL. I tried the following which apparently didnt work... Very quick overview of what I did... html ------ <input type="file" name="file"><input type="submit> PHP ------ $SQL = "INSERT INTO table (file) VALUES (" + $_REQUEST['file'] + ");"; I didn't even bother running the SQL querry, I just echoed it and I got the location of the file (ie: /home/eric/blah...) How do I get the file into the database, and once its there, how do i get it back out?
|