PHP Form Help!!
Posted: Wed Dec 06, 2006 5:09 pm
feyd | Please use
The array is located in an included file called english.php. Now here's what I'm having problems with, I want $msg to display all the errors stored to it. Meaning if a user doesn't enter a username and doesn't enter a password I want it to return both those values but the way it is now, it only stores the latter value. My question is how I can store and display 2 different variables. Or atleast point me in a direction on how to go about doing so. Thanks in advance.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I Could use some help on a PHP project. I'm a bit new to PHP and I'm currently building a registration/login form. Now here's what I have to detect if the user as filled out all the necessary values:Code: Select all
<?php
include 'english.php';
$username=$_POST['userid'];
$upassword=$_POST['upassword'];
$cpassword=$_POST['cpassword'];
$email=$_POST['email'];
$name=$_POST['name'];
$msg="";
$Status="True";
global $LANG01;
if (strlen($username) > 10) {
$msg = ($LANG01[1]);
} elseif (empty($username)) {
$msg = ($LANG01[2]);
}
if (strlen($upassword) < 6) {
$msg = ($LANG01[3]);
} elseif (empty($upassword)) {
$msg = ($LANG01[4]);
}
echo $msg;
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]