php pass single product to cart with hidden field - php

I am trying to redirect a form to a shopping cart with one product in it at the same price. There is a redirect in place that if the cart it empty it goes to another page an I would like that to not happen. Here is the form code:
<form method="post" onSubmit="return varifyForm()">
<?php
if( $this->session->flashdata('error_msg') != ''){
?>
<p style="font-weight:bold; color:#F00;"><?php echo $this->session->flashdata('error_msg'); ?></p>
<?php
}
?>
<?php
if( $this->session->flashdata('success_msg') != ''){
?>
<p style="font-weight:bold; color:#0F0;"><?php echo $this->session->flashdata('success_msg'); ?></p>
<?php
}
?>
<div class="form-group">
<label><strong>Name*</strong></label>
<div class="row">
<div class="col-sm-6">
<input type="text" class="form-control" placeholder="First" style="margin-bottom:5px;" id="" name="terms[first_name]" value="" required>
</div>
<div class="col-sm-6">
<input type="text" class="form-control" placeholder="Last" style="margin-bottom:5px;" id="" name="terms[last_name]" value="" required>
</div>
</div>
</div>
<div class="form-group">
<label><strong>Password*</strong></label>
<div class="row">
<div class="col-sm-6">
<input type="password" class="form-control" id="" name="password" value="" placeholder="Enter Password" style="margin-bottom:5px;" required>
</div>
<div class="col-sm-6">
<input type="password" class="form-control" placeholder="Confirm Password" id="" name="confirm_password" value="" style="margin-bottom:5px;" required>
</div>
</div>
</div>
<div class="form-group">
<label><strong>Email*</strong></label>
<input type="email" class="form-control" id="" name="terms[email]" value="" placeholder="Email" required>
</div>
<div class="form-group">
<label for="sel1"><strong>User Role*</strong></label>
<select class="form-control" id="user_role" name="terms[user_role]">
<option value="Member">Member</option>
</select>
</div>
<div class="form-group">
<label for="sel1"><strong>Your Cause*</strong></label>
<select class="form-control" id="cause" name="terms[cause]">
<option value="<?php echo $causes['user_id']; ?>"><?php _e($causes['nonprofit_name']); ?></option>
</select>
</div>
<div class="form-group">
<label><strong>Zip Code*</strong></label>
<input type="text" class="form-control" id="" name="terms[zip]" value="" required>
</div>
<div class="form-group">
<label><strong>Terms and Conditions*</strong></label>
<div class="checkbox-inline full">
<input type="checkbox" id="terms">
<strong>I agree to the</strong> <strong>Terms and Conditions</strong>
</div>
</div><br>
<button type="submit" name="btnSignUp" value="signup" class="btn btn-primary"><p style="margin:0;">NEXT</p></button>
</form>
I have been stuck fixing someone else's work and appreciate any help that can be given. Let me know if any other information is needed.
Thank you!

Hi as you mentioned the below sample code may helpful to you. If you require additional help please tell me.
if(!empty($_POST['cart'])){//what ever the cart item name please replace with it.
$cart["{item_id}"] = ["quantity"=>"{qty}","price"=>"{fixed _price}"];
$_SESSION['cart']=$cart;
header('Location: redirect.php'); //replace with your actual redirect page to redirect.php
}else{
header('Location: redirect_other.php'); //replace with your actual other redirect page to redirect_other.php
}

Related

What's wrong with my button?

