Código PHP:
Ver original
<?php require_once('Connections/iktools.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { } $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": break; case "double": break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { } $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": break; case "double": break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $query_usuaris = "SELECT * FROM usuaris"; $maxRows_noticies = 10; $pageNum_noticies = 0; $pageNum_noticies = $_GET['pageNum_noticies']; } $startRow_noticies = $pageNum_noticies * $maxRows_noticies; $query_noticies = "SELECT * FROM noticies ORDER BY `data` DESC"; $query_limit_noticies = sprintf("%s LIMIT %d, %d", $query_noticies, $startRow_noticies, $maxRows_noticies); $totalRows_noticies = $_GET['totalRows_noticies']; } else { } ?> <?php // *** Validate request to login to this site. } $loginFormAction = $_SERVER['PHP_SELF']; $_SESSION['PrevUrl'] = $_GET['accesscheck']; } $loginUsername=$_POST['usuari']; $password=$_POST['Contraseña']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "panel.php"; $MM_redirectLoginFailed = "error.php"; $MM_redirecttoReferrer = false; $LoginRS__query=sprintf("SELECT usuari, contrasenya FROM usuaris WHERE usuari=%s AND contrasenya=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } } else { } } ?> <!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"><!-- InstanceBegin template="/Templates/general.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="vcll, militar, tools, ikariam, ikmilitar, board, ikariam.es, ikariam.com, español, castellano, VCLL" /> <link rel="shortcut icon" href="img/favicon.ico"> <!-- InstanceBeginEditable name="doctitle" --> <title>IK militar tools v. 2.0</title> <!-- InstanceEndEditable --> <!-- InstanceBeginEditable name="head" --> <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <!-- InstanceEndEditable --> <link href="estil.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> <!-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } //--> </script> <script language='JAVASCRIPT' type='TEXT/JAVASCRIPT'> <!-- /************************************************************* AUTHOR: WWW.MUCHOGRAFICO.COM URL: http://www.muchografico.com Usa el codigo libremente pero salva este mensaje intacto. **************************************************************/ var win=null; function NewWindow(mypage,myname,w,h,pos,infocus){ if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;} if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;} else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20} settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings); win.focus();} // --> </script> <script type="text/javascript"> foto=document.getElementById("acede") </script> <script type="text/javascript"> function submitForm(formID) { document.getElementById(formID).submit(); } </script> </head> <body onload="MM_preloadImages('img/terrestreP.jpg')"> <?php include("includes/header.php"); ?> <!-- InstanceBeginEditable name="Text" --> Bienvenido a IK militar tools. Esta web fue creada por VCLL y la primera versión fue publicada el 29 de mayo del 2010. Es una web gratuita que permite compactar barallas del ikariam y calcular los costes de un ejército. A demás, con el nuevo sistema de usuarios permite guardar las batallas compactadas y ver las batallas guardadas de otros miembros de tu alianza. Si no estás aún registrado lo puedes hacer <a href="registrar.php">aquí</a>. <br /><br /><br /> <table width="100%" border="0" cellspacing="15"> <tr> <td><a href="compactador_t.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Imagen2','','img/terrestreP.jpg',1)"><img src="img/terrestre.jpg" name="Imagen2" width="250" height="60" border="0" id="Imagen2" /></a></td> <td> </td> <td> </td> </tr> <tr> <td colspan="3"><h1>Noticias de la web</h1></td> </tr> <tr> <td height="108" colspan="3"><center><table width="70%" border="0" cellspacing="15"> <?php do { ?> <tr> <td><p><?php echo $row_noticies['titol']; ?><?php echo $row_noticies['data']; ?></p> <p><?php echo $row_noticies['contingut']; ?></p> <hr /></td> </tr> </table></center></td> </tr> </table> <!-- InstanceEndEditable --><br /></div></div> <?php include("includes/footer.php"); ?> </body> <!-- InstanceEnd --></html> <?php ?>