Hi people, i really need help with my PHP code. I have no idea how to do validation on my Form… you know, to make sure that user is editing correct information. I really need help with this one please!!!
This is how my Form code
[php]<?php
require ‘Controller/BikeController.php’;
$BikeController = new BikeController();
$title = “Add a new Bike”;
/*******************************************************
Thiese are all the field for Add a new Bike page for editing
*******************************************************/
$content ="
Add a new Bike
Name:
<label for='type'>Type: </label>
<select class='inputField' name='ddlType'>
<option value='%'>All</option>"
.$BikeController->CreateOptionValues($BikeController->GetBikeTypes()).
"</select><br/>
<label for='price'>Price: </label>
<input type='text' class='inputField' name='txtPrice' /><br/>
<label for='roast'>Code: </label>
<input type='text' class='inputField' name='txtCode' /><br/>
<label for='discount'>Discount: </label>
<input type='text' class='inputField' name='txtDiscount' /><br/>
<label for='image'>Image: </label>
<select class='inputField' name='ddlImage'>"
.$BikeController->GetImages().
"</select></br>
</select></br>
<label for='review'>Review: </label>
<textarea cols='70' rows='12' name='txtReview'></textarea></br>
<input type='submit' value='Submit'>
</fieldset>
";
/*******************************************************
Calls function InsertBike()
*******************************************************/
if(isset($_POST[“txtName”]))
{
//$BikeController->InsertBike();
}
include ‘./Templet.php’;
?>
[/php]