+ Post New Thread
Results 1 to 11 of 11
Web Development Thread, Check what websites are available for students. in Coding and Web Development; We get quite a few requests from staff 'can you make sure that ****** website is available for students to ...
  1. #1

    maniac's Avatar
    Join Date
    Feb 2007
    Location
    Kent
    Posts
    3,069
    Thank Post
    210
    Thanked 430 Times in 310 Posts
    Rep Power
    144

    Check what websites are available for students.

    We get quite a few requests from staff 'can you make sure that ****** website is available for students to use' not a major issue, but I'd like to find a way of staff being able to test it for themselves easily. They already have a student login they can use, but few staff can be bothered and would rather ask us.

    What I'd really like is a web based form to put on our intranet which staff can put a website URL into a box, that can then go out to the net through our proxy authenticated as a student and tell the staff member if the website is reachable or not. I've had a go using PHP and cURL but I can't get it to work properly, although I know in theory it's possible.

    Anyone know of a pre-written script which will do this, or point me in the direction of a good understandable guide for using cURL properly.

    Cheers

    Mike.

  2. #2
    p858snake's Avatar
    Join Date
    Dec 2008
    Location
    Queensland
    Posts
    1,490
    Thank Post
    37
    Thanked 175 Times in 151 Posts
    Blog Entries
    2
    Rep Power
    51
    Is your filter inhouse or externally controlled?

  3. #3

    maniac's Avatar
    Join Date
    Feb 2007
    Location
    Kent
    Posts
    3,069
    Thank Post
    210
    Thanked 430 Times in 310 Posts
    Rep Power
    144
    Quote Originally Posted by p858snake View Post
    Is your filter inhouse or externally controlled?
    In house, it's a websense box.

  4. #4
    p858snake's Avatar
    Join Date
    Dec 2008
    Location
    Queensland
    Posts
    1,490
    Thank Post
    37
    Thanked 175 Times in 151 Posts
    Blog Entries
    2
    Rep Power
    51
    If you could access its database, you could probably create a page that feeds the address in and see if its hits anyone in its database and returns a message based on that.

  5. #5

    maniac's Avatar
    Join Date
    Feb 2007
    Location
    Kent
    Posts
    3,069
    Thank Post
    210
    Thanked 430 Times in 310 Posts
    Rep Power
    144
    Quote Originally Posted by p858snake View Post
    If you could access its database, you could probably create a page that feeds the address in and see if its hits anyone in its database and returns a message based on that.
    Unfortunitely not possible to do that, as it's supplied and maintained by the LEA. I have access to the interface and nothing else.

    My idea is to use a simple script to authenticate to the proxy as a student, see if the website is available or not and then report the result. Sounds simple enough but I just can't get it to work properly.

  6. #6
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,527
    Thank Post
    107
    Thanked 89 Times in 75 Posts
    Blog Entries
    46
    Rep Power
    40
    post your code?

  7. #7

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,600
    Thank Post
    109
    Thanked 769 Times in 598 Posts
    Rep Power
    181
    If you can turn on a warning page rather than a block for those pages that students cannot access, staff could view them and know if they were safe to use in class. To spell it out, I would make sure that you mention that the little darlings should not be viewing that page!

  8. #8

    maniac's Avatar
    Join Date
    Feb 2007
    Location
    Kent
    Posts
    3,069
    Thank Post
    210
    Thanked 430 Times in 310 Posts
    Rep Power
    144
    Quote Originally Posted by Ric_ View Post
    If you can turn on a warning page rather than a block for those pages that students cannot access, staff could view them and know if they were safe to use in class. To spell it out, I would make sure that you mention that the little darlings should not be viewing that page!
    Our web filtering has different levels for staff and students and is a bit over the top sometimes, so ends up blocking sites that should really be available. e.g last week we found the marlowe theatre website was blocked for some reason, and other strange occurances like this, sites which you would assume would be available, that are perfectally harmless. Therefore I want an easy way for staff to find out if a particular website is blocked or not before they try and use it with a class, and also a method that avoids them asking us, as it takes up a fair amount of our time - I must get at least 3 or 4 of these type of requests a day, and many more where a member of staff has gone to use a site and suddenly discovered it's blocked then come running to us in a panic, some of this might be avoidable if staff can easily test if a site is blocked for students or not before they use it.

    At the moment the code I've tried is not setup to accept an input from a form, I was just testing this bit of code with a hard programmed in website to see if I could get it to work. I have to admit I don't understand the cURL options witin PHP properly and I ripped this code from somewhere else, except it wasn't setup to use a proxy. As soon as I add the proxy options, it just reports every time as the website being un-reachable.

    This bit of code should test to see if Google is available. If I remove the proxy lines it works, except it doesn't go through our proxy so it's no good. I just cannot get it to authenticate to our proxy whatever combination of different options I try.

    Code:
    <?php
    
    function Visit($url){
           $agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";$ch=curl_init();
           curl_setopt ($ch, CURLOPT_URL,$url );
           curl_setopt($ch, CURLOPT_USERAGENT, $agent);
           curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
           curl_setopt ($ch,CURLOPT_VERBOSE,false);
           curl_setopt($ch, CURLOPT_TIMEOUT, 5);
           curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, FALSE);
           curl_setopt($ch,CURLOPT_SSLVERSION,3);
           curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, FALSE);
    	curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); 
    	curl_setopt($ch, CURLOPT_PROXY, '10.49.60.5:8080'); 
    	curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'spires\student2:password2'); 
    
           $page=curl_exec($ch);
           //echo curl_error($ch);
           $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
           curl_close($ch);
    	echo $httpcode;
           if($httpcode>=200 && $httpcode<300) return true;
           else return false;
    }
    
    if (Visit("http://www.google.co.uk"))
           echo "Website available";
    else
           echo "Website not available";
    ?>
    Anyone see what I've done wrong?

    Mike.

  9. #9

    Sylv3r's Avatar
    Join Date
    Jul 2005
    Location
    Co. Durham
    Posts
    3,213
    Thank Post
    372
    Thanked 379 Times in 337 Posts
    Rep Power
    148
    What sort of differences does your staff have compared to your students? The only differences we set here is staff can access all webmail providers and youtube - everything else is the same. The advantage of this is in theory if it works for a member of staff whilst planning a lesson it will work for the students.

  10. #10

    maniac's Avatar
    Join Date
    Feb 2007
    Location
    Kent
    Posts
    3,069
    Thank Post
    210
    Thanked 430 Times in 310 Posts
    Rep Power
    144
    Quote Originally Posted by Sylv3r View Post
    What sort of differences does your staff have compared to your students? The only differences we set here is staff can access all webmail providers and youtube - everything else is the same. The advantage of this is in theory if it works for a member of staff whilst planning a lesson it will work for the students.
    The main difference is uncategorised sites. They are available to staff, but not to students. This emcompasses quite a few more obscure sites that some staff want to use, things hosted on personal webspace and the like and also anything that's very new. There's other differences, and sometimes the odd site is blocked from students by keyword filtering and have to be added as a specific allow. We've just upgraded websense to the latest version as well which seems to have some sites in different categories to what they were before, so some staff are finding sites they've used before are no longer available and as such some have started running every single site they want to use past us before they use them. Not necessarily a bad thing, but it's starting to take up more of our time than I'd like testing them on behalf of the teacher, so I wanted to create an easy to use interface they could use to test them theirselves.

    As I say they are supplied with a student login they can use on a workstation, but most complain they don't have the time to do this and expect us to do it, so I want to offer an alturnative that they can't complain about! As you can guess it's us that gets it in the neck when students can't get onto a site and the whole lesson is disrupted etc. etc.

  11. #11
    dwhyte85's Avatar
    Join Date
    Mar 2009
    Location
    Berkshire
    Posts
    1,219
    Thank Post
    159
    Thanked 147 Times in 132 Posts
    Rep Power
    103
    PHP: curl_setopt - Manual

    I don't know if this will help but, you haven't said how it'll authenticate and you haven't said the proxy type
    CURLOPT_HTTPAUTH - The HTTP authentication method(s) to use for the proxy connection. Use the same bitmasks as described in CURLOPT_HTTPAUTH. For proxy authentication, only CURLAUTH_BASIC and CURLAUTH_NTLM are currently supported.

    CURLOPT_PROXYTYPE - Either CURLPROXY_HTTP (default) or CURLPROXY_SOCKS5.
    Unless it's a weird timeout issue and the script is taking longer than the timeout is allowing for?

SHARE:
+ Post New Thread

Similar Threads

  1. Voucher Websites
    By FN-GM in forum General Chat
    Replies: 0
    Last Post: 22nd March 2010, 12:47 PM
  2. how do you check through students image files?
    By DAckroyd in forum How do you do....it?
    Replies: 22
    Last Post: 19th June 2009, 04:13 PM
  3. Replies: 32
    Last Post: 25th July 2005, 07:17 AM
  4. Spooky Websites
    By ninjabeaver in forum Jokes/Interweb Things
    Replies: 0
    Last Post: 28th June 2005, 08:52 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •