^ oops yh sorry It was pretty late at night when I read your post
One last thing now I've got more $country variable working I want to insert it into a custom URL I'm generating but everytime I put it in it says 'Undefined Variable' again.
I want to place the country that is selected after the 'country=' part of the URL
HTML Code:
<?php
table_add('Fall Into Place','Apartment');
table_add('Kids','MGMT');
table_add('Closer','Travis');
function table_add($title,$artist) {
$term = str_replace(' ','+',$title.' '.$artist);
$link = '<a href="http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/wsSearch?term='.$term.'&limit=1&entity=musicTrack&country='.$country.'">Download</a>';
echo '<tr><td>'.$title.'</td><td>'.$artist.'</td><td>'.$link.'</td></tr>';};
?>
</tbody>
</table>
</th>
</tr>
<form id="countries_select" name="countries_select" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
<form id="countries_select" name="countries_select" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
<script type="text/javascript">
function submitForm()
{
document.countries_select.submit();
}
</script>
<select name="countries" id="countries" onchange="submitForm();">
<option value="US" selected="selected">Select Country</option>
<option onchange="submitForm();" value="US" input type="submit">United States</option>
<option onchange="submitForm();" value="GB">United Kingdom</option>
<option onchange="submitForm();" value="ES">Spain</option>
<option onchange="submitForm();" value="DE">Germany</option>
<option onchange="submitForm();" value="NL">Netherlands</option>
<option onchange="submitForm();" value="FR">France</option>
<option onchange="submitForm();" value="IT">Italy</option>
<option onchange="submitForm();" value="PL">Poland</option>
<option onchange="submitForm();" value="MX">Mexico</option>
<option onchange="submitForm();" value="PT">Portugal</option>
<option onchange="submitForm();" value="BR">Brazil</option>
</select>
<label>
<?php
$country = false;
if (isset($_POST['countries'])){
$country = $_POST['countries'];
echo 'Country Selected: '.$country. '<br />';
}?>
Thanks you've all been really helpful 
|