Log in

View Full Version : help on action via url variable


Reeve of shinra
11-07-2004, 06:50 PM
I am trying to create a cmps module but I am looking for the module to display the information associated with a specific ID # that I want to encode in the url.

So if a user clicked on /blah.php?page=botw&babe=10 the module would do a search for ID 10 and pull up that information.

I figure I could use this but how do I define x as the # in the url?


if($_REQUEST['babe'] == 'x')




this is actually what I have so far.



if (empty($_REQUEST['babe']))
{
$_REQUEST['babe'] == '1';
}

else
{
$babe = $_REQUEST;
}


$babeqry = $DB_site->query("SELECT id, name, bio, month, links FROM " . TABLE_PREFIX . "botw WHERE id IS $babe");

$botwid = $babeqry["id"];
$botwname = $babeqry["name"];
$botwbio = $babeqry["bio"];
$botwmonth = $babeqry["month"];
$botwlinks = $babeqry["links"];


eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('botw_featured') . '";');

Fargo
11-11-2004, 02:12 AM
perhaps this way?


if (empty($_REQUEST['babe']))
{
$_REQUEST['babe'] = '1';
}


$babeqry = $DB_site->query("SELECT id, name, bio, month, links FROM " . TABLE_PREFIX . "botw WHERE id = $_REQUEST[babe]");

$botwid = $babeqry["id"];
$botwname = $babeqry["name"];
$botwbio = $babeqry["bio"];
$botwmonth = $babeqry["month"];
$botwlinks = $babeqry["links"];


eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('botw_featured') . '";');


thats just a guess...im far from being much of a php coder