Ir para conteúdo
Fórum Script Brasil
  • 0

(Resolvido) redirecionar


gadreis2000

Pergunta

Ola. Tenho este codigo em um form

<?php	include ('header.php'); 
include ('includes/index.inc.php');

?>
<div id="content">
<h3>Verifique suas informacoes de compra</h3>
<?php
if(isset($_POST["status"])){

$status=limpiar($_POST["status"]);
if ($status == "casado"){

$usercheck = uc($_COOKIE["usNick"]);
$user = limpiar($_POST["purchaseusername"]);

if ($usercheck == $user){
$purchaseip = limpiar($_POST["purchaseip"]);
$purchaseuseremail = limpiar($_POST["purchaseuseremail"]);
$purchaseitemname = limpiar($_POST["purchaseitemname"]);
$purchaseitemprice = limpiar($_POST["purchaseitemprice"]);
$myDb->connect();
$sqle = "SELECT * FROM tb_users WHERE username='$user'";
$resulte = mysql_query($sqle);
$rowe = mysql_fetch_array($resulte);
$myDb->close(); ?>

<table align="center" width="80%" cellspacing="0" cellpadding="0" class="table1">
<tr>
<th class="top">&nbsp;</th>
<th class="top"><b>Sua Informacao de compra</b></th>
</tr>
<tr>
<th class="sub">Username</th>
<td align="center"><?= $rowe['username'];?></td>
</tr>
<tr>
<th class="sub">Seu Nome</th>
<td align="center"><?= $rowe['firstname'];?></td>
</tr>
<tr>
<th class="sub">Seu Sobrenome</th>
<td align="center"><?= $rowe['surname'];?></td>
</tr>
<tr>
<th class="sub">Seu IP</th>
<td align="center"><?= $purchaseip;?></td>
</tr>
<tr>
<th class="sub">Email</th>
<td align="center"><?= $purchaseuseremail;?></td>
</tr>
<tr>
<th class="sub">Descricao Compra</th>
<td align="center"><?= $purchaseitemname;?></td>
</tr>
<tr>
<th class="sub">preço</th>
<td align="center">$ <?= $purchaseitemprice;?></td>
</tr>
</table>
<p>
<?php include ('includes/gateways.inc.php');

}else{?>
<span class='success'><b>há um erro em sua solicitacao. Por favor, tente novamente</b></span>
&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />
<?php include ('footer.php');
exit();
}
}else if ($status == "solteiro"){
$purchaseitemprice = 0;
$purchaseip = limpiar($_POST["purchaseip"]);
$pemail = limpiar($_POST["pemail"]);
$description = limpiar($_POST["description"]);
$url = limpiar($_POST["url"]);
$plan = limpiar($_POST["plan"]);
$myDb->connect();
$sql = "SELECT price FROM tb_config WHERE item='hits' and howmany='$plan'";
$result = mysql_query($sql);
$row1 = mysql_fetch_array($result);
$myDb->close();
$price_plan = $row1['price'];
$purchaseitemprice = $purchaseitemprice+$price_plan;

$viewable = limpiar($_POST["viewable"]);
if ($viewable == "ads"){
$viewable1 = "All Members";
}
if ($viewable == "casadods"){
$viewable1 = "casado";
$myDb->connect();
$sql = "SELECT price FROM tb_config WHERE item='casadoad' and howmany='1'";
$result = mysql_query($sql);
$row2 = mysql_fetch_array($result);
$myDb->close();
$price_viewable = $row2['price'];
$purchaseitemprice = $purchaseitemprice+$price_viewable;
}

$bold = limpiar($_POST["bold"]);
if ($bold == "0"){
$bold1 = "No";
}
if ($bold == "1"){
$bold1 = "Yes";
$myDb->connect();
$sql = "SELECT price FROM yob_config WHERE item='bold' and howmany='1'";
$result = mysql_query($sql);
$row3 = mysql_fetch_array($result);
$myDb->close();
$price_bold = $row3['price'];
$purchaseitemprice = $purchaseitemprice+$price_bold;
}

$highlight = limpiar($_POST["highlight"]);
if ($highlight == "0"){
$highlight1 = "No";
}
if ($highlight == "1"){
$highlight1 = "Yes";
$myDb->connect();
$sql = "SELECT price FROM tb_config WHERE item='highlight' and howmany='1'";
$result = mysql_query($sql);
$row4 = mysql_fetch_array($result);
$myDb->close();
$price_highlight = $row4['price'];
$purchaseitemprice = $purchaseitemprice+$price_highlight;
}
$purchaseitemname = limpiar($_POST["purchaseitemname"]);
$query = "INSERT INTO tb_solteiro (pemail, plan, url, description, ip, tipo, money) VALUES('$user','1000','$url','$description','$laip','convert','$money')";


?>
<table align="center" width="80%" cellspacing="0" cellpadding="0" class="table1">
<tr>
<th class="top">&nbsp;</th>
<th class="top"><b>Sua Informacao de compra</b></th>
</tr>
<tr>
<th class="sub">Email</th>
<td align="center"><?= $pemail;?></td>
</tr>
<th class="sub">Seu IP</th>
<td align="center"><?= $purchaseip;?></td>
</tr>
<tr>
<th class="sub">Descricao Compra</th>
<td align="center"><?= $purchaseitemname;?></td>
</tr>
<tr>
<th class="sub">Plano</th>
<td align="center"><?= $plan;?> Visitas </td>
</tr>
<tr>
<th class="sub">Seu Texto</th>
<td align="center"><?= $description;?></td>
</tr>
<tr>
<th class="sub">Seu Site</th>
<td align="center"><?= $url;?></td>
</tr>
<tr>
<th class="sub">Mostrar para</th>
<td align="center"><?= $viewable1;?></td>
</tr>
<tr>
<th class="sub">Negrito</th>
<td align="center"><?= $bold1;?></td>
</tr>
<tr>
<th class="sub">Realcado</th>
<td align="center"><?= $highlight1;?></td>
</tr>
<tr>
<th class="sub">preço</th>
<td align="center">$ <?= $purchaseitemprice;?></td>
</tr>

</table>

<?php include ('includes/gateways2.inc.php');
}else if ($status == "filhos"){
$purchaseip = limpiar($_POST["purchaseip"]);
$pemail = limpiar($_POST["pemail"]);
$purchaseitemname = limpiar($_POST["purchaseitemname"]);
$user = limpiar($_POST["customer"]);
$reffi = limpiar($_POST["reffi"]);

$myDb->connect();
$sql = "SELECT price FROM tb_reffi WHERE howmany='$reffi'";
$result = mysql_query($sql);
$row1 = mysql_fetch_array($result);
$myDb->close();
$purchaseitemprice = $row1['price'];
?>
<table align="center" width="80%" cellspacing="0" cellpadding="0" class="table1">
<tr>
<th class="top">&nbsp;</th>
<th class="top"><b>Suas Informacoes de compra</b></th>
</tr>
<tr>
<th class="sub">Username</th>
<td align="center"><?= $user;?></td>
</tr>
<tr>
<th class="sub">Seu IP</th>
<td align="center"><?= $purchaseip;?></td>
</tr>
<tr>
<th class="sub">Email</th>
<td align="center"><?= $pemail;?></td>
</tr>
<tr>
<th class="sub">Descricao da compra</th>
<td align="center"><?= $reffi;?> <?= $purchaseitemname;?></td>
</tr>
<tr>
<th class="sub">preço</th>
<td align="center">$ <?= $purchaseitemprice;?></td>
</tr>
</table>
<?php include ('includes/gateways3.inc.php'); ?>
<br />&nbsp;<br />&nbsp;<br />
<?php
}
}else{?>
<span class='success'><b>Acesso directo a esta pagina não e permitido</b></span>
</p><br /><br /><br />
<p class="rightBottom"></p>
<br class="spacer" />
</div>
<?php include ('footer.php');
exit();
}?>
</p>


<?php include ('footer.php'); ?>[/codebox]

O que temos 3 situações de status. Pergunta tem como ao fazer redirecionamento para este form já chamar uma das 3 situações especificas/

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...