Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Temas - SharkMigue

Páginas: [1]
1
PHP / [AYUDA] Base de Datos
« en: 19 de Diciembre de 2011, 15:51:44 pm »
Bueno yo estoy haciendo una web fan con surpu y tengo un sistema de alertas que he echo hace tiempo entonces quería saber si alguien me puede ayudar con la base de datos :S aquí el código del panel de alertas.
Código: [Seleccionar]
<?
session_start();
include("conectar.php");
$n=$_SESSION[nick];
$q=mysql_query("SELECT * FROM usuarios WHERE nick='$n'");
$ar=mysql_fetch_array($q);
if($ar[rango] == "Administrador" or $ar[rango] == "Coordinador" or $ar[rango] == "Hobba-Gold" or $ar[rango] == "Hobba-Silver" or $ar[rango] == "Hobba-Bronce" or $ar[rango] == "Moderador") {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<style type="text/css">
<!--
body,td,th {
font-family: Tahoma, Geneva, sans-serif;
font-size: 8pt;
}
-->
</style></head>

<body>
<?
if(isset($_POST['OK'])) {
if($_POST['IP'] == NULL or $_POST['Nombre'] == NULL or $_POST['Razon'] == NULL) {
print('No puedes dejar campos en blanco');
}else{
include("conectar.php");
if(mysql_query("INSERT INTO `alertas` (`nick`,`texto`,`leido`,`autor`,`ip`) VALUES ('$_POST[Nombre]','$_POST[Razon]','No','$_SESSION[nick]','$_POST[IP]')")){
echo "El usuario ha sido alertado.";
} else {
echo mysql_error();
}
}
}
?>
    Mi ip :
<?
if (isset( $_SERVER [ 'HTTP_X_FORWARDED_FOR' ])) {   
$ip = $_SERVER [ 'HTTP_X_FORWARDED_FOR' ];   
   }   
   elseif (isset( $_SERVER [ 'HTTP_VIA' ])) {   
$ip = $_SERVER [ 'HTTP_VIA' ];   
   }   
   elseif (isset( $_SERVER [ 'REMOTE_ADDR' ])) {   
$ip = $_SERVER [ 'REMOTE_ADDR' ];   
   }   
   else {   
$ip = "Anonima" ;   
   }     
print $ip;
?>
<form method="POST" action="<?=$PHP_SELF;?>">
  <p>
<b><font size="1" face="Tahoma">IP a alertar:</font></b><br>
    <input name="IP" type="text" style="font-size: 8pt; font-family: Verdana; font-weight: bold" value="<?=$_GET['ip']?>" size="20">
  </p>
<p>
<b><font size="1" face="Tahoma">Nombre de Usuario:<br></font></b>
<input name="Nombre" type="text" style="font-size: 8pt; font-family: Verdana; font-weight: bold" value="<?=$_GET['nick']?>" size="20"><br><br>
<b><font face="Tahoma" size="1">Alerta:<br>
<label>
      <textarea name="Razon" cols="30" rows="5" id="Razon"></textarea>
    </label>
<br />
    </font></b><br><input type="submit" value="Enviar" name="OK">
  </p>
</form>
<center>
  <strong>Alertas: </strong><br />
  <br />
  <table bgcolor="#E1EDF2" width="440" border="0" cellspacing="" cellpadding="">
    <tr>
      <td width="100"><strong>Nick</strong></td>
      <td width="140"><strong>IP</strong></td>
      <td width="100"><strong>Alerta</strong></td>
      <td width="100"><strong>Alertado por</strong></td>
      <td><strong>Leida</strong></td>
    </tr>
  </table>
  <?
include("conectar.php");
$a = mysql_query("SELECT * FROM alertas ORDER by id DESC LIMIT 0,10");
$rows = mysql_num_rows($a);
if($rows == 0) {
print('No hay alertas');
}else{
print('<table bgcolor="#F7F7F7" cellpadding="2" width="440" border="0" cellspacing="0" cellpadding="0">');
while($datos = mysql_fetch_array($a)) {
print('<tr>
      <td width="100"><strong>'.$datos['nick'].'</strong></td>
      <td width="140"><strong>'.$datos['ip'].'</strong></td>
      <td width="100"><strong>'.$datos['texto'].'</strong></td>
      <td width="100"><strong>'.$datos['autor'].'</strong></td>
      <td><strong>'.$datos['leido'].'</strong></td>
      </tr>');
}
print('</table>');
}
?>
</center>
</body>
</html>
<? }else{ print('No tienes acceso'); } ?>

Ayúdenme :L

2
Aplicaciones Pre-Fabricadas / ¿Me ayudan?
« en: 01 de Diciembre de 2011, 17:17:34 pm »
Bueno soy nuevo en todo esto del PHP y el AJAX haci que queria saber como se hace un panel que solo una persona/ip/ usuario en especifico pueda enviar alertas a una web.. bueno les agradecería mucho si me dijeran uno..

Un Saludo,
SharkMigue

3
PHP / ¡Ayudenme!
« en: 09 de Noviembre de 2011, 21:20:52 pm »
Ayuda PHPeros, necesito un sistema que permita que solo una IP pueda ver algo como Paneles, Alertas o cosas haci :S

4
PHP / [DUDA] Como ago esto..?
« en: 28 de Octubre de 2011, 23:39:41 pm »
Bueno primero que nada hola gente de phperos Quisiera saber como hacer un botón que cuando clikeas se agranda o tiene una efecto extraño que salen mini paginas abajo, Por favor me ayudan..?  :(

5
Minichat o MC / Ayuda!!
« en: 22 de Octubre de 2011, 22:26:23 pm »
Hola Phperos; necesito que me ayuden es que no se como poner el minichat en mi web si hay algún código por favor :$

PD A continuación el minichat http://superpruebasmc.webcindario.com/mc/index.php

6
Aplicaciones Pre-Fabricadas / [AYUDA] Ayudenme en eso [CUTENEWS]
« en: 21 de Octubre de 2011, 23:26:35 pm »
Hola Gente de PHPeros, Quisiera saber cual es el codigo  en donde se puede poner nada mas 2 noticias en tu pagina web y masarla a la pagina 2 de noticias cutenews.

EJEMPLO
http://i56.tinypic.com/2cxgrx0.png

Páginas: [1]