Cannot understand been through this 3 times now and still no joy.
below id the index.php page it worked fine until i added this array to the process.php page
[php]index.php
', $msg , '
- Name * <?php if (isset($err_myname)) { echo $err_myname; } ?> <?php if (isset($err_patternmatch)) { echo $err_patternmatch; } ?>
- Password <?php if (isset($err_passlength)) { echo $err_passlength; } ?>
- Password (confirm) <?php if (isset($err_mypassconf)) { echo $err_mypassconf; } ?>
-
Favorite Music
- /> Rock
- /> Classical
- /> Reggaeton
- How did you hear about us? Choose... >A friend >Facebook >Twitter
-
Request Type
- /> Question
- /> Comment
- /> Suggestion
- Comment: (html is not allowed) <?php if (isset($mycomments)) { echo $mycomments; } ?>
process.php
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', '1');
if (($_SERVER['REQUEST_METHOD'] == 'POST') && (!empty($_POST['action']))):
if (isset($_POST['myname'])) { $myname = $_POST['myname']; }
if (isset($_POST['mypassword'])) { $mypassword = $_POST['mypassword']; }
if (isset($_POST['mypasswordconf'])) { $mypasswordconf = $_POST['mypasswordconf']; }
if (isset($_POST['mycomments'])) {
$mycomments = filter_var($_POST['mycomments'], FILTER_SANITIZE_STRING );
}
if (isset($_POST['reference'])) { $reference = $_POST['reference']; }
if (isset($_POST['favoritemusic'])) { $favoritemusic = $_POST['favoritemusic']; }
if (isset($_POST['requesttype'])) { $requesttype = $_POST['requesttype']; }
$formerrors = false;
if ($myname === '') :
$err_myname = 'Like i say it worked fine until i added this to the page
$formdata = array (
‘myname’ => $myname,
‘mypassword’ => $mypassword,
‘mypasswordconf’ => $mypasswordconf,
‘mycomments’ => $mycomments,
‘reference’ => $reference,
‘favoritemusic’ => $favoritemusic,
‘requesttype’ => $requesttype
);
cannot see anything wrong as of yet been through it three times and result the same in browser.
Notice: Undefined variable: favoritemusic in C:\xampp\htdocs\webs\06-01\workingfolder\forms\process.php on line 37
Notice: Undefined variable: requesttype in C:\xampp\htdocs\webs\06-01\workingfolder\forms\process.php on line 39
Thanks for filling out our form