![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
| |||
dw+php+mysql hola queria saber si me puede ayudar con un sistema q estoy haciendo weno mi problema es el siquiente como puedo hacer caducar una cuenta de usuario despues de aver ingresado n veces a una pagina de busqueda, espero q me ayuden de antemano grax ![]() |
| |||
Re: dw+php+mysql grax juaniquillo pero la verdad recien toy empezando y se me hizo mas facil grax al dreamweaver ya q este me genera el codigo pero cuando cambio algo una parte deja de funcionar o todo nose si podrias ayudarme un poco mas explicadito jejejeje ![]() |
| ||||
Re: dw+php+mysql Pues DW te puede ayudar con el código, pero no te ayudará conproblemas tan específicos como ese. Puedes crear una variable de sesión en DW usando el panel de Applications, en la pestaña de Binding. ![]() Después, en la otra ventana, pones el nombre que quieras ponerle a tu sesión. ![]() Lo otro hay que ir a vista de código para hacerlo. |
| |||
Re: dw+php+mysql este es el script de busqueda...... <?php function buildNavigation($pageNum_Recordset1,$totalPages_Re cordset1,$prev_Recordset1,$next_Recordset1,$separa tor=" | ",$max_links=10, $show_page=true) { GLOBAL $maxRows_rssearch,$totalRows_rssearch; $pagesArray = ""; $firstArray = ""; $lastArray = ""; if($max_links<2)$max_links=2; if($pageNum_Recordset1<=$totalPages_Recordset1 && $pageNum_Recordset1>=0) { if ($pageNum_Recordset1 > ceil($max_links/2)) { $fgp = $pageNum_Recordset1 - ceil($max_links/2) > 0 ? $pageNum_Recordset1 - ceil($max_links/2) : 1; $egp = $pageNum_Recordset1 + ceil($max_links/2); if ($egp >= $totalPages_Recordset1) { $egp = $totalPages_Recordset1+1; $fgp = $totalPages_Recordset1 - ($max_links-1) > 0 ? $totalPages_Recordset1 - ($max_links-1) : 1; } } else { $fgp = 0; $egp = $totalPages_Recordset1 >= $max_links ? $max_links : $totalPages_Recordset1+1; } if($totalPages_Recordset1 >= 1) { $_get_vars = ''; if(!empty($_GET) || !empty($HTTP_GET_VARS)){ $_GET = empty($_GET) ? $HTTP_GET_VARS : $_GET; foreach ($_GET as $_get_name => $_get_value) { if ($_get_name != "pageNum_rssearch") { $_get_vars .= "&$_get_name=$_get_value"; } } } $successivo = $pageNum_Recordset1+1; $precedente = $pageNum_Recordset1-1; $firstArray = ($pageNum_Recordset1 > 0) ? "<a href=\"$_SERVER[PHP_SELF]?pageNum_rssearch=$precedente$_get_vars\">$prev_Re cordset1</a>" : "$prev_Recordset1"; # ---------------------- # page numbers # ---------------------- for($a = $fgp+1; $a <= $egp; $a++){ $theNext = $a-1; if($show_page) { $textLink = $a; } else { $min_l = (($a-1)*$maxRows_rssearch) + 1; $max_l = ($a*$maxRows_rssearch >= $totalRows_rssearch) ? $totalRows_rssearch : ($a*$maxRows_rssearch); $textLink = "$min_l - $max_l"; } $_ss_k = floor($theNext/26); if ($theNext != $pageNum_Recordset1) { $pagesArray .= "<a href=\"$_SERVER[PHP_SELF]?pageNum_rssearch=$theNext$_get_vars\">"; $pagesArray .= "$textLink</a>" . ($theNext < $egp-1 ? $separator : ""); } else { $pagesArray .= "$textLink" . ($theNext < $egp-1 ? $separator : ""); } } $theNext = $pageNum_Recordset1+1; $offset_end = $totalPages_Recordset1; $lastArray = ($pageNum_Recordset1 < $totalPages_Recordset1) ? "<a href=\"$_SERVER[PHP_SELF]?pageNum_rssearch=$successivo$_get_vars\">$next_Re cordset1</a>" : "$next_Recordset1"; } } return array($firstArray,$pagesArray,$lastArray); } ?><?php require_once('Connections/tp2000.php'); ?> <?php //initialize the session if (!isset($_SESSION)) { session_start(); } // ** Logout the current user. ** $logoutAction = $_SERVER['PHP_SELF']."?doLogout=true"; if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){ $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){ //to fully log out a visitor we need to clear the session varialbles $_SESSION['MM_Username'] = NULL; $_SESSION['MM_UserGroup'] = NULL; $_SESSION['PrevUrl'] = NULL; unset($_SESSION['MM_Username']); unset($_SESSION['MM_UserGroup']); unset($_SESSION['PrevUrl']); $logoutGoTo = "http://www.camarapuno.org"; if ($logoutGoTo) { header("Location: $logoutGoTo"); exit; } } ?> <?php if (!isset($_SESSION)) { session_start(); } $MM_authorizedUsers = ""; $MM_donotCheckaccess = "true"; // *** Restrict Access To Page: Grant or deny access to this page function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { // For security, start by assuming the visitor is NOT authorized. $isValid = False; // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. // Therefore, we know that a user is NOT logged in if that Session variable is blank. if (!empty($UserName)) { // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. // Parse the strings into arrays. $arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); if (in_array($UserName, $arrUsers)) { $isValid = true; } // Or, you may restrict access to only certain users based on their username. if (in_array($UserGroup, $arrGroups)) { $isValid = true; } if (($strUsers == "") && true) { $isValid = true; } } return $isValid; } $MM_restrictGoTo = "wrong.php"; if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) { $MM_qsChar = "?"; $MM_referrer = $_SERVER['PHP_SELF']; if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&"; if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0) $MM_referrer .= "?" . $QUERY_STRING; $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer); header("Location: ". $MM_restrictGoTo); exit; } ?> <?php $currentPage = $_SERVER["PHP_SELF"]; $maxRows_rssearch = 20; $pageNum_rssearch = 0; if (isset($_GET['pageNum_rssearch'])) { $pageNum_rssearch = $_GET['pageNum_rssearch']; } $startRow_rssearch = $pageNum_rssearch * $maxRows_rssearch; $colname_rssearch = "-1"; if (isset($_GET['aceptante'])) { $colname_rssearch = (get_magic_quotes_gpc()) ? $_GET['aceptante'] : addslashes($_GET['aceptante']); } mysql_select_db($database_tp2000, $tp2000); $query_rssearch = sprintf("SELECT * FROM tp2000 WHERE aceptante = '%s'", $colname_rssearch); $query_limit_rssearch = sprintf("%s LIMIT %d, %d", $query_rssearch, $startRow_rssearch, $maxRows_rssearch); $rssearch = mysql_query($query_limit_rssearch, $tp2000) or die(mysql_error()); $row_rssearch = mysql_fetch_assoc($rssearch); if (isset($_GET['totalRows_rssearch'])) { $totalRows_rssearch = $_GET['totalRows_rssearch']; } else { $all_rssearch = mysql_query($query_rssearch); $totalRows_rssearch = mysql_num_rows($all_rssearch); } $totalPages_rssearch = ceil($totalRows_rssearch/$maxRows_rssearch)-1; $queryString_rssearch = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_rssearch") == false && stristr($param, "totalRows_rssearch") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_rssearch = "&" . htmlentities(implode("&", $newParams)); } } $queryString_rssearch = sprintf("&totalRows_rssearch=%d%s", $totalRows_rssearch, $queryString_rssearch); $maxRows_rssearch = 5; $pageNum_rssearch = 0; if (isset($_GET['pageNum_rssearch'])) { $pageNum_rssearch = $_GET['pageNum_rssearch']; } $startRow_rssearch = $pageNum_rssearch * $maxRows_rssearch; $colname_rssearch = "-1"; if (isset($_GET['nombre'])) { $colname_rssearch = (get_magic_quotes_gpc()) ? $_GET['nombre'] : addslashes($_GET['nombre']); } mysql_select_db($database_tp2000, $tp2000); //----------------------este es el q hace el like----------- 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; } } continua------ |
| |||
Re: dw+php+mysql la segunda parte //---------------------------- $query_rssearch = sprintf("SELECT * FROM tp2000 WHERE aceptante LIKE CONCAT('%%', %s, '%%')", GetSQLValueString($colname_rssearch, "text")); $query_limit_rssearch = sprintf("%s LIMIT %d, %d", $query_rssearch, $startRow_rssearch, $maxRows_rssearch); $rssearch = mysql_query($query_limit_rssearch, $tp2000) or die(mysql_error()); $row_rssearch = mysql_fetch_assoc($rssearch); if (isset($_GET['totalRows_rssearch'])) { $totalRows_rssearch = $_GET['totalRows_rssearch']; } else { $all_rssearch = mysql_query($query_rssearch); $totalRows_rssearch = mysql_num_rows($all_rssearch); } $totalPages_rssearch = ceil($totalRows_rssearch/$maxRows_rssearch)-1; $queryString_rssearch = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_rssearch") == false && stristr($param, "totalRows_rssearch") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_rssearch = "&" . htmlentities(implode("&", $newParams)); } } $queryString_rssearch = sprintf("&totalRows_rssearch=%d%s", $totalRows_rssearch, $queryString_rssearch); ?> <!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/madarina_rst.dwt" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <!-- InstanceBeginEditable name="doctitle" --> <title>.:: Sistema de Informacion Crediticia ::. .:. E-Info .:.</title> <!-- InstanceEndEditable --> <link rel="stylesheet" type="text/css" href="gorotron1.css"/> <style type="text/css"> <!-- body { background-image: url(images/bg1b.gif); } .Estilo1 { color: #FFFFFF; font-weight: bold; font-family: Georgia, "Times New Roman", Times, serif; font-size: 24px; } .Estilo2 { font-size: 10px; color: #FF9900; } --> </style> <!-- InstanceBeginEditable name="head" --> <style type="text/css"> <!-- .Estilo4 { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; } .Estilo5 { font-size: 12px; color: #FFFFFF; } .Estilo7 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; } .Estilo8 {color: #000066} .Estilo11 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; color: #FFFFFF; } .Estilo12 {color: #FFFFFF; } .Estilo15 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 16px; color: #000066; } .Estilo16 {font-size: 9px} .Estilo18 {font-size: 10px; color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; } .Estilo19 {font-size: 12px} .Estilo20 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; color: #000066; } --> </style><!-- InstanceEndEditable --> </head> <body> <div align="center"> <table width="699" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <!--DWLayoutTable--> <tr> <td width="14" height="14"></td> <td width="149"></td> <td width="14"></td> <td width="502"></td> <td width="20"></td> </tr> <tr> <td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="15" height="100"> </td> </tr> </table></td> <td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000"> <!--DWLayoutTable--> <tr> <td width="145" height="100" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="149" height="100"> <param name="movie" value="flash/logo_einfo.swf" /> <param name="quality" value="high" /> <embed src="flash/logo_einfo.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="149" height="100"></embed> </object></td> </tr> </table></td> <td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="15" height="100"> </td> </tr> </table></td> <td height="100" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000"> <!--DWLayoutTable--> <tr> <td width="26" height="43"> </td> <td width="411"> </td> <td width="65"> </td> </tr> <tr> <td height="42"></td> <td valign="top"><div align="left"><span class="Estilo1">E - Info <br /> <span class="Estilo2">Sistema de información Crediticia </span></span></div></td> <td></td> </tr> <tr> <td height="15"></td> <td></td> <td></td> </tr> </table></td> <td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="15" height="100"> </td> </tr> </table></td> </tr> <tr> <td height="6"></td> </tr> <tr> <td height="15" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="699" height="15"></td> </tr> </table></td> </tr> <tr> <td height="846"></td> <td colspan="3" valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F0F0F0"> <!--DWLayoutTable--> <tr> <td width="11" height="81"> </td> <!-- InstanceBeginEditable name="resultados" --> <td width="641" valign="top"><p class="Estilo8">Ingrese el nombre del Aceptante y presione Buscar.<br /> *Para una busqueda efectiva ingrese el nombre Completo y sus Apellidos* </p> <form id="form1" name="form1" method="get" action="search_.php"> <table width="610" height="0%" border="0" bordercolor="#006666"> <tr> <td width="126" height="100%"><div align="center" class="Estilo15"> <div align="right">ACEPTANTE:</div> </div></td> <td width="364"><label> <input name="nombre" type="text" id="nombre" size="60" /> </label></td> <td width="106"><input type="submit" name="Submit" value="BUSCAR" /></td> </tr> <tr> <td height="100%"> </td> <td><span class="Estilo20">||| <a href="<?php echo $logoutAction ?>" class="Estilo20">Salir</a> |||</span></td> <td> </td> </tr> </table> </form> |
| |||
Re: dw+php+mysql lo ultimo------ <?php if ($totalRows_rssearch > 0) { // Show if recordset not empty ?> <p class="Estilo15">RESULTADOS </p> <p class="Estilo15 Estilo16"> Número de registros encontrados: <?php echo $totalRows_rssearch ?> </p> <form id="form2" name="form2" method="get" action=""> <table border="0" bordercolor="#006666"> <?php do { ?> <tr bgcolor="#000066"> <td><div align="center" class="Estilo4 Estilo5 Estilo8"> <div align="center" class="Estilo12">Cod</div> </div></td> <td><div align="center" class="Estilo11"> <div align="center">Nombre</div> </div></td> <td colspan="2"><div align="center" class="Estilo11"> <div align="center">Documento</div> </div></td> <td colspan="2"><div align="center" class="Estilo11"> <div align="center">Monto</div> </div></td> <td class="Estilo11">Girador</td> <td><div align="center" class="Estilo11"> <div align="center">F.Prot</div> </div></td> <td><div align="center" class="Estilo12"><span class="Estilo7">Estado</span></div></td> <td><div align="center" class="Estilo12"><span class="Estilo7">F.Reg</span></div></td> </tr> <tr bgcolor="#006666"> <td><div align="center"><span class="Estilo18"><?php echo $row_rssearch['cod']; ?></span></div></td> <td><div align="center"><span class="Estilo18"><?php echo $row_rssearch['aceptante']; ?></span></div></td> <td><div align="center"><span class="Estilo18"><?php echo $row_rssearch['t_doc']; ?></span></div></td> <td><div align="center"><span class="Estilo18"><?php echo $row_rssearch['numdocum']; ?></span></div></td> <td><div align="center"><span class="Estilo18"><?php echo $row_rssearch['moneda']; ?></span></div></td> <td><div align="center"><span class="Estilo18"><?php echo $row_rssearch['monto']; ?></span></div></td> <td class="Estilo18"><div align="center"> <?php echo $row_rssearch['girador']; ?></div></td> <td><div align="center"><span class="Estilo18"><?php echo $row_rssearch['fecha_prot']; ?></span></div></td> <td class="Estilo18"><div align="center"><?php echo $row_rssearch['estado']; ?></div></td> <td class="Estilo18"><div align="center"><?php echo $row_rssearch['fecha_arreglo']; ?></div></td> </tr> <tr> <td height="23"> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <?php } while ($row_rssearch = mysql_fetch_assoc($rssearch)); ?> </table> </form> <p class="Estilo19"> <?php # variable declaration $prev_rssearch = "« anterior"; $next_rssearch = "siguiente »"; $separator = " | "; $max_links = 5; $pages_navigation_rssearch = buildNavigation($pageNum_rssearch,$totalPages_rsse arch,$prev_rssearch,$next_rssearch,$separator,$max _links,true); print $pages_navigation_rssearch[0]; ?> <?php print $pages_navigation_rssearch[1]; ?> <?php print $pages_navigation_rssearch[2]; ?></p> <?php } // Show if recordset not empty ?></td> <!-- InstanceEndEditable --> <td width="13"> </td> <!-- InstanceBeginEditable name="body" --> <!-- InstanceEndEditable --></tr> <tr> <td height="765"> </td> <td> </td> <td> </td> </tr> </table> <td></td> <tr> <td height="15"></td> <td> <td></td> <td></td> <td></td> </table> </td> <td> </td> <td colspan="2" valign="top"> </td> <td></td> </tr> <tr> <td height="4"></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td height="15"></td> <td></td> <td></td> <td colspan="3" valign="top"> </td> <td></td> <td></td> </tr> </table> </div> </body><!-- InstanceEnd --></html> <?php mysql_free_result($rssearch); ?> |