select

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
prasadharischandra
Forum Commoner
Posts: 57
Joined: Thu May 09, 2002 2:19 am
Location: sri lanka
Contact:

select

Post by prasadharischandra »

what's wrong my coding
<?
$max=25;
$selected="";
for($second=1;$second<$max;$second++)
{
for($j=0;$j<6;$j++){
$mil=$j*10;

$time=$second.":".$mil;

if( ($time=='1:0')||($time=='2:0')||($time=="3:0")||($time=="4:0")||($time=="5:0")||($time=="6:0")||($time=="7:0")||($time=="8:0")||($time=="9:0")||($time=="10:0")||($time=="11:0")||($time=="12:0")||($time=="13:0")||
($time=="14:0")||($time=="15:0")||($time=="16:0")||($time=="17:0")||($time=="18:0")||($time=="19:0")||($time=="20:0")||($time=="21:0")||($time=="22:0")||($time=="23:0")||($time=="24:0")){

$find_real_value=$time.'0';


?>
<option value="<?echo $find_real_value; if($find_real_value==$real_time) echo "selected"?>"><?echo $find_real_value;?></option>


<?}else{
?>
<option value="<?echo $time; if($time==$real_time) echo "selected";?>" ><?echo $time;?></option>
<? }
}

}

?> :(
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Need more than that. What are you trying to do? What isn't working? Do you get any error messages? etc. etc. You should know by now that we need more information than just 'this doesn't work fix it'.

Mac
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

dispite I turned short tags off and $real_time is undefined it works :D

at least it produces output and no more errors or warnings
prasadharischandra
Forum Commoner
Posts: 57
Joined: Thu May 09, 2002 2:19 am
Location: sri lanka
Contact:

Post by prasadharischandra »

if i add 2:00 i want to come with selected
2:00 because i want to edit
in my coding it's not happening where is the wrong and give me
right way
prasadharischandra
Forum Commoner
Posts: 57
Joined: Thu May 09, 2002 2:19 am
Location: sri lanka
Contact:

Post by prasadharischandra »

my coding working okkkkk i found it
Post Reply