It’s show following error:
Notice: Undefined offset: 1 in C:\xampp\htdocs\evantechbd\secure\content\feature_link_process.php on line 28.
Why it’s show the error…? Can anyone tell me… Here is the code:
$row = explode("|", $_POST['coun_name']);
$coun_id = $row[1]; // cat_id
$coun_name = $row[0];
if(isset($coun)){
$errors = array();
if(empty($coun))
$errors[] = 'Country Name require<br>';
}
You will probably want to do something like this, instead:
The first condition checks to make sure the user submitted a value for
$_POST['coun_name']. The second condition checks to make sure that the value contains a ‘|’ character.If both conditions are met,
$coun_nameand$coun_idare populated byexplode()‘ing$_POST['coun_name']as normal (I dropped in a call tolist()for brevity).