Reputation: 478
Trying to do this but it giving parse error... is there any way?
<?php
if($profileIdType==1)
{
<li class="col-md-6">
<label>First Name</label>
<input type="text" class="form-control validate[required]"
name="first_name" id="first_name" placeholder="First name" readonly="true"
data-toggle="tooltip" title="First name">
</li>
}
else
{
}
?>
Upvotes: 0
Views: 45
Reputation: 17954
You need to separate scripting from markup.
<?php
if ($profileIdType == 1) {?>
<li class="col-md-6">
<label>First Name</label>
<input type="text" name="first_name">
</li><?php
} else {?>
<li class="col-md-6">
<label>Last Name</label>
<input type="text" name="last_name">
</li><?php
}?>
Upvotes: 1
Reputation: 40909
If you want to output HTML/CSS from your PHP script you need to close/reopen PHP tags:
<?php
if ($profileIdType == 1) {
?>
<li class="col-md-6">
<label>First Name</label>
<input type="text" class="form-control validate[required]"
name="first_name" id="first_name" placeholder="First name" readonly="true"
data-toggle="tooltip" title="First name"
>
</li>
<?php
} else {
}
Upvotes: 2