Page 1 of 1

php url get

Posted: Thu Dec 24, 2015 3:50 pm
by Vegan
rather than something like:

http://www.mydomain.me/index.php?state= ... p#Berkeley

You can treat the named anchor as a query string like this:

http://www.mydomain.me/index.php?state= ... y=Berkeley

Then, access it like this:

Code: Select all

$Url = $_GET['state']."#".$_GET['city'];
so given those two containers are known, this probably the best wey to leverage PHP URLs

so that content can be assembled before its returned via ECHO

Code: Select all

<?php
if (isset($_GET['link'])) {
    echo $_GET['link'];
}else{
    // Fallback behaviour goes here
}
but i think some parser should be used to make sure city and state are valid etc

Re: php url get

Posted: Thu Dec 24, 2015 4:50 pm
by requinix
Okay?

Re: php url get

Posted: Thu Dec 24, 2015 5:49 pm
by Vegan
I was thinking of using this kind of strategy to grab ads from an ad manager

consider i may know the country so GET the suitable ad for the user

I can often locate even better so may down the road more detailed resolution ads

Re: php url get

Posted: Thu Dec 24, 2015 9:26 pm
by requinix
Okay... All that's happened so far is you've described how query strings work.

Re: php url get

Posted: Fri Dec 25, 2015 11:50 am
by Vegan
given a query string, i was thinking, i can use SWITCH state or SWITCH city, right now I am more focused on the sovereign for ecommerce

at the most basic, i could a crude index for SWITCH choice and then for the cases pic the ad i want to use

given a query based url, makes it slightly easier to use localized ads etc

but i can also sniff out location without get

but the idea of an ad server seems like it has some potential