Hi,
PHP newbie here, trying to validate form data. I did a search for a solution but did not understand the other posts concerning this subject.
Here's what I want to do:
I have a form that accepts input to search a database. I want to make sure that the user inputs data in the form field and that at least 3 characters are inputed. I currently use javascript but users can turn that off so I want to use PHP.
Here are the form tags in the current html form (I am just using 2 fields in this example). If I rename the form myform.php what would be the php coding I would need to add to accomplish my objective?
<form action="cgi-bin/myscript.cgi" method=post>
<input type=text name=field1>
<input type=text name=field2>
<input type=submit value=search>
</form>
Thanks! Again, I am new and trying to learn PHP but since I don't know any other programming languages it is difficult. If you could just write a code example I would be most grateful!