`<div class="tab-content">
<div class="row">
<div class="col-lg-6">
<form method="post" data-toggle="modal" enctype="multipart/form-data" action="data/pegawai/proses.php">
<div class="form-group">
<label>NIP</label>
<input class="form-control" name="nip" type="text" value="<?php echo $r['nip'];?>" readonly="">
</div>
<div class="form-group">
<label>Nama Lengkap</label>
<input class="form-control" type="text" value="<?php echo $r['nm_pegawai'];?>" name="nama" placeholder="Nama Lengkap" autofocus="" required="">
</div>
<div class="form-group">
<label>Jenis Kelamin</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" name="jk" id="optionsRadiosInline1" value="Laki-laki" <?php $ob->cek("Laki-laki",$r['jenis_kelamin'],"radio") ?>>Laki-laki
</label>
<label class="radio-inline">
<input type="radio" name="jk" id="optionsRadiosInline2" value="perempuan" <?php $ob->cek("Perempuan",$r['jenis_kelamin'],"radio") ?>>perempuan
</label>
</div>
</div>
<div class="form-group">
<label>Tempat Lahir</label>
<input class="form-control" type="text" value="<?php echo $r['tempat_lahir'];?>" name="tmp_lahir" placeholder="Tempat Lahir" required="">
</div>
<div class="form-group">
<label>Tanggal Lahir</label>
<input type="date" name="tgl_lahir" value="<?php echo $r['tanggal_lahir'];?>" class="form-control" placeholder="Tanggal Lahir" required="">
</div>
<div class="form-group">
<label>Agama</label>
<select class="form-control" name="agama" required="">
<option <?php $ob->cek("Islam",$r['agama'],"select") ?> value="Islam">Islam</option>
<option <?php $ob->cek("Kristen",$r['agama'],"select") ?> value="Kristen">Kristen</option>
<option <?php $ob->cek("Katholik",$r['agama'],"select") ?> value="Katholik">Katholik</option>
<option <?php $ob->cek("Protestan",$r['agama'],"select") ?> value="Protestan">Protestan</option>
<option <?php $ob->cek("Hindu",$r['agama'],"select") ?> value="Hindu">Hindu</option>
<option <?php $ob->cek("Budha",$r['agama'],"select") ?> value="Budha">Budha</option>
</select>
</div>
<div class="form-group">
<label>Alamat</label>
<textarea class="form-control" name="alamat" rows="3" placeholder="Alamat Lengkap" required=""><?php echo $r['alamat'];?></textarea>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label>Nomor Telepon</label>
<input class="form-control" type="text" value="<?php echo $r['no_telp'];?>" name="telp" onkeypress="return isNumberKey(event)" maxlength="15" placeholder="Nomor telepon" required="">
</div>
<div class="form-group">
<label>Tahun Masuk</label>
<input class="form-control" type="text" value="<?php echo $r['tahun_masuk'];?>" name="thn_masuk" placeholder="Tahun Masuk" onkeypress="return isNumberKey(event)" maxlength="4" required="">
</div>
<div class="form-group">
<label>Bagian</label>
<select class="form-control" name="bagian" required="">
<option <?php $ob->cek("Teller",$r['bagian'],"select") ?> value="Teller">Teller</option>
<option <?php $ob->cek("CSO",$r['bagian'],"select") ?> value="CSO">CSO</option>
<option <?php $ob->cek("BO",$r['bagian'],"select") ?> value="BO">BO</option>
</select>
</div>
<div class="form-group">
<label>Cabang</label>
<?php
echo '<select class="form-control" name="cabang" required="">';
$query=mysql_query("
SELECT *
FROM bank");
while($entry1=mysql_fetch_array($query))
{
echo "<option";
if($entry1['kd_bank']==$r['kd_bank']){echo " selected=selected";}
echo " value='".$entry1['kd_bank']."'>" . $entry1['nm_bank'] . "</option>";
}
echo "</select>";
?>
</div>
<div class="form-group">
<label>Kata Sandi</label>
<input class="form-control" type="password" value="<?php echo $r['password']?>" name="password" placeholder="Kata Sandi">
</div>
</div>
<!-- /.col-lg-6 (nested) -->
</div>
<!-- /.row (nested) -->
<div class="modal-footer">
<button type="button" name="ubah" class="btn btn-primary">Ubah</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</form>
</div> `
my source code, my button cannot active, how to solving it?
Thank you
Pandhu
Make your button type as "submit" like below.
<button type="submit" name="ubah" class="btn btn-primary">Ubah</button>
Else you can also keep it as button, but in that case u need to use ajax(javascript) and onclick event on button , for example :
<button type="button" name="ubah" class="btn btn-primary" onclick="save()">Ubah</button>
where save() is some function in javascript that you will create to save the form data.

Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\petrol_pump\add_customer.php on line 219 [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
i got this error on some specific pc's but when i run this program on another pc it will work 100% properly
i run this code on various system but some system give errors.
so any one can help me
please
in advance thank you
<?php include('common/header.php');
$test=$_GET['id'];
if(isset($_GET['id'])){
if(isset($_GET['id'])){
$user_data=$db->SelectSingle("customer_details","cust_id=".$_GET['id'],"","");
}
}
$state=$db->SelectTable("state","","");
?>
<form class="form-horizontal" action="add_customerins.php" method="post">
<fieldset>
<div class="span5">
<legend>Customer Details</legend>
<div class="control-group">
<label class="control-label">Customer Name :</label>
<div class="controls">
<input type="text" class="input-large" name="cust_name" id="cust_name" value="<?=$user_data['customer_name'];?>" placeholder="Customer Name">
</div>
</div>
<div class="control-group">
<label class="control-label">Customer Address :</label>
<div class="controls">
<textarea class="span11" rows="3" name="cust_adr" id="cust_adr"><?=$user_data['customer_address'];?></textarea>
</div>
</div>
<div class="control-group">
<label class="control-label">Customer E-mail :</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on">#</span><input type="text" value="<?=$user_data['customer_email'];?>" name="cust_email" id="cust_email" placeholder="Email Address" class=" ">
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">Alternate E-mail :</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on">#</span><input type="text" value="<?=$user_data['cust_alt_email'];?>" name="alt_email" id="alt_email" placeholder="Alternate Email Address" class=" ">
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">Customer Phone No. :</label>
<div class="controls">
<input type="text" class="input-large" value="<?=$user_data['cust_phone'];?>" name="cust_ph" id="cust_ph" placeholder="Phone No">
</div>
</div>
<div class="control-group">
<label class="control-label">Alternate Phone No. :</label>
<div class="controls">
<input type="text" class="input-large" value="<?=$user_data['cust_alt_phone'];?>" name="alt_ph" id="alt_ph" placeholder="Alternate Phone No">
</div>
</div>
<div class="control-group">
<label class="control-label">State :</label>
<div class="controls">
<select tabindex="1" class="span8" name="cust_st" id="cust_st" >
<option value="">Select State</option>
<?php if(count($state)>0){
foreach($state as $stat)
{ ?>
<option value="<?=$stat['stid'];?>"<?php if($stat['stid']==$user_data['state_id']){ echo "selected";}?>><?=$stat['state_name'];?></option>
<?
} }
?>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label">Pincode :</label>
<div class="controls">
<input type="text" class="input-large" value="<?=$user_data['pincode'];?>" name="cust_pin" id="cust_pin" placeholder="Pincode">
</div>
</div>
</div>
<div class="span5">
<!-- BEGIN SAMPLE FORMPORTLET-->
<legend>Customer Tax Details</legend>
<div class="control-group">
<label class="control-label">VAT No. :</label>
<div class="controls">
<input type="text" class="input-large" value="<?=$user_data['cust_vat'];?>" name="vat_no" id="vat_no" placeholder="VAT No">
</div>
</div>
<div class="control-group">
<label class="control-label">TIN No. :</label>
<div class="controls">
<input type="text" class="input-large" value="<?=$user_data['cust_tin'];?>" name="tin_no" id="tin_no" placeholder="TIN No">
</div>
</div>
</div>
</fieldset>
<div align="center">
<input type="submit" name="submit" class="btn btn-info" value="Save" />
<input type="reset" name="reset" class="btn btn-danger" value="Reset" />
</div>
<input name="cstid" type="hidden" value="<?=$test;?>" />
<input name="MM_up_insert" type="hidden" value="insert_up"/>
</form>
As i stated in the comments, you're missing a closing brace (}).
This is the block of code that is causing the issue:
<?php
if (count($state) > 0) {
foreach ($state as $stat) {
?>
<option value="<?= $stat['stid']; ?>"<?php
if ($stat['stid'] == $user_data['state_id']) {
echo "selected";
}
?>><?= $stat['state_name']; ?></option>
<?
} }
?>
Notice that last bit?
<?
} }
?>
You're using php short tags and you probably don't have them enabled.
Change that to this:
<?php
} }
?>
And that should fix your error

