Variable not showing up.
| From: | Steve Marquez | Date: | Wed, 02 Jul 2008 16:01:36 +0000 |
| Subject: | Variable not showing up. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-276226@lists.php.net to get a copy of this message | ||
Greetings,
The following code works in every way except one. The variable, $linkspage, in the link, will not replace with information from the database for some reason. No matter what else I put in $id_num, $filename or whatever it replaces, but not $linkspage. The variable does work above, in the query.
Does this make sense? I hope so.
Thanks for any help.
<?
include '../cms/cnx.php';
$linkspage = $_GET["linkspage"];
/* Performing SQL query */
$query = "SELECT * FROM cms_pages WHERE linkspage='$linkspage' ORDER BY id_num DESC";
$result = mysql_query($query) or die("Query failed");
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
extract ( $line );
?>
<a class="subnav" href="<?php print "$filename?linkspage=$linkspage"; ?>">
<?
if ($filename = str_replace('.php','',$filename)) {
echo ''.$filename.'';
}
echo ' </a>';
}
?>
--
Steve Marquez
Marquez Design
e-mail: smarquez@marquez-design.com
web: http://www.marquez-design.com