Log in

View Full Version : Embedding



Citrusbytes
08-03-2010, 08:39 PM
Hello all,

As a small side project of mine I work on a web based 'game device' that runs locally on files - this is useful for bypassing any filters in schools which prevent the running of games.

Previously the tool has worked by having a home page and then several essentially identical subpages with the only difference being the embed value.

I would like to resolve this problem so that it instead embeds a default value unless one is specified i.e.

file://.../index.html will have the default
and
file://.../index.html?game.swf would have game.swf embedded instead.

Cheers,
Elliot

Beverleyh
08-04-2010, 07:13 AM
The problem with school networks (I work in one) is that the government chosen service provider who rates and categorizes web pages might take a while to index content from various sources, but they do get there eventually. Your tricks may have got around their filters up to now but now they have your pages categorised, there's no way of unblocking them unless you speak to the service provider.
Sorry

djr33
08-05-2010, 04:44 AM
Addressing the technical issues only, this type of "embedding" is simple: using PHP (or another similar serverside language), you will find the value in the URL if it exists:
$myembed = isset($_GET['game'])?$_GET['game']:'default.swf';
Then in the div where you want this content, just use a simple print statement to output it:
<embed src=".....<?php echo $myembed; ?>...">

Some notes:
1. There's no error checking above. I'd advise checking the chosen value against a list (array) if you can. If not, it will just load (probably) a broken page. At worst it might cause a security issue, but in this case probably not...
2. My method uses the URL with a variable and a value, not just a value. So index.php?game=game.swf instead of just ?game.swf. (There are ways to get around this, but it's easiest to do it this way. Alternatively you'll need to parse the URL as a string manually and that might give unexpected results.)
3. You'll probably have a different extension on the pages to allow for PHP (or another serverside language). You can force .html if you want, but it's probably not worth it.
4. As in the post above, there are some general problems with this idea, both technically and that if you're caught it'll probably not be worth the effort. On the other hand, assuming you're learning from this and potentially just trying this out to see what you can do on the web, I suppose it's not that harmful-- but I'd recommend not hiding it too much or you'll look suspicious if caught...
5. Finally, where are these .swf files? Won't they be blocked then the rest is irrelevant? If they're on your server that's a different situation, but your server will be blocked soon enough....

traq
08-05-2010, 06:01 AM
this is useful for bypassing any filters in schools which prevent the running of games...

no offense, and not to sound overly curmudgeony, but you should respect any blocks your school (work, etc., anyone who is providing internet access to you) has in place.

This is not an issue of being denied the right to freely access content or anything like that. It's either free to you -and for a specific purpose, which obviously doesn't include playing games- or you pay for it, but specifically don't pay for access to games (or whatever content is in question).

I don't approve of censorship/ filtering/ etc., but this sort of thing is a completely different issue. I would place it in the same category as trying to hack around an ISP's or Web Host's Terms of Service. Now, as djr said, if this is nothing more than an exercise, then there's no harm to be done. But it doesn't necessarily appear that way to others. And even if you are "following the rules," you should keep in mind that you may not be encouraging others to do the same.

Sorry for the semi-rant. I don't mean this as an attack or accusation; I only hope to provide some food for thought.

-Adrian

djr33
08-05-2010, 06:52 AM
I completely agree, though understand that it can be frustrating to not be allowed to access certain content. The consequence of finding a way around it, however, may not be worth the time to find that way, unless it is just to figure out how (I remember doing this while I was in high school, at least at a very basic level, but it never was very useful, just amusing when I was bored and first learning PHP).

The main point here is that the better and more popular your workaround becomes, the more likely it is to be blocked. In other words, if you succeed, you fail. Keep that in mind, and perhaps put your time into something more useful.


