Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

PHP GET variables

Name: Anonymous 2008-10-14 19:54

My URLs are currently way too long, so I'm thinking of using index.php as a redirect to other parts of my site. What I had in mind is www.example.com/?nigger. The thing is that I'm using free hosting (inb4 shitstorm), and I have to change hosts once in a while. Are there any server configurations (which support PHP at all) that wouldn't work with this?

Name: Anonymous 2008-10-14 20:16

you could try www.example.com/niggers-rape-white-women/
and hind any niggers inside the folder.

Name: Anonymous 2008-10-14 20:29

>>2
That would result in way too many niggers inside one folder. I like to have them separated, but that results in long URLs.
Thus I'd like to go for a redirect approach, but I dunno if it's supported "everywhere".

Name: Anonymous 2008-10-14 23:03

Given that you're using index.php:
www.example.com?stuff
www.example.com/?stuff

...or a.php:
www.example.com/a?stuff
www.example.com/a/stuff
www.example.com/a.php?stuff
www.example.com/a.php/stuff

As far as I know, all six methods should work. Would any of these fail with certain servers?

Name: Anonymous 2008-10-15 13:42

<?php
$map = array('penis' => '/me/nude.php');
foreach ($map as $p) isset($_GET[$p]) && die(file_get_contents('http://'.$_SERVER['HTTP_HOST'].$p));
?>

Name: Anonymous 2008-10-15 13:50

>>1-3
nigger

>>5
penis

Back to /b/, please.

Name: Anonymous 2008-10-15 17:08

>>5
How to do it isn't what's the problem. I just want to know whether this works on all servers with php, or if some configurations might show 404s etc. when using links in the format of >>4. But thanks for pitching in.

Name: Anonymous 2008-10-15 18:48

>>7
Read the goddamn documentation.

Name: Anonymous 2008-10-15 20:10

>>8
Read the Sussman-blessed SICP
Fix'd.

Name: Anonymous 2008-10-15 21:25

>>8
What documentation? The one for PHP? Or for every server I might happen to end up using in the future?

>>9
I really don't see how SICP could help me here, but then again, I guess SICP is always related.

Name: Anonymous 2008-10-15 22:16

No, >>4 will always work. ALWAYS.

Name: Anonymous 2008-10-16 5:31

>>10
The PHP documentation for the functions you are unsure about working in all situations.

Protip: array(), foreach(), work die() work in all but exotic configurations.

Name: Anonymous 2008-10-16 21:12

>>12
He's not even talking about that.
Are there any server configurations that wouldn't work with this?

Name: Anonymous 2008-10-17 17:40

>>13
as in not assuming that it's supposed to read index.php, just given the domain and arguments like in >>4

Name: Anonymous 2008-10-17 18:12

elseif(isset($_GET['id'])) {
    if(isset($_GET['admin']) || isset($_GET['mod'])){
        require('content/404.php');
    }
    $main_id=$_GET['id'];
    $id = "content/" . $main_id .".php";
    if (preg_match("/\.\./i", $main_id) ){
        require('content/404.php');
    }
    elseif ($main_id == "index"){
        // include() index here or whatever
    }
    elseif(file_exists($id)){
        require($id);
    }
    else{
        require('content/404.php');
    }
}

Name: Anonymous 2008-10-17 18:18

>as in not assuming that it's supposed to read index.php, just given the domain and arguments like in >>4
eg. you navigate to http://www.example.com/ and the server automatically returns index.php
If you navigate to http://www.example.com/?what... Are there some servers that don't return index.php with "what" as a parameter?
Also, given http://www.example.com/a/what. Would all servers load a.php with /what as parameter, and not do something silly like looking for the directory a?
This was harder to explain than I thought. I fail.

Name: Anonymous 2008-10-17 21:04

>>16
My server's definately the most weirdly setup (/a doesn't even redirect to /a/) - And example.org/?nigger won't work (I believe it trys to read a file called .php) - But in most cases it will.

example.org/phpfile/pathinfo will work on most servers which have something like multiviews (or just a rewrite) to change phpfile to phpfile.php (wouldn't work on a default Apache install)
Exception is if there's also a directory called phpfile Apache will probably use that first.

example.org/phpfile.php/pathinfo is uglier but safer than the above.

Name: Anonymous 2008-10-17 21:08

Learn to mod_rewrite and then go away.

Name: Anonymous 2008-10-17 23:53

Learn that mod_rewrite isn't available on shitty hosts and then go away.

Name: Anonymous 2008-10-18 0:43

>>17
Best answer until now, thanks a lot!
So example.org/phpfile.php/whatever will work in "all" cases?

Name: Anonymous 2008-10-18 4:52

>>19
Learn not to use shitty hosts, write in Django, host on Google App Engine, and then go away. Or, you know, stay, or whatever, really. You go do that, and then you're okay by me.

Name: Anonymous 2008-10-23 12:23

>>21
What if shitty hosts are the only ones you can afford?

Name: Anonymous 2008-10-23 12:35

>>22
Suck more cocks, get more monies.

Name: Anonymous 2009-03-06 8:56


won't check further cases.

Name: Anonymous 2009-08-16 17:20

urls WWW text readword text http print see been proven I and BANNED been best the to PROGRAMMER prog with Richard the a Aero that a covers pretty may NOT them re S t awful including trivial variable variable already output home

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List