Jump to content

Making a register form simple!


unistake

Recommended Posts

Hi guys,

ive tried to make sence of the most efficient way to process a registration form. Ive come across so many different ways.

I am trying to put all the $_POST variables in to one array like..

<?php foreach ($_POST as $field => $value){} ?>

to check that they all have some value in them.

However when I come to

<?php if ($field == 0){echo "you must enter the following fields <br> $field<br>";
?>

 

The problem with this as you would have seen is that it loops continuously and also even if a value has been entered in a particular field, it will still be echoed.

Is there some way to put the empty fields in to some sort of array, and then echo those values instead?

 

Please enlighten me! thanks

Link to comment
https://forums.phpfreaks.com/topic/142782-making-a-register-form-simple/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.