HTML - form acting weird. Not redirecting to URL and using GET instead of POST

I'm a CS student and I have a DB project due in less than 24hrs! This is really annoying because I just need to forms to access my DB. Anyway, I have this form that works perfectly, while the second form does not work. Instead of posting and directing to the correct URL the second form re-loads the current page with the variables in the URL. Anybody have any ideas?
<form role="form" method="post" action="../controller/AddPerson.php">
<div class="box-body">
<div class="form-group">
<label for="newReservationFirstName"> First name</label>
<input type="text" class="form-control" name="newReservationFirstName" placeholder="Enter first name">
<label for="newReservationLastName"> Last name</label>
<input type="text" class="form-control" name="newReservationLastName" placeholder="Enter last name">
<label for="newReservationPhoneNumber"> Phone Number</label>
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-phone"></i>
</div>
<input type="text" class="form-control" name="newReservationPhoneNum" data-inputmask='"mask": "(999) 999-9999"' data-mask/>
</div><!-- /.input group -->
<label for="newReservationStreetAddress"> Street Address</label>
<input type="text" class="form-control" name="newReservationStreetAddress" placeholder="Enter street address">
<label for="newReservationCity"> City</label>
<input type="text" class="form-control" name="newReservationCity" placeholder="Enter city">
<label for="newReservationState"> State</label>
<select class="form-control" name="newReservationState">
<?php
$result = getTableOrderBy('States','stateName');
while($row = mysql_fetch_array($result)) {
echo "<option value=".$row[stateAbbr].">".$row[stateName]."</option>";
} ?>
</select>
<label for="newReservationZip"> Zip Code</label>
<input type="text" class="form-control" name="newReservationZip" placeholder="Enter zipcode">
</div>
<button type="submit" class="btn btn-success btn-lg">Add New Customer</button>
</div>
</form>
This is the form that doesn't work correctly, both pages exist on the server:
<form role="form" method="post" action="../controller/AddEmployee.php">
<div class="box-body">
<div class="form-group">
<label for="newEmployeeFirstName"> First name</label>
<input type="text" class="form-control" name="newEmployeeFirstName" placeholder="Enter first name">
<label for="newEmployeeLastName"> Last name</label>
<input type="text" class="form-control" name="newEmployeeLastName" placeholder="Enter last name">
<label for="newEmployeePhoneNumber"> Phone Number</label>
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-phone"></i>
</div>
<input type="text" class="form-control" name="newEmployeePhoneNum" data-inputmask='"mask": "(999) 999-9999"' data-mask/>
</div><!-- /.input group -->
<label for="newEmployeeStreetAddress"> Street Address</label>
<input type="text" class="form-control" name="newEmployeeStreetAddress" placeholder="Enter street address">
<label for="newEmployeeCity"> City</label>
<input type="text" class="form-control" name="newEmployeeCity" placeholder="Enter city">
<label for="newEmployeeState"> State</label>
<select class="form-control" name="newEmployeeState">
<?php
$result = getTableOrderBy('States','stateName');
while($row = mysql_fetch_array($result)) {
echo "<option value=".$row[stateAbbr].">".$row[stateName]."</option>";
} ?>
</select>
<label for="newEmployeeZip"> Zip Code</label>
<input type="text" class="form-control" name="newEmployeeZip" placeholder="Enter zipcode">
<p></p>
<p></p>
<label for="newEmployeeFirstName"> Account Username</label>
<input type="text" class="form-control" name="newEmployeeUsername" placeholder="Enter username">
<label for="newEmployeeLastName"> Account Password</label>
<input type="text" class="form-control" name="newEmployeePassword" placeholder="Enter password">
<label for="newEmployeePhoneNumber"> Social Security Number</label>
<input type="text" class="form-control" name="newEmployeeSocial" placeholder="Enter SSN">
<div class="form-group" name="newEmployeePrivileges">
<br>
Privileges :
<select name="newEmployeePrivileges">
<option value="admin">Admin</option>
<option value="admin">Non-Admin</option>
</select>
</div>
<button type="submit" class="btn btn-success btn-lg">Add New Employee</button>
</div>
</div>
</form>
----------------------------------EDIT ----------------------------------------------
I tried making a another really simple form on some extra space and it still didn't work. I have no idea what could be cause it to do this.
<form method="post" action="post" action="../controller/AddEmployee.php">
<button type="submit" class="btn btn-success btn-lg">Add New Employee</button>
</form>
It could be that the button tag you are using to submit the form is causing it behave strangely. Try swapping out the button tag for an input. So:
<form method="post" enctype="multipart/form-data" action="../controller/AddEmployee.php">
<input type="submit" class="btn btn-success btn-lg" name="submit" >Add New Employee</input>
</form>
Also, I noticed you've included two 'action' attributes in your example form :-)

