Welcome! Log In Create A New Profile

Advanced

validation.php submit error

Posted by FinalOracle 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
validation.php submit error
March 11, 2013 11:56AM
hi guys

i have created the validate.php page,

when i click the validate button the first and second time it does produce the expected result but the third time it requires even the data that was validated already

this what i tried :

Language: PHP
if(count($errors_array) != 0) {   show_errors();   if(isset($_REQUEST["two"])){ // from a hidden field in the second form presented show_errors(); }   }

it works but i have to reload the validation.php page after using the validate button 3 times

Any suggestions?
Re: validation.php submit error
March 11, 2013 02:28PM
It require the validation data how do u hv 2 re enter it or what?
Re: validation.php submit error
March 11, 2013 02:36PM
@ finalOracle I would advice u to also type the error msg it shows if there s any.
Re: validation.php submit error
March 11, 2013 02:51PM
hi

it does not give an error msg, but requires that you re-enter the information it previously validated

e.g.

if you add name and surname then it will tell you that age and address are missing and present the form for you to resubmit them, say u add age and leave out the address then it will ask you to enter the age, name, surname and address. not only the address you left out

hope its clear

bye
Re: validation.php submit error
March 11, 2013 02:54PM
it works only if you reload the page after resubmitting it
avatar
Mac
Re: validation.php submit error
March 11, 2013 03:46PM
Not too clear....if it does it two times, then it should do it three and more times. Just check that you all the information you send back to the form is correct. At the top of the page, echo out what is received by the page. Or use a GET method, then you can see in the URL what is send back to the page every time.
Re: validation.php submit error
March 11, 2013 05:14PM
thanks

it works now,

i found out it was resetting the variables and sending them blank, that's why it was asking me to refill the data it had previously verified

bye
,
Re: validation.php submit error
March 12, 2013 09:20AM
That's good 2 hear so ur also waiting for further pages as well like me.
Re: validation.php submit error
March 15, 2013 01:27PM
yes
Re: validation.php submit error
April 17, 2013 10:38PM
Good day guys,

I am in need of some help, I seem to get this error on my validation page. "Parse error: syntax error, unexpected 'POST' (T_STRING), expecting ',' or ';' in /home/vhosts/tarish.freeoda.com/validation.php on line 47"

I do understand what the error means. I have used the idea in the textbook.

The thing is that I have tried other methods to make this code work, by making the form and the php coding separate which I have been recieving other errors. So I made a choice to keep this code and work with it because it was given in the book not for nothing. So if it is in the book (Pg235), I want to use the same logic in my code.

Could you guys assist by showing what I am doing wrong with my entire code that it is not reconizing my form even thou I "echo" it out.

Refer below to code!

Language: PHP
<?php     function show_welcome() { $title = isset($_REQUEST["title"]) ? $_REQUEST["title"] : ""; $name = isset($_REQUEST["name"]) ? $_REQUEST["name"] : ""; $surname = isset($_REQUEST["surname"]) ? $_REQUEST["surname"] : ""; $address = isset($_REQUEST["address"]) ? $_REQUEST["address"] : ""; $age = isset($_REQUEST["age"]) ? $_REQUEST["age"] : ""; echo "<form method ="POST" action ="validation.php">"; echo "<p>TITLE:<br>"; echo "<input type ="text" name ="title" size =4 value=';", $title, "';></p>"; echo "<p>NAME:<br>"; echo "<input type ="text" name ="name" size =30 value=';", $name, "';></p>"; echo "<p>SURNAME:<br>"; echo "<input type ="text" name ="surname" size =30 value=';", $surname, "';></p>"; echo "<p>ADDRESS:<br>"; echo "<input type ="text" name ="address" size =70 value=';", $address, "';></p>"; echo "<p>AGE:<br>"; echo "<input type ="age" name ="age" size =2 value=';", $age, "';></p>"; echo "<p><input type ="submit" name ="submit" value ="Submit"></p>"; echo "<input type=hidden name=';welcome_already_seen'; value=';already_seen';>"; echo "</form>"; }   ?>
avatar
Mac
Re: validation.php submit error
April 18, 2013 09:11AM
on line 47 there is a typing error
Re: validation.php submit error
April 18, 2013 06:34PM
Thanks Mac, I did not see my silly mistake thumbs up smiley

I feel really stupid after that one, but thanks for your assistance.
Re: validation.php submit error
April 18, 2013 11:58PM
HI Guys,

I have a problem with my submit button, it only works the first time the validation page is loaded, for example, if i submit the form with some empty fields i will get error messages but when i fill in those empty fields and submit for the second time it those nothing. Can someone help.

Thanx
avatar
Mac
Re: validation.php submit error
April 19, 2013 08:52AM
It can only mean the form is not part of the page presentation when data is submitted for validation. It will depend if you made use of if/else and where your form is presented. Difficult to say, Post the main parts of the code showing the flow, using comments to replace code
Re: validation.php submit error
April 24, 2013 09:01PM
Hi Mac
do we need to create a database to save user info?
avatar
Mac
Re: validation.php submit error
April 25, 2013 07:59AM
Not sure which page you are referring to, but just do what is required.
Sorry, only registered users may post in this forum.

Click here to login