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?
How do I get the row number from from an sql table query
Hi allI have a table that I query and it returns a number of rows.mysql_num_rows($query) = $totalI want to have next and previous buttons, is there a way of retrieving the current row number, and can
rand() function
just a general question guys a girls, is the rand() function 100% random or is it based on time?
Inserting the current date/time while submitting the forum
What do I need to add below to update the current date/time? I have a field in the database called datetime. I tried to use Now() but its not working. Code: <?php$con =
Request for tunning the below query
Hi,
Required to login help
I'm trying to set up my site so users have to be logged into the forum to access the site.I've been working with this bit of codeCode: [Select]<?phpwriteLog();if
Not Loading Function Into Div
I'm not sure whether to put this under the php forum or ajax forum but because I tink it's more of an issue wit the php code itself I decided to put it here. I came across this file from a friend that
How to refresh a parent page from a modal popup
Hi,I have a modal popup in which I need to upload a file and store in the database should give a message to the user that file is uploaded and update the parent page when I close the
Passing Arguments to execlp()
I'm writing a program that mimics a unix shell. It's supposed to take commands with arguments and execute them. I'm having trouble passing in the arguments into the execlp call to correctly execute
C++ Http request?
Code:
Search in the PHP Files
have to search asterisk(*) in the php code of the php files .