Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   What is the problem (http://www.go4expert.com/forums/what-is-the-problem-t19229/)

anchitjindal07 30Aug2009 13:36

What is the problem
The following code creates a form. In this form one of the field is for date and the code in process.php file checks whether entered date is valid or not. But it(process.php) is not giving any output.
HTML Code:

<form action="process.php" method="post">
Name:<input type="text" name="name"size="20" ><br><br>

Father's Name:<input type="text" name="fname" size="20"><br><br>

Address:<textarea name="address" rows="5" cols="40"></textarea><br><br>
Date of Birth(MM/DD/YYYY):<input type="text" name="dob"size="10"maxlength="10"><br><br>
Course:<select name="Course">
Branch:<select name="Branch">
Batch:<input type="text" name="batch" size="9" maxlength="9"><br><br>
Roll No.<input type="text" name="rno" size="3" maxlenght="3"><br><br>
Univ. Reg. No.<input type="text" name="reg" size="11" maxlength="11"><br><br>
<input type="radio" name="gender"value="Male">Male
<input type="radio" name="gender"value="Male">Female<br><br>
<input type="submit"value="Submit">
<input type="reset">

Code of process.php is
PHP Code:

'Valid Date';
'Invalid Date';

nimesh 31Aug2009 01:54

Re: What is the problem
Hi Anchit,

I don't know php but giving a shot.

the date input format you have specified as "MM/DD/YYYY" but in the code you are checking as "DD/MM/YYYY"

but even then you should get some output, good or bad :)

ungalnanban 27Feb2010 12:30

Re: What is the problem
in your code split second argument is wrong .
you need to give the $date variable.

See the following PHP code.



print $date;

echo 'Valid Date';
        echo 'Invalid Date';

All times are GMT +5.5. The time now is 05:20.