Adrian, by the way, as a tangent, the one situation where this occurs and does violate the idea of "freely accessing content" is in a location where one must be (school) during free time, such as a lunch break. While technically the school may be paying for it, there's no reason for the school to then be deciding what the student should do. And the student can't leave (legally), so it's not like they can just use their own private connection. For example, if the student wants to check email for 3 minutes because there might be something important, then this is a very different situation than students who don't pay attention in class (probably a computer class) and just check their email. Or facebook...
Of course in this case with games it's difficult to say that playing the game is important (and it's probably a better idea to get outside and see the sun), but at the same time if this is done at the right times I don't really see the reason that the school must block content completely. Of course it's much easier (lazier?) for them to just block it entirely rather than somehow monitoring or allowing the students to manage their own time (which likely wouldn't work), but I still find this to be a bit awkward.
One issue with these filters is that they can block useful content (research about games?) while not blocking other content (innocently named "bad" sites).

traq
08-05-2010, 02:48 PM
of course. However, (even being a web guy,) I don't necessarily believe that having access to the internet is in any way a "right." I don't think there's anything wrong with having to wait until you get home to check your email.

about filters, yeah, I know. actually, the best argument against them is that they don't really work.

djr33
08-05-2010, 06:23 PM
Right. But I don't see why the school should make the decision about what times you can or can't check various sites. For example, if an ebay auction is ending during your lunch break, but you can't access the site, you'll probably lose the action (or end up paying significantly more than if you were there to monitor the activity). Or perhaps you're expecting an important email about a family emergency. I'm not claiming that a significant portion of computer usage is "important", but some is, and even if it's not, then why should the school pick what sites are available? It's not like someone wasting time is going to stop wasting time just because one site is blocked... they'll just go to another.

traq
08-06-2010, 12:50 AM
Right. But I don't see why the school should make the decision about what times you can or can't check various sites. ...

simply because they are providing the service. it's theirs. it's not yours. they have every right to say what you can and cannot do with it, regardless of ...regardless. If you're using your own phone or laptop with your own net access (not going through their service), then they have no say-so. Until then, you follow their rules (or politely ask for an exception, if it's important), or you're in the wrong.

djr33
08-06-2010, 03:59 AM
There are two problems with that logic though:
1. You cannot use your own phone or laptop. They will take those away from you. At least if we're referring to a high school. At a university this is an option and your argument is valid, since they will generally allow students to have cell phones then.
2. You can't get an exception because the people responsible for the filter are somewhere else. Even the teachers are limited to this and they can't give an exception for research or "free time", or whatever other reason may be appropriate.

Personally what I prefer is the sort of system where the teacher is monitoring all of the computers from the front desk. This way you must stay on task but can do whatever actually fits the occasion, such as playing games for 5 minutes before class while everyone arrives then doing the assignment for the next 50. This sort of personal and situational monitoring makes a lot more sense than a generic filter. I have no objections to the teacher deciding what students can and cannot do at any given time, but a general filter is usually not sufficient.

traq
08-06-2010, 05:01 AM
Well, I wasn't talking about any specific place, just "somewhere" that provides access but limits/filters it -though I don't object to (the use of) phones, laptops, etc. being restricted at high schools / elementary schools.

I'm not saying I approve of blocks/filters, or that they work well. I'm saying that if someone is providing a service, they have the right to provide it on their own terms, and that should be respected.

In this instance, what it comes down to (and again, I know this will sound odd coming from a web dev guy) is that I view internet access as something that is convenient, fun, and useful, but non-essential. I don't subscribe to the idea that anyone is "entitled" to it in the sense that it's on the same level as basic needs (air, water, food, etc.) or rights (self-determination, free speech, etc.).

But in any case, I didn't mean for my comment to evolve into a debate. I think I kinda hijacked this thread. I hope I didn't scare the OP away :D

djr33
08-06-2010, 05:10 AM
The problem is when that same specific place also only allows that form of communication-- no cell phones, no portable computers or gaming devices, just computers with limited activities. And there's no reason for any block in particular, just up to some unknown deciding entity.

But in general I agree.

The main difference is how we read this, I think:

I'm not saying I approve of blocks/filters, or that they work well. I'm saying that if someone is providing a service, they have the right to provide it on their own terms, and that should be respected. The problem is that the filters aren't equivalent to the "someone". Instead, it's a third party that those immediately responsible (teachers, bosses) do not control. Depending on the teacher, different sites may be allowed, and that's where I think the decision should be.
But having a common system is simpler, if not smarter, so I guess there's at least some logic in that. And it means less work for the teachers...

While, yes, the thread is off topic, I think the original question is answered (more than answered, now).

To Citrusbytes, feel free to reply and make this on topic again if you have any more questions.