How to stop form submission after validation has suceeded

I was wondering if there was a way I could stop the form from being submitted normally after Jquery validation has actually succeeded.
I would like some other function to take care of submitting the form. I'd like the form to be validated but not submitted. Hope anyone can help
I'm using the VarienForm validation class.
here'a an example below:
var newform = new VarienForm('newform', true);
Thanks in advance.
here's my form:
<form id="newform" >
<div class="fieldset">
<h2 class="legend">User Details</h2>
<ul class="form-list">
<li class="fields">
<div class="field">
<label for="firstname" class="required"><em>*</em>First Name</label>
<div class="input-box">
<input name="firstname" id="firstname" title="First Name of Staff" value="<?php if (isset($user->firstname)){ echo $user->firstname; } ?>" class="input-text required-entry" type="text" tabindex="1"/>
</div>
</div>
<div class="field">
<label for="lastname" class="required"><em>*</em>Last Name</label>
<div class="input-box">
<input name="lastname" id="lastname" title="Last Name of Staff" value="<?php if (isset($user->lastname)){ echo $user->lastname; } ?>" class="input-text required-entry" type="text" tabindex="2"/>
</div>
</div>
</li>
<li class="fields">
<div class="field">
<label for="othername" class="required"><em>*</em>Other Name (s)</label>
<div class="input-box">
<input name="othername" id="othernames" title="Other Name(s)" value="<?php if (isset($user->othername)){ echo $user->othername; } ?>" class="input-text" type="text" tabindex="3"/>
</div>
</div>
<div class="field">
<label for="phone" class="required"><em>*</em>Phone Number</label>
<div class="input-box">
<input name="phone" id="phone" title="Phone Number" value="<?php if (isset($user->phone)){ echo $user->phone; } ?>" class="input-text validate-number" type="text" tabindex="4"/>
</div>
</div>
</li>
<li class="fields">
<div class="field">
<label for="username" class="required"><em>*</em>User Name</label>
<div class="input-box">
<input name="username" id="username" title="User Name" value="<?php if (isset($user->username)){ echo $user->username; } ?>" class="input-text required-entry" type="text" tabindex="5" />
</div>
</div>
<div class="field">
<label for="email" class="required"><em>*</em>Email</label>
<div class="input-box">
<input name="email" id="email" title="User Email" value="<?php if (isset($user->email)){ echo $user->email; } ?>" class="input-text validate-email" type="text" tabindex="6" />
</div>
</div>
</li>
<li class="fields">
<div class="field">
<label for="password" class="required"><em>*</em> Password</label>
<div class="input-box">
<input name="password" id="password" title="Password" value="<?php // if (isset($user->password2)){ echo $user->password2d; } ?>" class="input-text validate-password required-entry" type="password" tabindex="7"/>
</div>
</div>
<div class="field">
<label for="password2" class="required"><em>*</em>Confirm Password</label>
<div class="input-box">
<input name="password2" id="password" title="Confirm Password" value="<?php // if (isset($user->password2)){ echo $user->password2; } ?>" class="input-text validate-password required-entry validate-cpassword" type="password" tabindex="8"/>
</div>
</div>
</li>
<li class="fields">
<div class="field">
<label for="Role" class="required"><em>*</em>Role</label>
<div class="input-box">
<?php $roles = Role::find_all(); if ($roles){ ?>
<select name="role" id="role" class="required-entry" tabindex="9" value="">
<option value="" selected="selected">SELECT ROLE</option>
<?php foreach ($roles as $role) : ?>
<option value="<?php echo $role->id; ?>"><?php echo $role->name ?></option>
<?php Endforeach; ?>
</select>
<?php } else { echo "No Roles Found! Add Role"; } ?>
</div>
</div>
<div class="field">
<label for="Status" class="required"><em>*</em>Status</label>
<div class="input-box">
<select name="status" id="status" class="required-entry" tabindex="10" value="">
<option value="1" selected="selected">Active</option>
<option value="0">Inactive</option>
</select>
</div>
</div>
</li>
</ul>
<div class="buttons-set">
<input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
<input type="submit" name="submit" value="SAVE" class="buttons-set" />
</div>
</div>
</form>
Since you tagged jQuery, I'm going to give you a jquery solution:
$("#newform").submit(function() {
return false;
});
Similarly, you can use this variation (actually this is the right way to do it)
$(document).ready(function() {
// I'm not familiar with VarienForm
// but the statement below runs once all DOM elements
// become available.
var newform = new VarienForm('newform', true);
// The block of code below only runs after you click
// the submit button in your form with id="newForm"
$("#newform").submit(function(e) {
// you can put a condition here, for example:
// if your form validation is correct return true;
// otherwise run e.preventDefault()
e.preventDefault();
});
});
You need to return false in your "onSubmit" method.
More details are explained in this similar post: How to prevent buttons from submitting forms
You can give the form an onsubmit="function" and in the function do an return false, before you return the false run another function.
First take a look at code i wrote below :
var x=true;
$('#newform').submit(function(e){
if(x) e.preventDefault();
myfun($(this));
});
function myfun(p) {
//lots of work...(simulating with timeout it could be anything ie. 2*2*2...)
setTimeout(function(){
x=false;
p.submit();
},1000);
}
Link to demo: >>> http://jsfiddle.net/techsin/QwWfb/
Main idea stop execution the time you want it to stop...but when ready to submit after doing whatever, let the stopping function know that it's not needed anymore. So when you call submit it actually goes through.
Control x to control submitting.

