I have created a function to validate input.
function validate_dimension($value,$name) {
global $errors;
$errors = array();
......validation actions here - this all works fine - if I get an error it is captured like this . . .
$errors[] = "Dimension value missing";
This is all fine and the $error is returned correctly.
So that I can keep the error, I save it as a Session variable
$_SESSION['errors'] = $errors;
HOWEVER the next time I run the function (with the next dimension to be checked) , $_SESSION['errors'] is overwritten and the first error is lost.
I have solved the problem by creating a new array - $all_errors - and adding $errors to $all_errors each time the function is run - but this seems clumsy - I do not need the function as I could just as easily wite a separate line of code for each dimension to be checked.
Can anyone suggest a better way of doing this?
Please?
The IE or FF detector
Hello Friends,Problem of today ( we seek for php help ) as following ,we know all that PNG images not shown well on IE6 and some "css'ers" given us a solution --> fine 1but if that
Help building / using array
First - this is a cross-posting, if this is wrong I apologise! What started out as a MySQL query question (original post http://www.phpfreaks.com/forums/index.php/topic,273323.0.html) has become a PHP
WS-Security PL/SQL Forms
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod
Help With editting and deleting form
Hallo !!So look at this image :http://img194.imageshack.us/img194/8272/snapshot5f.png This table prints the titles of entries from a table in a database.. The code that i use for this table is this
upload image name with extension using php
hi frds..<input id="file1" type="file" name="file[]" >upload image show path like C:\Documents and Settings\My Documents\My Pictures\images0056.jpgi need
PHP Thumbnail Creation
Ok so i use this function to create thumbnails:Code: function createthumb($name,$filename,$new_w,$new_h){ $system=explode('.',$name); $src_img=imagecreatefrompng($name);
Limiting checkboxes?
Hi guys, I have this code: Code: if(isset($_POST['selected'])) { foreach($_POST['selected'] as $item) { $sql = "SELECT * FROM tablename WHERE ID=$item"; mysql_query($sql) or
Form always sends to error page...
Hello,Any help will be greatly appreciated. I am having trouble getting multiple fields to be required, and with the if multiple errors section. I think that's where the problem is. When I click
SESSION CHECK WORKS "MOST" of the time... whats going on?
i have a sign in check thats included in every page that is a members only page which is basically all of my pages. that im working on anyways..but heres the code..... that works MOST of the time.
cURL Sending File as Post
This is a bit complicated, I'm just hoping someone else has run into this and knows how to do it a different way or make it work.When sending a file as part of form information included in a cURL