I manage my schools robotics team website but i cant embed youtube videos onto the website without the school blocking it. they have agreed to not block it if i can specify for the videos to not be shown if the IP if the ip that the school uses for student computers.
Can i make a specific content div within a page display a youtube video if an ip is anything except for the 1 specific ip that all of the school computers have? also how would i have it display something besides the video like an error image instead of the video.
i have fundamental PHP knowledge and i assume this is what is involved.
Alternativly i can have the page redirect to another page on my website like http://www.website.com/content-alt rather than /content. which way would be an easier/better way to do this and could someone help me write the code for this?
@traq, im not sure how to write the code at all, ive done a bit of research and i found this redirect based on ip:
$allowed = array(“18.104.22.168”);
$ip = $_SERVER;
header(“Location: http://www.google.co.uk); /* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
how can i manipulate this to make it apply to a single element (my div with the youtube video) rather than the entire page of the website?
Thanks so much :) i put the code into my website and this is what is looks like http://www.firstteam3600.com/videos i dont have my blocked ip yet so i have both ip events as the same thing. can you tell me why the code is showing up in the website?