Hello,
I’m trying to create a $_SESSION called ‘cname’ from the data inserted into this form.
Here’s my PHP to slightly validate it:
[code=php]
if (!isset($_POST[‘company_name’][3])) {
$companynameclass = “errortext”;
$cn = FALSE;
} else {
$cn = escape_data(strip_tags(stripslashes(trim($_POST[‘company_name’]))));
$companynameclass = FALSE;
}
and the HTML input field
[code=html]
<div class=”required”>
<label for=”company_name” class=”<?php if (!empty($companynameclass)) { echo $companynameclass; } ?>”>Company Name:</label>
<input type=”text” name=”company_name” id=”company_name” class=”inputText” size=”10″ maxlength=”60″ value=”<?=$_POST[company_name] ?>”/>
<?php if (!empty($companynameclass)) { echo ‘<p class=”errortext2″>Please enter a company name.</p>’; }?>
</div>
Can someone show me how to create the SESSION in the first place then update it if the value changes??
Thanks a million!