I want to use a variable to indicate a index in an array, but it doesn’t work. Can anybody help me about that? My codes are:
<body onload=”timeout = checkTimeout(currPage,<?php echo $instance ?>)” onUnload=”cancelTimeout(timeout,currPage)”>
<form name=”Service” onsubmit=”javascript:return validate()”
action=”submit.php?state=<?php echo($instance)?>§ion=Outbound <?php echo($tatal_service) ?>” method=”post”>
<table bgbolor=”White” width=”100%” id=”outbound_table”>
<tbody>
<tr>
<td bgcolor=”#0033CC” align=”center” colspan=”6″>
<font face=”Verdana,Arial” size=”2″ color=”#FFFFF”><b>Outbound Services</b></font>
</td>
</tr>
<tr bgcolor=”#FFFFD6″ id=”service_header”>
<th>Name</th>
</tr>
<tr bgcolor=”#CCCCCC” id=”serviceList”>
<td align=”center” id=”service_name”>
<select name=”services”>
<?php $value = $config[‘Outbound $tatal_service’][‘services’]; if ($value == “”) $value = “HTTP” ?>
<option value=”HTTP” <?php if ($value == “HTTP”) { echo “selected”; } ?> >HTTP</option>
<option value=”HTTPS” <?php if ($value == “HTTPS”) { echo “selected”; } ?> >HTTPS</option>
<option value=”pcanywhere” <?php if ($value == “pcanywhere”) { echo “selected”; } ?> >pcAnyWhere</option>
</select>
</td>
</tr>
$tatal_service is a global variable and it is now set as 1.
If I use [I]$config[‘Outbound 1’][‘services’][I]$config[‘Outbound $tatal_service’][‘services’]
Thanks in advance!
Rui