O form que manda as informações pro script, as partes do input text ok, o problema e são inputs radio, eu estou mandando as informações pro MySQL, e preciso que na pagina que ira criar, mostre as formas de pagamentos escolhidas pelo Radio, 0 desativado e 1 ativado
Script que manda informações:
<form name="FrmCadastro" action="criar_anuncio_ok.php" method="post" enctype="multipart/form-data"> <label>Login:</label> <input name="login" type="text" maxlength="15" size="20" /><br /> <label>Categoria:</label> <?php echo categorias(value,name,categorias,name); ?><br/> <label>Meta Tag Descrição:</label> <textarea name="meta_desc" cols="67" rows="5">Descrição da empresa, seja o mais leal possível com esse campo, descreva realmente no que a empresa atua.</textarea><br /> <label>Meta Tag Keywords:</label> <input name="meta_key" type="text" maxlength="255" size="65" value="descreva,as,palavras,chaves,assim"/><br /> <label>Título do Site:</label> <input name="titulo_site" type="text" maxlength="65" size="65" /><br /> <label>Nome da Empresa:</label> <input name="nome_empresa" type="text" maxlength="65" size="50" /><br /> <label>Descrição da Empresa:</label> <textarea name="desc_empresa" cols="67" rows="5"></textarea><br /> <label>Descrição dos Serviços:</label> <textarea name="desc_servicos" cols="67" rows="5"></textarea><br /> <!-- <label>Imagem de um serviço:</label> <input name="img_servico" type="file" /><br /> --> <label>Endereço:</label> <input name="endereco" type="text" maxlength="100" size="50" /><br /> <label>Bairro:</label> <input name="bairro" type="text" maxlength="50" size="50" /><br /> <label>Cidade:</label> <input name="cidade" type="text" maxlength="50" size="50" /><br /> <label>UF:</label> <?php echo estados();?> <label>CEP:</label> <input name="cep" id="cep" type="text" maxlength="15" size="20" /><br /> <label>Telefone:</label> <input name="telefone" id="fone" type="text" maxlength="15" size="20" /><br /> <label>Telefone Contato:</label> <input name="telefone2" id="fone2" type="text" maxlength="15" size="20" /><br /> <label>Email:</label> <input name="email" type="text" maxlength="100" size="50" /><br /> <label>Site:</label> <input name="site" type="text" maxlength="100" size="50" /><br /> <label>Aceita Visa?</label> <input name="visa" type="radio" value="1" />Sim <input name="visa" type="radio" value="0" checked />Não<br /> <label>Aceita Visa Electron?</label> <input name="visae" type="radio" value="1" />Sim <input name="visae" type="radio" value="0" checked />Não<br /> <label>Aceita MasterCard?</label> <input name="master" type="radio" value="1" />Sim <input name="master" type="radio" value="0" checked />Não<br /> <label>Aceita Cirrus?</label> <input name="cirrus" type="radio" value="1" />Sim <input name="cirrus" type="radio" value="0" checked />Não<br /> <label>Aceita American Express?</label> <input name="american" type="radio" value="1" />Sim <input name="american" type="radio" value="0" checked />Não<br /> <label>Aceita Hipercard?</label> <input name="hiper" type="radio" value="1" />Sim <input name="hiper" type="radio" value="0" checked />Não<br /> <label>Aceita Senff?</label> <input name="senff" type="radio" value="1" />Sim <input name="senff" type="radio" value="0" checked />Não<br /> <label>Aceita Boleto?</label> <input name="boleto" type="radio" value="1" />Sim <input name="boleto" type="radio" value="0" checked />Não<br /> <input type="submit" name="cadastrar" value="Criar Anúncio" /> </form>Script que recebe informações:
$login = $_POST['login'];
$categoria = $_POST['categoria'];
$meta_desc = $_POST['meta_desc'];
$meta_key = $_POST['meta_key'];
$titulo_site = $_POST['titulo_site'];
$nome_empresa = $_POST['nome_empresa'];
$desc_empresa = $_POST['desc_empresa'];
$desc_servicos = $_POST['desc_servicos'];
$endereco = $_POST['endereco'];
$bairro = $_POST['bairro'];
$cidade = $_POST['desc_site'];
$uf = $_POST['estado'];
$cep = $_POST['cep'];
$telefone = $_POST['telefone'];
$telefone2 = $_POST['telefone2'];
$email = $_POST['email'];
$site = $_POST['site'];
$visa = $_POST['visa'];
$visa_e = $_POST['visae'];
$master = $_POST['master'];
$cirrus = $_POST['cirrus'];
$american = $_POST['american'];
$hiper = $_POST['hiper'];
$senff = $_POST['senff'];
$boleto = $_POST['boleto'];
$criar_anuncio = mysql_query("INSERT INTO anuncios (id,login,categoria,meta_desc,meta_key,titulo_site,nome_empresa,desc_empresa,
desc_servicos,endereco,bairro,cidade,uf,cep,telefone,telefone2,email,site,visa,visaelectron,mastercard,
cirrus,american,hipercard,senff,boleto)
VALUES ('','$login','$categoria','$meta_desc','$meta_key','$titulo_site','$nome_empresa','$desc_empresa',
'$desc_servicos','$endereco','$bairro','$cidade','$uf','$cep','$telefone','$telefone2','$email','$site',
'$visa','$visa_e','$master','$cirrus','$american','$hiper','$senff','$boleto')");
$formas_pgto = mysql_fetch_object(mysql_query("SELECT login,visa,visaelectron,mastercard,cirrus,american,hipercard,senff,boleto
FROM anuncios
WHERE login='$login'"));
$replace = strtolower(str_replace(" ", "-", $titulo_site));
$diretorio = mkdir("../anuncios/$categoria/$login/images/", 0700, true);
$arquivo = fopen("../anuncios/$categoria/$login/$replace.php", "w+");
$conteudo = "<!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\" />
<meta http-equiv=\"content-language\" content=\"pt-br\" />
<meta http-equiv=\"expires\" content=\"Mon, 30 Nov 1992 00:00:01 GMT\" />
<meta name=\"description\" content=\"$meta_desc\" />
<meta name=\"keywords\" content=\"$meta_key\" />
<meta name=\"robots\" content=\"index,follow\" />
<meta name=\"author\" content=\"Interactive Sites\" />
<meta name=\"revisit-after\" content=\"1 days\" />
<meta name=\"rating\" content=\"general\" />
<meta name=\"distribution\" content=\"global\" />
<title>$titulo_site</title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../anuncios/css/anuncio.css\" />
</head>
<body>
<div id=\"divGeral\">
<!-- CIMA -->
<div id=\"divCima\">
<div id=\"divLogo\"></div>
<div id=\"divSlogan\">
<h1>$nome_empresa</h1>
</div>
</div>
<!-- FIM -->
<!-- CONTEÚDO -->
<div id=\"divContent\">
<!-- ESQUERDA -->
<div id=\"left\">
<div class=\"barra\">
<img src=\"../../images/estrela.jpg\" width=\"37\" height=\"59\" border=\"0\" />
<h1>$nome_empresa</h1>
</div>
<div class=\"texto_empresa\">
<p>$desc_empresa</p>
</div>
<div class=\"barra\">
<img src=\"../../images/desc.jpg\" width=\"43\" height=\"59\" border=\"0\" />
<h1>$titulo_site</h1>
</div>
<div class=\"imagem_descricao\">
<img src=\"../../../anuncios/images/hot-send-logo.jpg\" width=\"128\" height=\"36\" border=\"0\" alt=\"hot-send-anuncio-na-internet\" title=\"HotSend - Seu anúncio na Internet\" />
</div>
<div class=\"texto_descricao\">
<p>$desc_servicos</p>
</div>
<div class=\"barra\">
<img src=\"../../images/galeria.jpg\" width=\"77\" height=\"59\" border=\"0\" />
<h1>Veja as fotos dos nossos serviços</h1>
</div>
<div class=\"fotos\">
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
<img src=\"../images/galeriae.jpg\" width=\"161\" height=\"63\" border=\"0\" />
</div>
<div class=\"barra\">
<img src=\"../../images/dinheiro.jpg\" width=\"68\" height=\"59\" border=\"0\" />
<h1>Formas de Pagamento</h1>
</div>
<div class=\"pagamento\">
if($formas_pgto->visa == 1){ echo '<img src=\"../../images/visa.gif\" width=\"50\" height=\"30\" border=\"0\" alt=\"empresa-aceita-visa\" title=\"Visa\" />'; }
if($formas_pgto->visaelectron == 1){ echo '<img src=\"../../images/visa-ele.gif\" width=\"50\" height=\"30\" border=\"0\" alt=\"empresa-aceita-visa-electron\" title=\"Visa Electron\" />'; }
if($formas_pgto->mastercard == 1){ echo '<img src=\"../../images/mastercard.gif\" width=\"50\" height=\"30\" border=\"0\" alt=\"empresa-aceita-mastercard\" title=\"MasterCard\" />'; }
if($formas_pgto->cirrus == 1){ echo '<img src=\"../../images/cirrus.gif\" width=\"50\" height=\"30\" border=\"0\" alt=\"empresa-aceita-cirrus\" title=\"Cirrus\" />'; }
if($formas_pgto->american == 1){ echo '<img src=\"../../images/american.gif\" width=\"50\" height=\"30\" border=\"0\" alt=\"empresa-aceita-american-express\" title=\"American Express\" />'; }
if($formas_pgto->hipercard == 1){ echo '<img src=\"../../images/hipercard.gif\" width=\"50\" height=\"30\" border=\"0\" alt=\"empresa-aceita-hipercard\" title=\"Hipercard\" />'; }
if($formas_pgto->senff == 1){ echo '<img src=\"../../images/senf.gif\" width=\"50\" height=\"30\" border=\"0\" alt=\"empresa-aceita-senff\" title=\"Senff\" />'; }
if($formas_pgto->boleto == 1){ echo '<img src=\"../../images/boleto.gif\" width=\"50\" height=\"30\" border=\"0\" alt=\"empresa-aceita-boleto\" title=\"Boleto\" />'; }
</div>
<div class=\"barra\">
<img src=\"../../images/contato.jpg\" width=\"54\" height=\"59\" border=\"0\" />
<h1>Entre em contato</h1>
</div>
<div class=\"contato\">
<p><b>Endereço / Bairro:</b> $endereco / $bairro</p>
<p><b>Cidade/UF - CEP:</b> $cidade/$uf - $cep</p>
<p><b>Telefone:</b> $telefone - $telefone2</p>
<p><b>Email:</b> $email</p>
<p><b>Site:</b> <a href='http://$site/' target='_blank'>$site</a></p>
</div>
</div>
<!-- FIM -->
<!-- DIREITA -->
<div id=\"right\">
<div class=\"adsense\">
<script type=\"text/javascript\"><!--
google_ad_client = \"pub-1651024934612554\";
/* 160x600, criado 19/05/10 */
google_ad_slot = \"2165914630\";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type=\"text/javascript\"
src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script>
</div>
</div>
<!-- FIM -->
</div>
<!-- FIM -->
<!-- RODAPÉ -->
<div id=\"rodape\">
<img src=\"../../../anuncios/images/hot-send-logo.jpg\" width=\"128\" height=\"36\" border=\"0\" alt=\"hot-send-anuncio-na-internet\" title=\"HotSend - Seu anúncio na Internet\" />
<p>Copyright © Todos os direitos reservados a HotSend - 2010</p>
</div>
<!-- FIM -->
</div>
</body>
</html>";
fwrite($arquivo, $conteudo);
}











