![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
So Fucking Banned
Join Date: Sep 2003
Posts: 1,360
|
![]() Lets say i have an index.php file and 2 lists of words for example;
List One: Red Blue Green Yellow List Two: Cats Dogs Birds Fish How would i go about dynamically changing the content to automagically insert combinations of both lists in specific areas of the index.php page so it changes like below: This page is about selling Red Fish This page is about selling Blue Fish This page is about selling Green Fish This page is about selling Yellow Fish Or; This page is about selling Red Dogs This page is about selling Blue Dogs This page is about selling Green Dogs This page is about selling Yellow Dogs Using all combinations of words in list 1 as the primary word and list 2 as the secondary word? Would it be something like this... Code:
<?php if ($_GET['list1']) if ($_GET['list2']) {echo htmlentities($_GET['list1']);} {echo htmlentities($_GET['list2']);} else {echo ucwords("Colored Animals");} ?> domain.com/?list1&list2 Does that make sense to any of you who are technically inclined? Basically, i want to generate a list of URL to throw in a site map and have the page dynamically show whatever 'phrase' based on list1 and list2 the url contains. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 | |
So Fucking Banned
Industry Role:
Join Date: Sep 2010
Posts: 3,405
|
Quote:
Code:
<?php $color = $_GET['color']; $animal = $_GET['animal']; echo 'This page is about '.$color.' '.$animal; ?> This page is about Red Dogs When you visited: yoursite.com/?color=Red&animal=Dogs Edit: Obviously you'd need to perform sanitization to protect against malicious requests. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
So Fucking Banned
Industry Role:
Join Date: Sep 2010
Posts: 3,405
|
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: May 2008
Posts: 3,406
|
I normally do it as
$colors = array("Red","Blue","Green","Yellow"); $pets = array("Cat","Dog","Bird","Fish"); $color = $colors[array_rand($colors)]; $pet = $pets[array_rand($pets)]; print "The Color of the " . $pet . " is " . $color . "!"; |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Apr 2009
Posts: 1,319
|
I think you guys missed the "Using all combinations" part
Code:
// URL http://www.domain.com/?colors[]=Red&colors[]=Blue&colors[]=Green&colors[]=Yellow&animals[]=Fish&animals[]=Dogs parse_str($_SERVER['QUERY_STRING'], $values); foreach($values['animals'] as $animal) { foreach($values['colors'] as $color) { echo "This page is about selling " . $color . " " . $animal . PHP_EOL; } }
__________________
History will be kind to me for I intend to write it. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
So Fucking Banned
Industry Role:
Join Date: Sep 2010
Posts: 3,405
|
Okay, LIMIT 1. But something's still not quite right...
![]() (I hope the OP appreciates the effort being put in here.) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
So Fucking Banned
Join Date: Sep 2003
Posts: 1,360
|
Quote:
Id still need a list of combinations ?color=Red&Animal=Dogs though to include in the sitemap.xml file though. As far as the sanitization goes, do you know if its possible to have 'exclusion words' in the code you posted above or would that be something different? Thanks everyone for their assistance (and the funny pics ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
So Fucking Banned
Join Date: Sep 2003
Posts: 1,360
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,073
|
Quote:
$gremlin_parts=explode(" ",$gremlin);
__________________
All cookies cleared! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
So Fucking Banned
Industry Role:
Join Date: Sep 2010
Posts: 3,405
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Industry Role:
Join Date: Jul 2001
Posts: 3,766
|
<? echo "hello world"; ?>
__________________
![]() be our partner - join nichepartners today will.assum.producer @ AmateurCanada.com / icq: 30146166 / facebook.com/will.assum / #amateurcanada |
![]() |
![]() ![]() ![]() ![]() ![]() |