Re: simple page not found 404 script - PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Sexta 30 Março 2007 14:35, Dwayne Heronimo escreveu:
> I have included some code but have to do it a little different because if
> the query construct. but this shows only the 404. is this correct?
>
> <?php
> if (!function_exists("GetSQLValueString")) {
> function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
> $theNotDefinedValue = "")
> {
>   $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
>
>   $theValue = function_exists("mysql_real_escape_string") ?
> mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
>
>   switch ($theType) {
>     case "text":
>       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
>       break;
>     case "long":
>     case "int":
>       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
>       break;
>     case "double":
>       $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" :
> "NULL";
>       break;
>     case "date":
>       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
>       break;
>     case "defined":
>       $theValue = ($theValue != "") ? $theDefinedValue :
> $theNotDefinedValue;
>       break;
>   }
>   return $theValue;
> }
> }
>
> $colname_show_cat = "-1";
> if (isset($_GET['catcode'])) {
>   $colname_show_cat = (get_magic_quotes_gpc()) ? $_GET['catcode'] :
> addslashes($_GET['catcode']);
> }
> mysql_select_db($database_arubaguide, $arubaguide);
> $query_show_cat = sprintf("SELECT id, catcode, category_name, name, text,
> slogan, main_img FROM items WHERE catcode = %s ORDER BY name ASC",
> GetSQLValueString($colname_show_cat, "text"));
> $show_cat = mysql_query($query_show_cat, $arubaguide) or
> die(mysql_error()); $row_show_cat = mysql_fetch_assoc($show_cat);
> $totalRows_show_cat = mysql_num_rows($show_cat);
>
> $found_catcode = $show_cat['catcode'];
>
> if(!$found_catcode) {
>     include('404.php');
>     exit;
> }
>
> ?>
>
>

Try
$found_catcode=$row_show_cat['catdode'];

instead

$found_catcode = $show_cat['catcode'];


-- 
Davi Vidal
davividal@xxxxxxxxxxxxxxxx
davividal@xxxxxxxxx
--

Agora com fortune:
"
Marge:	You will not be getting a tattoo for Christmas.

Homer:	Yeah.  If you want one, you'll have to pay for it out of your
	own allowance.

		   Simpsons Roasting on an Open Fire"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux