Jump to content


BrWnO

Member Since 17/09/2006
Offline Last Active 26/09/2010, 18:21
-----

Topics I've Started

Erro Comprar

21/08/2010, 12:08

Olá to instalando um sistema de baladas aqui, porem estou com um problema no sistema de compra de fotos do site, pois não há uma tabela para o mesmo no banco de dados.Como nao tenho muito conhecimento em MySQL, peço que me ajudem a configurar uma. Abaixo segue o código do formulario de preenchimento...

<?
include("../../config.php");

$id = $_GET[id];
$cidade = $_GET[cidade];
$imagem = $_GET[imagem];

$sql = mysql_query("SELECT * FROM galeria where id='$id'");
$dados= mysql_fetch_array($sql);

$dir = "images/eventos/$dados[id_franquia]/$dados[pasta]/";
?>

<script Language="JavaScript">
function validate(theForm) {
if (theForm.nome.value == "")
{
alert("Digite seu Nome!");
theForm.nome.focus();
return (false);
}
if (theForm.email.value == "")
{
alert("Digite seu E-mail!");
theForm.email.focus();
return (false);
}
if (theForm.endereco.value == "")
{
alert("Digite o endereço de entrega!");
theForm.endereco.focus();
return (false);
}
if (theForm.bairro.value == "")
{
alert("Digite o Bairro!");
theForm.bairro.focus();
return (false);
}
if (theForm.cidade_end.value == "")
{
alert("Digite a Cidade!");
theForm.cidade_end.focus();
return (false);
}
if (theForm.quantidade.value == "")
{
alert("Digite a Quantidade de Fotos que deseja Comprar!");
theForm.quantidade.focus();
return (false);
}
return (true);
}
</script>


<form action="comprar_cod.php" method="post" onsubmit="return validate(this);">
<table border="0" align="center" cellpadding="5" cellspacing="0">
<tr align="right">
<td colspan="2"><input name="url_foto" type="hidden" value="<? echo "$usite$dir$imagem";?>" size="80">
<input name="link_galeria" type="hidden" value="<? echo "$usite$pasta/janela.php?id=$id&cidade=$cidade";?>" size="80">
<input name="id" type="hidden" value="<? echo "$id";?>" size="80">
<input name="id_franquia" type="hidden" value="<? echo "$cidade";?>" size="80">
</td>
</tr>
<tr>
<td align="left" valign="top" style="border:1px solid #cccccc;"> <img style="border:1px solid #999999;" src="<? echo "thumbs.php?w=260&h=195&imagem=../../$dir$imagem";?>"></td>
<td valign="top" bgcolor="#CCCCCC"><table height="196" border="0" cellpadding="0" cellspacing="2">
<tr>
<TD colspan="2" align=right>Nome:<br>
<INPUT name="nome" class="input" size="45"> </TD>
</tr>
<tr>
<TD colspan="2" align=right>E-mail:<br> <INPUT name="email" class="input" size="45"> </TD>
</tr>
<tr>
<TD align=right>Endere&ccedil;o para Entrega:<br>
<INPUT name="endereco" class="input" size="25"> </TD>
<TD width="98" align=right><div align="right">Bairro:</div>
<INPUT name="bairro" class="input" size="15"></TD>
</tr>
<tr>
<TD align="right">Cidade:<br>
<INPUT name="cidade_end" class="input" size="25"> </TD>
<TD align=right>Telefone:<br>
<input name="telefone" class="input" size="15"></TD>
</tr>
<tr>
<TD align=right>Tamanho da Foto:<br>
<select class="input" name="tamanho">
<option value="10x15" selected>10x15</option>
<option value="15x21">15x21</option>
</select>
</TD>
<TD align=right>Quantidade:<br>
<input name="quantidade" class="input" size="10"></TD>
</tr>
<tr align="right" valign="bottom">
<TD height="25" colspan="2">
<input name="image" type="image" src="../../images/layout/bt_en.gif"> </TD>
</tr>
</table></td>
</tr>
</table>

</form>

IPB Skin By Virteq