Reset button using JavaScript is not working after validating the form using Ajax

I have a "create user"form with reset and create button. This reset button is not working for some drop-downs in the form.
In addition, reset button is not clearing all the values in the form after validation. It only clears the values entered after validation.
Here is my code:
<div class="form-action clearfix">
<button type="button" onClick="clearForm()" > Reset </button>
<button class="button" type="button" id="button" onclick="doAjax('index.php/users/createUser', convertFormJson('#createUserForm'));">Create</button>
and
function clearForm() {
document.getElementById('createUserForm').reset();
}
Form:
<?php echo validation_errors(); ?>
<div class="container_12 clearfix leading" >
<div class="grid_12">
<!--<form class= "form has-validation">-->
<?php
$attributes = array('class' => 'form has-validation', 'id' => 'createUserForm');
echo form_open('/users/createUser', $attributes);
?>
<div class="clearfix">
<label for="form-name" class="form-label">First Name <em>*</em></label>
<div class="form-input">
<input type="text" id="form-name" name="firstname" required="required" placeholder="Enter the first name" value="<?php echo set_value('firstname'); ?>" />
</div>
</div>
<div class="clearfix">
<label for="form-name" class="form-label">Last Name <em>*</em></label>
<div class="form-input">
<input type="text" id="form-name" name="lastname" required="required" placeholder="Enter the last name" value="<?php echo set_value('lastname'); ?>"/>
</div>
</div>
<div class="clearfix">
<label for="form-email" class="form-label">Email <em>*</em></label>
<div class="form-input"><input type="email" id="form-email" name="email" required="required" placeholder="A valid email address" value="<?php echo set_value('email'); ?>"/></div>
</div>
<!--
<div class="clearfix">
<label for="form-birthday" class="form-label">Birthdate</label>
<div class="form-input"><input type="date" id="form-birthday" name="date" placeholder="mm/dd/yyyy" value="<?php //echo set_value('date'); ?>" class="date"/></div>
</div>
-->
<div class="clearfix">
<label for="form-username" class="form-label">Username <em>*</em></label>
<div class="form-input">
<?php echo form_error('username'); ?>
<input type="text" id="form-username" name="username" value="<?php echo set_value('username'); ?>" required="required" maxlength="30" placeholder="Alphanumeric (max 30 char.)" />
</div>
</div>
<div class="clearfix">
<label for="form-password" class="form-label">Password <em>*</em></label>
<div class="form-input">
<?php echo form_error('password'); ?>
<input type="password" id="form-password" name="password" value="<?php echo set_value('password'); ?>" maxlength="30" placeholder="Min 8 char. containing a capital, number and/or symbol" />
</div>
</div>
<div class="clearfix">
<label for="form-password-check" class="form-label">Password check <em>*</em></label>
<div class="form-input">
<?php echo form_error('passconf'); ?>
<input type="password" id="form-password-check" name="passconf" value="<?php echo set_value('passconf'); ?>" data-equals="password" maxlength="30" placeholder="Re-enter your password" />
</div>
</div>
<div class="clearfix">
<label for="form-group" class="form-label">Group <em>*</em></label>
<div class="form-input">
<?php
$groupsData[' '] = "--";
$groupJs = 'id="form-group"';
echo form_dropdown('groupId', $groupsData,' ',$groupJs);
?>
</div>
</div>
<div class="clearfix">
<label for="form-language" class="form-label" >Language <em>*</em></label>
<div class="form-input">
<select id="form-language" name="language">
<option value ="" > -- </option>
<option value ="1">English</option>
<option value ="2">French</option>
</select>
</div>
</div>
<div class="clearfix">
<label for="form-timezone" class="form-label" >Timezone <em>*</em></label>
<div class="form-input">
<?php echo timezone_menu('UM5', 'form-timezone'); ?>
</div>
</div>
Please help me out.

Categories