i have a code of combo select in php which is working fine on local host but not when i upload on server.i am not getting wats the actual problem is.when i run this code on local host and lets say i have select from combo "almostcompleted" it shows almostcompleted on localhost but on server it shows bydefault juststarted(firstvalue of combo alwaz).pls solve my problem.............
<tr>
<td><b>Task Status :</b></td>
<td>
<select name="status">
<option value="juststarted" <? if(strcmp(trim($status),"juststarted")==0){echo "SELECTED";}else{ echo "fail" ; } ?>>Just Started</option>
<option value="halfcompleted" <? if(strcmp(trim($status),"halfcompleted")==0){echo "SELECTED";} else{ echo "fail" ; }?>>Half Completed</option>
<option value="almostcompleted" <? if(strcmp(trim($status),"almostcompleted")==0){echo "SELECTED";} else{ echo "fail" ; } ?>>Almost Completed</option>
<option value="completed" <? if(strcmp(trim($status),"completed")==0){echo "SELECTED";} else{ echo "fail" ; } ?>>Completed</option>
</select>
</td>
</tr>
working properly on localhost but not on server
Moderator: General Moderators
-
WebbieDave
- Forum Contributor
- Posts: 213
- Joined: Sun Jul 15, 2007 7:07 am
Re: working properly on localhost but not on server
I'm tempted to call this a brazen multi-post but the issue is slightly different (as you're now claiming a local vs remote performance difference) but I'll let the admins make the final call. So, until locked, I shall attempt to help you with the following statements (some of them, interrogative):
I fail to see where the variable $status is being set in your script. Are you using register_globals? Are you aware of the ramifications of this functionality? Why are you echoing "fail"?
I fail to see where the variable $status is being set in your script. Are you using register_globals? Are you aware of the ramifications of this functionality? Why are you echoing "fail"?