Ver Mensaje Individual
  #12 (permalink)  
Antiguo 25/02/2012, 08:45
Avatar de Raian
Raian
 
Fecha de Ingreso: febrero-2010
Mensajes: 33
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: Acerca de este error

No se si es lo que busco en el codigo prueba esta esto

Cita:
<?php
switch($_GET["Prueba"]) {
case "History":
switch($_GET["id"]) {
case movies:
include("/home/a8236997/public_html/Content/");
break;
default:
include("/home/a8236997/public_html/Content/404.php");
break;
}
break;
case "History":
switch($_GET["id"]) {
case about:
include("/home/a8236997/public_html/Content/");
break;
default:
include("/home/a8236997/public_html/Content/404.php");
break;
}
break;
case "History":
switch($_GET["id"]) {
case historias:
include("/home/a8236997/public_html/Content/");
break;
default:
include("/home/a8236997/public_html/Content/404.php");
break;
}
break;
case "Movies":
switch($_GET["id"]) {
case about:
include("/home/a8236997/public_html/Content/");
break;
default:
include("/home/a8236997/public_html/Content/404.php");
break;
}
break;
case "Text":
switch($_GET["id"]) {
case other_publications:
include("/home/a8236997/public_html/Content/text_content.php?page=6");
break;
default:
include("/home/a8236997/public_html/Content/404.php");
break;
}
break;
case "cuarta":
switch($_GET["id"]) {
case 1:
include("../categorias/004/archivo/index.php");
break;
default:
include("../categorias/index.php");
break;
}
break;
case "quinta":
switch($_GET["id"]) {
case 1:
include("../categorias/005/archivo/index.php");
break;
default:
include("../categorias/index.php");
break;
}
break;
default:
include("/home/a8236997/public_html/Content/home.php");
break;
}
?>
y en el text_content.php

Cita:
<?php
$mysql_server = '***';
$mysql_username = '***';
$mysql_password = '***';
$mysql_database = '***';
$mysql_table = '***';
$cms_no_results = 'No results';
$cms_content = '';
$db = mysql_connect($mysql_server, $mysql_username, $mysql_password);
if (!$db)
{
die('Failed to connect to database server!<br>'.mysql_error());
}
mysql_select_db($mysql_database, $db) or die('Failed to select database<br>'.mysql_error());
$id = isset($_REQUEST['page']) ? mysql_real_escape_string($_REQUEST['page']) : '';
$query = isset($_REQUEST['query']) ? $_REQUEST['query'] : '';
if (!empty($query))
{
if (!get_magic_quotes_gpc())
{
$query = addslashes($query);
}
$words = preg_split('/\s+/', $query);
foreach ($words as $word)
{
$word = preg_replace('/\W/', '', $word);
if (strlen($word) > 1)
{
$terms[] = $word;
}
}
if ($terms)
{
if (count($terms) > 4)
{
array_splice($terms, 4);
}
$sql = "SELECT p.id, p.name, p.content FROM " . $mysql_table . "PAGES p, " . $mysql_table . "SEARCH_WORDS w, " . $mysql_table . "SEARCH_WORDMATCH m WHERE(";
$where = "w.word LIKE '%" . array_shift($terms) . "%'";
while ($term = array_shift($terms))
{
$where .= " OR w.word LIKE '%" . $term . "%'";
}
$sql .= $where . ") AND m.word_id = w.id AND m.page_id = p.id GROUP BY p.id ORDER BY p.last_update_date DESC";
$result = mysql_query($sql) or die(mysql_error());
if ($aantal = mysql_num_rows($result))
{
$cms_content .= " <ol class=\"searchresults\">\n";
while ($data = mysql_fetch_array($result))
{
$cms_content .= " <li><a href=\"" . basename(__FILE__) . "?page=" . $data['id'] . "\">" . $data['name'] . "</a><br>";
$contents = substr(strip_tags($data['content']), 0, 200);
if (strlen($contents) > 199)
{
$contents .= "...";
}
$cms_content .= $contents;
$cms_content .= "</li>\n";
}
$cms_content .= " </ol>\n";
}
else
{
$cms_content = $cms_no_results;
}
}
else
{
$cms_content = $cms_no_results;
}
}
else
{
if (!empty($id))
{
$sql = "SELECT * FROM " . $mysql_table . "PAGES WHERE id = '$id'";
}
else
{
$sql = "SELECT * FROM " . $mysql_table . "PAGES WHERE home = 1";
}
$result = mysql_query($sql, $db);
if ($result)
{
if ($data = mysql_fetch_array($result))
{
if (!empty($data['url']))
{
$cms_content = "<iframe name=\"cmscontent\" style=\"position:absolute;border-width:0;width:100%;height:100%;\" src=\"" . $data['url'] . "\"></iframe>\n";
}
else
{
$cms_content = $data['content'];
}
}
if (empty($label))
{
if (!empty($id))
{
$sql = "UPDATE " . $mysql_table . "PAGES SET views=views+1 WHERE id = '$id'";
}
else
{
$sql = "UPDATE " . $mysql_table . "PAGES SET views=views+1 WHERE home = 1";
}
mysql_query($sql, $db);
}
}
}
mysql_close($db);
?>
<style type="text/css">
.boxweb_medio {
height: auto;
width: 881px;
text-align: right;
background-image: url(Content/img/web_medio.PNG);
display: table-header-group;
}
.box_largo_abajo {
background-image: url(Content/img/box_largo_abajo.PNG);
background-repeat: no-repeat;
height: 15px;
width: 544px;
}
.box_largo_arriba {
background-image: url(Content/img/box_largo_arriba2.PNG);
background-repeat: no-repeat;
height: 15px;
width: 544px;
text-align: center;
}
.box_largo_medio {
background-image: url(Content/img/box_largo_medio.PNG);
height: auto;
width: 544px;
text-align: center;
font-weight: normal;
}
.boxweb_abajo {
background-image: url(Content/img/web_abajo.png);
height: 38px;
width: 881px;
background-repeat: repeat-x;
}
</style>
</head>

<body>
<div class="boxweb_medio">
<table width="881" border="0">
<tr>
<th width="315" height="1096" scope="col">&nbsp;</th>
<th width="556" align="left" valign="top" scope="col"><div class="box_largo_arriba"></div>
<div class="box_largo_medio"><?php echo $cms_content;?></div>
<div class="box_largo_abajo"></div></th>
</tr>
</table>
</div>
<div class="boxweb_abajo"></div>
</body>
</html>

Última edición por Raian; 25/02/2012 a las 11:28