If it's on the same page, you can't use PHP since you will not make contact with the webserver. Use Javascript instead.
Like
<input type="radio" name="q3" value="N" onChange="if(this.selected.value=='N'){location.href='#question8';}">
and further in the page:
<a name="question8"></a>
Question 8
this.selected.value is most probably not correct syntax, but you get the idea. Hope this helps anyhow.