选择OnChange更改PHP变量

Hello StackOverflow People.

I need you help. I have this code:

<select name="type" onChange="idk?" class="form-control">
<option value="H">Week 51</option>
<option value="V">Week 52</option>
</select>

And if an user change the week i want to change the file get content :s

$Week = "";
echo file_get_contents('http://rooster.farelcollege.nl/'.$Week.'/c/c00050.htm');

Thanks!

greetings from the Netherlands =)

you can send Ajax request to the "file_get_contents" url. This is what I am using and it works fine :)

<select name="type" class="form-control">
    <option value="H">Week 51</option>
    <option value="V">Week 52</option>
</select>

$(document).ready(function() {
  $( ".form-control" ).change(function() {
    $.ajax({
        data: {
            // You are not sending any post variables right? Then leave this empty :-) otherwise use it as array 'var1': 'value', 'var2': 'value2' ...
        },
        url: 'http://rooster.farelcollege.nl/'+$(this).val()+'/c/c00050.htm',
        method: 'POST',
        success: function(msg) {
            alert(msg); // Optional, show text that was given by URL, can be removed
        }
    });
  });   
}); 

jquery.com/jquery.ajax