last day (14 days later) » 

8:13 AM
0
A: validate my form and header to another success page

Arif_suhail_123The reason behind your script is not showing any error is this that you set the value again for your error in the else statement which is empty; in these line else { $error = array( "coursesErr" => "", "careerObjectiveErr" => "", "otherJobTitleErr" =>...

 
sorry I removed the array completely in this case everything gos right but it also do not allow the error messages to display under every fields that has been empty or not allowed input
 
is your form after or before the php code thanks reply me quick
did you just change your last message?
 
yes .. I was wrong so corrected my self
 
ok my friend i am bit confused because as i told you it should work fine give me some answer like you are not able to display any error message like any error message. if you are able to display some than tell me please which one they are
 
my PHP code is before the HTML and about the messages it should appear under every field telling that this field is required or this is not allowed input ... on anther hand the process is going fine ... if the everything is OK in the fields it redirect to the success page and insert in the db and if there is any empty fields it stops but not showing the required under the fields ... is it clear now @Arif_suhail_123
 
8:13 AM
yah its was ok i got confused, sorry my bad, give me some time last time i just read your code and post a reply, so this time let me try your code i will message you after 10 minute or me be less or more
my freind i confused as hell, i just tried your code with two feild which you showed in your question here, without removing else statement i gave $error value in the else statement means i tried it with out removing else, as i know what i said you in the solution is right so i tried it my self, like you are inserting value to the database i just echo them, So if its successfull than echo the value, if not show the error under the field it work fine man. and i asked you that question where is your php code is because you complaint about the undefined index
and that you only gonna get if your form is above the php code, the first message of today which you change it remember thanks, if you want to see the code which i try let me know i will post it here for 5 or 10 minute so you can see
you know how you can come here
 
Yes the code is above HTML
PHP I mean is above the HTML code
 
my friend listen
 
yes I am with you
 
you wanna see the code which i tried just now
 
yes please
 
8:18 AM
because i am dead sure solutioon should work
ok but i will post breifly on there cause i dont want people to give downvote
 
that I should remove the else and the array
 
no yesterday i just read your code and reply to you, today when i got your message i tried your code updated php one and html
what i did i took only two feild which you showed us in your html code, remove your check_input as i dont need it i am just checking and it work fine and dandee, so if you see the code you will know why i am confuse
 
you can post it on somewhere like github
 
i dont know how to post on github is posting personal email addresses is allowed here or not
i can mail you and you can try it your self
 
yes of course here you are brother 'johnef_sh@hotmail.com'
 
8:24 AM
ok i am mailing you now
 
check it now
r i in
 
yes I try this too
 
but this will never get two messages like this field is empty or special Chr detected it will only get one message
 
8:33 AM
yes it will
you want me tell you how
 
OK show me please
 
let me check in which feild you are checking twice
in experince if statement you are checking two thing
 
yah but you have a same index
change the index for any one
just change it
after change it tell me what index you gave
 
see this screenshot I just did that
$error = array(
"coursesErr" => "Only letters, numbers and '_' allowed",
"experiencesErr" => "Experiences Required",
 
8:43 AM
no i thing you did not understand what i am trying to say
undo the change which you just did. and go to this line in your code
if (empty($_POST['experiences'])) {
$error['experiencesErr'] = "Experiences Required";
} else {
$experiences = check_input($_POST['experiences']);
if (!preg_match("/^[0-9_a-zA-Z ]*$/", $experiences)) {
$error['experiencesErr'] = "Only letters, numbers and '_' allowed";
}
}
in here for experinece you are checking two condition but for the both error
$error['experiencesErr'] = "Experiences Required"; AND $error['experiencesErr'] = "Only letters, numbers and '_' allowed";
you have same index which is ['experiencesErr'] is this if you understand i now please reply than we will move forward if you understand
 
OK I understand go forward ... and I will comeback to this screenshot again and tell u why I post it
 
ok no worry
so change one of the index let say second one we gonna change
make it to $error['onemore'] = "Only letters, numbers and '_' allowed";
i just give this name you can change it
after changing give me reply then we will go forward
 
done I changed it
so I will have this one now `<span class="notAllowed"><?php if (isset($error)){echo $error['experiencesErr'];}
$error['onemore'] = "Only letters, numbers and '_' allowed";?></span>`
ops sorry "<?php if (isset($error)){echo $error['experiencesErr']="this is required";}
$error['onemore'] = "Only letters, numbers and '_' allowed";?>"
 
nope this is not what i am talking about but we have to come on this line too change this line like the echo one echo $error['experiencesErr'].'<br/>'; echo $error['onemore'] = "Only letters, numbers and '_' allowed";
 
so I have now 2 index 1- experiencesErr and the other is 2- onemore that what you mean
 
8:55 AM
means both the error should be in curly bracket of if statement
"<?php if (isset($error)){echo $error['experiencesErr']="this is required".'<br/>'.;
$error['onemore'] = "Only letters, numbers and '_' allowed";?>"}
it should look like this
 
OK sorry I got you now
 
i added a line break here as well but that not like really needed what we are trying to achive
go on your question again search for if for experience condition its the second condition in the updated on php code
when you change you this line if (empty($_POST['experiences'])) {
$error['experiencesErr'] = "Experiences Required";
} else {
$experiences = $_POST['experiences'];
if (!preg_match("/^[0-9_a-zA-Z ]*$/", $experiences)) {
$error['experiencesErr'] = "Only letters, numbers and '_' allowed";
}
}
to this if (empty($_POST['experiences'])) {
$error['experiencesErr'] = "Experiences Required";
} else {
$experiences = $_POST['experiences'];
if (!preg_match("/^[0-9_a-zA-Z ]*$/", $experiences)) {
$error['onemore'] = "Only letters, numbers and '_' allowed";
}
}
reply me
 
yes I am with you Arif
 
no i just say when you finish than reply me
i make mistake in my english all the time
but i want you to be quick as i have to go some where but first i want to solve your problem
 
no Problem about the english, and I really thank you for this efforts
I am done
 
9:10 AM
you done yah
 
so now go in else where you have your $error array
in the question one
 
add this index to in your array like this but dont make any syntax mistake
and show me how your else statement look like now
"onemore"=>"new value",
 
ok this is my array now
$error = array(

"experiencesErr" => "Experiences Required",
"onemore" => "Only letters, numbers and '_' allowed",
"coursesErr" => "Only letters, numbers and '_' allowed",
"careerObjectiveErr" => "",
"otherJobTitleErr" => "",
"availabilityErr" => "",
"typeOfJobErr" => "",
"rankErr" => "",
"jTitleErr" => "",
"salaryRangeErr" => "",
"currencyErr" => "",
);
 
9:16 AM
ok now try to submit your form you should get error
you should get both error
 
yes done I got it just like the screenshot I show earlier
 
so your problem solve yah??
 
I can't say no but still one thing about the screenshot I sent to you, if you have time please
 
no u should say no if its not solved
because i will tell you what you did wrong its easy
first try submit it empty it will give you first error Experineces required
second time submit it with special charecter like @ it will give you second error like only letters and number allowed
yah we will get back to your screenshot as well as i know what you are trying to say with that screenshot
i am not sure may be i know
 
OK now there is two things one the 'Previous Courses' field is not required but every time I submit the form I get this message " Only letters, numbers and '_' allowed" even if I didn't right anything inside
 
9:24 AM
first let me reply the solution work there or not and i will check your previous courses problem in your code
and i will get back to you
 
one moment what about sending the whole page with code
 
sorry did not understand
like you wanna submit whole page?
 
I just sent you a mail check you mail please or ur junk
 
ok
and the reason behind may be your getting this error in your previous course that
no i cant explain just me the code for previoius course section in the html tag one
and i am refreshing my page for yahoo its taking ages to get refresh
you post me your code here for the previouscorse section html one as you have nothing in the php code
 
no problem I will wait
 
9:32 AM
and i did not got your mail for some reason
 
see you junk folder it may be there
 
my id is arif_suhail_123@yahoo.com
 
I did reply to ur mail ... I sent it again
 
ok but give the code as well which i asked from html for previous code
 
I attached a file with HTML and the PHP together in the same file
did you received it
 
9:38 AM
now i knew the mistake before you send me the code thats why i asked for that particular piece of code
i got your mail
<?php if (isset($error)) {
echo $error['coursesErr'];
} ?>
remove this line from prevous code section
like this should look like this
 
and replce it with
 
just remove it what this line is doing is caching the error from error Array, and displaying its doing exactly what you told it do, but you dont want no array here thats what you told me na?
no you want that error i think i got you wrong
explain me what again what is the problem there
 
OK there is two types of fields here 1- required 2- not required the required fields can be checked for if it's empty and if it has special Chr ... and the others that is not required it's checking for special Chr
 
yah i got you now you are asking that why still showing you that error when you dont enter any thing in it
yah
as this feild is not required
 
now when I submit the the from with all the error appears even if the fields is not empty it come with the error
yes you start t get the main problem
 
9:48 AM
ok wait let me change your code little bit and than i will message you
 
replace your code in php courses one
with this
if (empty($_POST['courses'])) {
$error['coursesErr'] = " ";
}else {
$courses = check_input($_POST['courses']);
if (!preg_match("/^[0-9_a-zA-Z ]*$/", $courses)) {
$error['coursesErr'] = "Only letters, numbers and '_' allowed";
}
}
this one you to have to change
$courses = check_input($_POST['courses']);
if (!preg_match("/^[0-9_a-zA-Z ]*$/", $courses)) {
    $error['coursesErr'] = "Only letters, numbers and '_' allowed";
}
and check again it should not give you that error any more
dont get confuse by enlgish please hope me you know which code you have to change with which
i and my english is messed up
 
no still gives the error
 
can you show me that part which i told you to change
 
if (empty($_POST['courses'])) {
$error['coursesErr'] = " ";
}else {
$courses = check_input($_POST['courses']);
if (!preg_match("/^[0-9_a-zA-Z ]*$/", $courses)) {
$error['coursesErr'] = "Only letters, numbers and '_' allowed";
}
}
"coursesErr" => "Only letters, numbers and '_' allowed",
<div class="TwoLine">
<label for="courses">Previous Courses</label>
<textarea name="courses" id="courses"></textarea>
<span class="notAllowed"><?php if (isset($error)) {
echo $error['coursesErr'];
} ?></span>
</div>
 
10:00 AM
ok yah wait i am checking on my side
give me five minute as i have to removed all your chech_input function
 
10:33 AM
my freind i do have your code
i tried other things they work fine
 
Yes please tell me ...
 
i promise if no one is able to solve it i will solve it your problem till tommorow tell e which time your going to come
 
what the time now in France Arif?
 
because i have to go some where and i gonna be back after 10-12 hours
r u in france?
 
No but I saw you are from France
I saw your profile
 
10:36 AM
no man i m in london i m stupid not the small one the big one
i had it france there i did not even know
the time in london is 11:36 at that moment
i gonna be back 3 o clock in the night
 
am is morning time na ?
 
yes it's
 
like its 11:36 am in london i gonna be back next morning 2 o clock
 
PM is night time
 
10:38 AM
so tell me which time you are going to come so i make sure i got ur thing solved
man reply me quick i want to go now
 
OK I will be waiting for u at the same time like today I think we started the chat at 11.00 and I will be waiting for you at that time or any time after that I will be still online tell 4.00PM
 
what the time now in ur area now
 
it's 1:40 PM
 
i am sorry i could not solve your problem but my head is exploding man i have to go shopping than sleep a little than go some where and than gonna come back
and sorry i could not solve it today but promise tommorow done deal
 
OK and again I'd like to thank you for this efforts really I obligated with that
 
10:43 AM
its bye take car i dont know how to log out if i cant logout out i will just close the window
 
see you soon my friend
 
if your muslim asslam alaikum
 
Yes I am Al Hamd llAh
Wy Alykom alslam
 

last day (14 days later) »