PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Vegan
Forum Regular
Posts: 574 Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:
Post
by Vegan » Thu Dec 24, 2015 3:50 pm
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
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
requinix
Spammer :|
Posts: 6617 Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA
Post
by requinix » Thu Dec 24, 2015 4:50 pm
Okay?
Vegan
Forum Regular
Posts: 574 Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:
Post
by Vegan » Thu Dec 24, 2015 5:49 pm
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
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
requinix
Spammer :|
Posts: 6617 Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA
Post
by requinix » Thu Dec 24, 2015 9:26 pm
Okay... All that's happened so far is you've described how query strings work.
Vegan
Forum Regular
Posts: 574 Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:
Post
by Vegan » Fri Dec 25, 2015 11:50 am
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
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP