Re: [PHP] simple page not found 404 script - PHP
- From: davividal@xxxxxxxxxxxxxxxx (Davi)
- Date: Fri, 30 Mar 2007 15:55:43 -0300
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"
.
- Follow-Ups:
- References:
- simple page not found 404 script - PHP
- From: "Dwayne Heronimo"
- Re: [PHP] simple page not found 404 script - PHP
- From: Davi
- Re: [PHP] simple page not found 404 script - PHP
- From: "Dwayne Heronimo"
- simple page not found 404 script - PHP
- Prev by Date: Re: [PHP] Gnome and MIME types
- Next by Date: Re: [PHP] simple page not found 404 script - PHP
- Previous by thread: Re: [PHP] simple page not found 404 script - PHP
- Next by thread: Re: [PHP] simple page not found 404 script - PHP
- Index(es):
Relevant Pages
|