Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/12/2010, 04:30
arts
 
Fecha de Ingreso: mayo-2008
Mensajes: 228
Antigüedad: 16 años
Puntos: 2
Respuesta: Como pasar varibales a Pasat4b

Expongo los otros 2 archivos que tengo que no me permitia ponerlos por exceso de caracteres.

ecomm_cheout2.php

ecomm_checkout2.php

Código PHP:
<?php
session_start
();
require 
'db.inc.php';
$db mysql_connect(MYSQL_HOSTMYSQL_USERMYSQL_PASSWORD) or
die (
'Unable to connect. Check your connection parameters.');
mysql_select_db(MYSQL_DB$db) or die(mysql_error($db));
$session session_id();
if (isset(
$_POST['same_info'])) {
$_POST['shipping_first_name'] = $_POST['first_name'];
$_POST['shipping_last_name'] = $_POST['last_name'];
$_POST['shipping_address_1'] = $_POST['address_1'];
$_POST['shipping_address_2'] = $_POST['address_2'];
$_POST['shipping_city'] = $_POST['city'];
$_POST['shipping_state'] = $_POST['state'];
$_POST['shipping_zip_code'] = $_POST['zip_code'];
$_POST['shipping_phone'] = $_POST['phone'];
$_POST['shipping_email'] = $_POST['email'];
}
?>
<html>
<head>
<title>Compra Paso 2 de 3</title>
<style type="text/css" >
th {background-color: #999;}
td {vertical-align: top;}
.odd_row {background-color: #EEE;}
.even_row {background-color: #FFF;}
</style>
</head>
<body>
<h1>Un Placer</h1>
<h2>Orden de Pedido</h2>
<ol>
<li> Ingrese la informacion de facturacion y envio</li>
<li> <strong> Verificacion de los datos de facuracion y producto a enviar</strong>
</li>
<li>Confirmación de pedido y recibo</li>
</ol>
<table style="width: 75%;" >
<tr>
<th style="width: 100px;" > </th> <th> Nombre Articulo </th> <th> Cantidad </th>
<th> Precio por Articulo </th> <th> Precio total </th>
</tr>
<?php
$query 
'SELECT
t.product_code, qty,
nombre, descripcion_castellano, precio
FROM ecomm_temp_cart t JOIN novedades p ON
t.product_code = p.codigo
WHERE
session = "' 
$session '"
ORDER BY
t.product_code ASC'
;
$results mysql_query($query$db) or die (mysql_error($db));
$rows mysql_num_rows($results);
$total 0;
$odd true;
while (
$row mysql_fetch_array($results)) {
echo (
$odd == true) ? ' <tr class="odd_row"> ' ' <tr class="even_row"> ';
$odd = !$odd;
extract($row);
?>
<td style="text-align:center;">
<img src="http://www.grutinet.com/articulos/or/or_<?php echo $product_code?>.jpg"
alt=" <?php echo $nombre?> "/>
</td>
<td> <?php echo $nombre?> </td>
<td> <?php echo $qty?> </td>
<td style="text-align: right;" > € <?php echo $precio?> </td>
<td style="text-align: right;" > € <?php echo number_format
($precio $qty2);?>
</td>
</tr>
<?php
$total 
$total $precio $qty;
}
?>
</table>
<p> Su Total sin manipulacion ni envio es:
<strong> € <?php echo number_format($total2); ?> </strong> </p>
<table>
<tr>
<td>
<table>
<tr>
<th colspan="2"> Informacion de facturacion
</th>
</tr> <tr>
<td> Nombre: </td>
<td> <?php echo htmlspecialchars($_POST['first_name']);?> </td>
</tr> <tr>
<td> Apellidos: </td>
<td> <?php echo htmlspecialchars($_POST['last_name']);?> </td>
</tr> <tr>
<td> Direccion de Facturacion: </td>
<td> <?php echo htmlspecialchars($_POST['address_1']);?> </td>
</tr> <tr>
<td> </td>
<td> <?php echo htmlspecialchars($_POST['address_2']);?> </td>
</tr> <tr><td> Cioudad: </td>
<td> <?php echo htmlspecialchars($_POST['city']);?> </td>
</tr> <tr>
<td> Localidad: </td>
<td> <?php echo htmlspecialchars($_POST['state']);?> </td>
</tr> <tr>
<!--<td> Codigo Postal: </td>-->
<?php /*?><td> <?php echo htmlspecialchars($_POST['zip_code']);?> </td>
<?php */
?></tr> <tr>
<td> Telefono: </td>
<td> <?php echo htmlspecialchars($_POST['phone']);?> </td>
</tr><tr>
<td> Email: </td>
<td> <?php echo htmlspecialchars($_POST['email']);?> </td>
</td>
</tr><tr>
<td colspan="2" style="text-align: center;" >
<?php
if (isset($_POST['same_info'])) {
echo 
'Shipping information is same as billing.';
}
?>
</td>
</tr>
</table>
</td>
<td>
<?php
if (!isset($_POST['same_info'])) {
?>
<table>
<tr>
<th colspan="2"> Informacion de Envio </th>
</tr> <tr>
<td> Nombre: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_first_name']);?> </td>
</tr> <tr>
<td> Apellidos: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_last_name']);?> </td>
</tr> <tr>
<td> Direccion de Envio: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_address_1']);?> </td>
</tr> <tr>
<td> </td>
<td> <?php echo htmlspecialchars($_POST['shipping_address_2']);?> </td>
</tr> <tr>
<td> Ciudad: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_city']);?> </td>
</tr> <tr>
<td> Localidad: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_state']);?> </td>
</tr> <tr>
<td> Codigo Postal: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_zip_code']);?> </td>
</tr> <tr>
<td> Telefono: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_phone']);?> </td>
</tr><tr>
<td> Email: </td>
<td> <?php echo htmlspecialchars($_POST['shipping_email']);?> </td>
</td>
</tr>
</table>
<?php
}
?>
</td>
</tr>
</table>
<form method="post" action="pasarelaphp.php">
<div>
<input type="submit" name="submit" value="pasarelaphp.php"/>
<input type="hidden" name="last_name"
value=" <?php echo htmlspecialchars($_POST['last_name']);?> "/>
<input type="hidden" name="address_1"
value=" <?php echo htmlspecialchars($_POST['address_1']);?> "/>
<input type="hidden" name="address_2"
value=" <?php echo htmlspecialchars($_POST['address_2']);?> "/>
<input type="hidden" name="city"
value=" <?php echo htmlspecialchars($_POST['city']);?> "/>
<input type="hidden" name="state"
value=" <?php echo htmlspecialchars($_POST['state']);?> "/>
<input type="hidden" name="zip_code"
value=" <?php echo htmlspecialchars($_POST['zip_code']);?> "/>
<input type="hidden" name="phone"
value=" <?php echo htmlspecialchars($_POST['phone']);?> "/>
<input type="hidden" name="email"
value=" <?php echo htmlspecialchars($_POST['email']);?> "/>
<input type="hidden" name="shipping_first_name"
value=" <?php echo htmlspecialchars($_POST['shipping_first_name']);?> "/>
<input type="hidden" name="shipping_last_name"
value=" <?php echo htmlspecialchars($_POST['shipping_last_name']);?> "/>
<input type="hidden" name="shipping_address_1"
value=" <?php echo htmlspecialchars($_POST['shipping_address_1']);?> "/>
<input type="hidden" name="shipping_address_2"
value=" <?php echo htmlspecialchars($_POST['shipping_address_2']);?> "/>
<input type="hidden" name="shipping_city"
value=" <?php echo htmlspecialchars($_POST['shipping_city']);?> "/>
<input type="hidden" name="shipping_state"
value=" <?php echo htmlspecialchars($_POST['shipping_state']);?> "/>
<input type="hidden" name="shipping_zip_code"
value=" <?php echo htmlspecialchars($_POST['shipping_zip_code']);?> "/>
<input type="hidden" name="shipping_phone"
value=" <?php echo htmlspecialchars($_POST['shipping_phone']);?> "/>
<input type="hidden" name="shipping_email"
value=" <?php echo htmlspecialchars($_POST['shipping_email']);?> "/>
<input type="hidden" name="order_id"
value=" <?php echo htmlspecialchars($_POST['order_id']);?> "/>
</div>
</form>
</body>
</html>