Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require_once('Connections/ifoodbeer.php'); ?>
- <?php
- if (!function_exists("GetSQLValueString")) {
- function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
- {
- if (PHP_VERSION < 6) {
- $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;
- }
- }
- $cep_Recordset1 = "-1";
- if (isset($_GET['cep'])) {
- $cep_Recordset1 = $_GET['cep'];
- }
- mysql_select_db($database_ifoodbeer, $ifoodbeer);
- $query_Recordset1 = sprintf("SELECT * FROM ifoodbeer WHERE %s BETWEEN cepinicio and cepfim ORDER BY id ASC", GetSQLValueString($cep_Recordset1, "text"));
- $Recordset1 = mysql_query($query_Recordset1, $ifoodbeer) or die(mysql_error());
- $row_Recordset1 = mysql_fetch_assoc($Recordset1);
- $totalRows_Recordset1 = mysql_num_rows($Recordset1);
- ?>
- <!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=iso-8859-1" />
- <title>Ibee's</title>
- <style type="text/css">
- <!--
- .logomarca {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 40px;
- color: #FFF;
- }
- -->
- </style>
- </head>
- <body>
- <table width="100%" border="0">
- <tr>
- <td> </td>
- </tr>
- <tr>
- <td bgcolor="#CC0000"><div align="center"><br />
- <span class="logomarca">Ibee's</span><br />
- <br />
- </div></td>
- </tr>
- <tr>
- <td><div align="left"><a href="testedelete/cep/index.php">Voltar</a></div></td>
- </tr>
- <tr>
- <td><div align="center">
- <form id="form1" name="form1" method="get" action="indexresp.php">
- <p>Cep consultado:
- <?php
- // Recebe os dados e guarda-os em variáveis
- $nome = $_GET['cep'];
- echo "$nome";
- ?>
- </p>
- </form>
- </div></td>
- </tr>
- <tr>
- <td><?php if ($totalRows_Recordset1 == 0) { // Show if recordset empty ?>
- Nada encontrado!
- <?php } // Show if recordset empty ?></td>
- </tr>
- </table>
- <?php do { ?>
- <?php if ($totalRows_Recordset1 > 0) { // Show if recordset not empty ?>
- <table width="21%" border="0">
- <tr>
- <td width="12%"><?php echo $row_Recordset1['id']; ?> </td>
- <td width="12%"><a href="<?php echo $row_Recordset1['link']; ?>"><?php echo $row_Recordset1['nomeloja']; ?></a></td>
- <td width="1%"> </td>
- <td width="87%"><img src="images/<?php echo $row_Recordset1['logo']; ?>" width="100" height="100" /></td>
- </tr>
- </table>
- <?php } // Show if recordset not empty ?>
- <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
- <p><!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Buscando informações de um endereço através do CEP</title>
- <body>
- CEP: <input type="text" id="cep" value="<?php echo $_GET['cep']; ?>" maxlength="9" placeholder="Ex: 13483-087"/>
- <br/>
- <table width="100%" border="0">
- <tr>
- <td> </td>
- </tr>
- </table>
- </body>
- </html>
- <?php
- mysql_free_result($Recordset1);
- ?>
- </p>
- </body>
- </html>
- <?php $nome = $_GET['cep'];
- $nova = str_replace('-', '', $nome);
- echo "$nova";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement