AJAX - No puedo ver mi BD mysql programado con ajax al subir en un servidor linux

 
Vista:
Imágen de perfil de derlis

No puedo ver mi BD mysql programado con ajax al subir en un servidor linux

Publicado por derlis (1 intervención) el 11/03/2015 20:08:50
hola programadores...necesito sus ayudas por favor... hice un sistema de pagina web, tipo motor de Busqueda con ajax+php+html con CSS, use la aplicacion navicat para mi base de datos mysql,
bueno..lo probe con localhost y funciona de maravilla.. al poner lo que busca en mi motorcito de busqueda ya me sale los datos de mysql cargados en navicat,,,pero ahora pase a un servidor linux- centos para que sea publico mi pagina..Y ELPROBLEMA es que solo puedo ver mis paginas CSS y no me sale nada de los datos al poner el la busqueda.....!!!!!
noce donde esta el problema?? sera que linux no reconoce my navicat como BD noce que pasa ??
me podian ayudar GRACIAS
esttos son mis codigo fuente en ajax..nose si hay algo que no le guste al servidor linux..
mi bASE DE DATOS LO HICE EN NAVICAT...como les dije en local host me funciona de maravilla
pero cuando paso a un servidor linux.. no me sale la base de datos hecho en navicat
NO SE MAS QUE HACERRRRRRRR :( :(

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function html(){var xmlhttp=false;try {xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");} catch (E) {xmlhttp = false;}}if (!xmlhttp && typeof XMLHttpRequest!='undefined') {xmlhttp = new XMLHttpRequest();}return xmlhttp;
}
 
function Buscar() {
	q = document.getElementById('valor').value;
	c = document.getElementById('resultados');
	ajax = html();
	ajax.open("GET","procesar.php?q="+q);
	ajax.onreadystatechange=function() {
		if (ajax.readyState == 4) {
			c.innerHTML = ajax.responseText;
		}
	}
	ajax.send(null)
}
function Editar(q) {
	c = document.getElementById('resultados');
	ajax = html();
	ajax.open("GET","editar.php?q="+q);
	ajax.onreadystatechange=function() {
		if (ajax.readyState == 4) {
			c.innerHTML = ajax.responseText;
		}
	}
	ajax.send(null)
}

----------------------codigo de config.php hecho en css---------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
class html {
		var $host='localhost',$user='root',$pass='cisco',$db='derlis',$c_Servidor='Se conecto correctamente a la base de datos',$i_Servidor='No se conecto con el servidor',$c_DB='Usted ha selecciono correctamente la base de datos',$i_DB='No se selecciono correctamente la base de datos';
 
	function Conectar() {
		if (!@mysql_connect($this->host,$this->user,$this->pass)){
			print $this->i_Servidor;
 
		} else {
			if (!@mysql_select_db ($this->db)) {
				print $this->i_DB;
			}
		}
	}
 
	function Buscar($q) {
		$query = mysql_query("SELECT * FROM derlis WHERE Nom_Equipo LIKE '%$q%'");
		if (mysql_num_rows($query)<=0){
			print 'No se encontro ningun resultado en la BD, comprueba la base de datos en el servidor';
 
		} else {
			print '<table width="100%" border="2" cellspacing="3" cellpadding="3">
					  <tr>
						<td><font face="Courier New, Courier, monospace"><strong><p align="center"><font face= color =#ff6600>Nom_Equipo</strong></font></td>
						<td><font face="Courier New, Courier, monospace"><strong>User</strong></font></td>
						<td><font face="Courier New, Courier, monospace"><strong>Direccion</strong></font></td>
						<td>><font face="Courier New, Courier, monospace"><strong>IP</strong></font></td>
						<td><font face="Courier New, Courier, monospace"><strong>MAC</strong></font></td>
						<td><font face="Courier New, Courier, monospace"><strong>P_Panel</strong></font></td>
						<td><font face="Courier New, Courier, monospace"><strong>Equipo</strong></font></td>
						<td><font face="Courier New, Courier, monospace"><strong>Num_toma</strong></font></td>
						<td><fontface="Courier New, Courier, monospace"><strong>Acciones</strong></font></td>
					  </tr>';
			while ($row = mysql_fetch_assoc($query)) {
					print ' <tr>
							<td>'.$row['Nom_Equipo'].'</td>
							<td>'.$row['User'].'</td>
							<td>'.$row['Direccion'].'</td>
							<td>'.$row['IP'].'</td>
							<td>'.$row['MAC'].'</td>
							<td>'.$row['P_Panel'].'</td>
							<td>'.$row['Equipo'].'</td>
							<td>'.$row['Num_toma'].'</td>
							<td><span style="cursor:pointer;" onclick="Editar('.$row['id'].');">Editar</span><br><span style="cursor:pointer;" onclick="Confirmar('.$row['id'].');">Eliminar</span></td>
						  </tr>';
			}
			print '</table>';
		}
 
	}
}
?>


----------------------archivo editar.php------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
include("config.php");
$c = new html;
$c->Conectar();
$q = $_GET['q'];
$c = mysql_fetch_assoc(mysql_query("SELECT * FROM derlis WHERE id='$q'"));
?>
<style type="text/css">
<!--
.caja2 {
	width: 250px;
}
-->
</style>
 
<table width="100%" border="1" cellspacing="3" cellpadding="1">
  <tr>
    <td>Nom_Equipo</td>
  </tr>
  <tr>
    <td><input type="text" class="caja2" value="<? print $c['Nom_Equipo']; ?>" id="Nom_Equipo"></td>
  </tr>
  <tr>
    <td>User</td>
  </tr>
  <tr>
    <td><input type="text" class="caja2" value="<? print $c['User']; ?>" id="User"></td>
  </tr>
  <tr>
    <td>Direccion</td>
  </tr>
  <tr>
    <td><input type="text" class="caja2" value="<? print $c['Direccion']; ?>"  id="Direccion"></td>
  </tr>
  <tr>
    <td>IP</td>
  </tr>
  <tr>
    <td><input type="text" class="caja2" value="<? print $c['IP']; ?>" id="IP"></td>
  </tr>
  <tr>
    <td>MAC</td>
  </tr>
  <tr>
    <td><input type="text" class="caja2" value="<? print $c['MAC']; ?>" id="MAC"></td>
  </tr>
  <tr>
    <td>P_Panel</td>
  </tr>
  <tr>
    <td><input type="text" class="caja2" value="<? print $c['P_Panel']; ?>" id="P_Panel"></td>
  </tr>
  <tr>
    <td>Equipo</td>
  </tr>
  <tr>
    <td><input type="text" class="caja2" value="<? print $c['Equipo']; ?>" id="Equipo"></td>
  </tr>
  <tr>
    <td>Num_toma</td>
  </tr>
  <tr>
    <td><input type="text" class="caja2" value="<? print $c['Num_toma']; ?>" id="Num_toma"></td>
  </tr>
  <tr>
    <td><label>
      <input type="submit" name="Submit" value="Editar">
    </label></td>
  </tr>
</table>

......................Buscar.php--------------------------

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<style type="text/css">
<!--
.input {
	float: left;
	width:500%;
}
.caja {
	width: 1100px;
}
.resultados {
	float: left;
	min-height: 300px;
	min-width: 1100px;
	border: fine dotted #800080;
}
#Layer1 {
	position:absolute;
	width:490px;
	height:115px;
	z-index:1;
	left: 68px;
	top: 79px;
}
#Layer2 {
	position:absolute;
	width:439px;
	height:115px;
	z-index:1;
	left: 160px;
	top: 416px;
}
.Estilo2 {
	color: #99FF00;
	font-size: large;
	font-weight: bold;
}
-->
</style>
<a>Ingrese Aqui el Nombre del Equipo</a>
<script src="ajax.js" language="javascript"></script>
<div class="input"><input type="text" size="30" class="caja" id="valor" onkeyup="Buscar();" /></div>
<div class="resultados" id="resultados"></div>

----------------------procesar.php...........................

1
2
3
4
5
6
7
8
9
10
11
<?php
include("config.php");
$c = new html;
$c->Conectar();
$q = $_GET['q'];
if ($q==null) {
	print 'Ingrese el "Nombre del Equipo" para buscar dentro de la base de datos';
} else {
$c->Buscar($q);
}
?>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder