Search found 4 matches
- Sun Nov 22, 2009 12:18 am
- Forum: PHP - Code
- Topic: Extracting String from URL, Including File on Page
- Replies: 5
- Views: 90
Re: Extracting String from URL, Including File on Page
This would work though: domain.com/Santa-Cruz,-California/aardvarks-make-especially-good-tacos.php that is: domain.com/first-string/second-string.php. First step: Let's say domain.com/first-string/second-string.php points to the page that is build-on-the fly. And that some code exists on that page t...
- Fri Nov 20, 2009 5:43 pm
- Forum: PHP - Code
- Topic: Extracting String from URL, Including File on Page
- Replies: 5
- Views: 90
Re: Extracting String from URL, Including File on Page
I don't think I can change the structure of the URL because it must make sense in an English sentence once it's parsed out (unless there's a way to rearrange the terms). "Santa Cruz, California aardvarks make especially good tacos" makes sense. But the alternative does not: California Sant...
- Fri Nov 20, 2009 3:57 pm
- Forum: PHP - Code
- Topic: Extracting String from URL, Including File on Page
- Replies: 5
- Views: 90
Re: Extracting String from URL, Including File on Page
How do you know what "the first part" is? Three words? Everything up to and including the first word after the first comma? What about places like New Hampshire? That would have to be specified in the code I assume. In this case, the "first part" is everything after domain.com/ ...
- Fri Nov 20, 2009 2:57 pm
- Forum: PHP - Code
- Topic: Extracting String from URL, Including File on Page
- Replies: 5
- Views: 90
Extracting String from URL, Including File on Page
I'm new to PHP, bear with me. This is a two-part question. I have a bit of code that extracts a string (I'm calling it a keyword) from a URL; it works fine: <?php $keyword = "Aardvarks and Other Curious Animals"; //This term is assigned as the keyword if no keyword is provided if ($_GET['q...