PDA

View Full Version : PHP URL variables


LauraS
10-01-2007, 02:45 PM
I want to load a 2nd version of one of our pages, and change a bit of text for the 2nd version. The regular version of the page will remain the same, but the 2nd page will load with a URL variable and I'll run if/then code that will change the text if the variable is present. How do I do this in one of the VB templates, for instance FORUMHOME?

Here's the PHP I'd run outside of the template:

<?php
$source = $_GET['source'];
if (isset($source)) {
echo "This source is set so I will print paragraph 2.";
} else {
echo "The source is not set so I will print paragraph 1.";
}
?>

Any help would be greatly appreciated! Thanks.

Dismounted
10-02-2007, 05:04 AM
<if condition="isset($_GET['source'])">
PARAGRAPH 2
<else />
PARAGRAPH 1
</if>
Place that in a template.

LauraS
10-02-2007, 02:55 PM
Thanks a lot, that worked!