Jump to content

dynamic page creation depending on same page selections?


wmguk

Recommended Posts

hi again,

 

now the other issue is solved, i move on to this, basically on the cart page you use a drop down to select payment method.

 

PayPal, Cheque or Credit Card.

 

there are 3 different sets of fields, and the variables that are entered need to be used, on other pages or emailed via SSL etc....

 

this is the current page, which you can see is already a self submitting dynamic page, but i cannot work out to make the payment option self generate...

 

<?php
//General Parameters
$escape_char='##';

//connecting to the DB, inserting the information...
$login = $_GET['login'];
$loginlower = strtolower($login);
$ceremony = $_GET['ceremony'];
$counters = $_GET['counters'];

$pricing_table='pricing';

// Make Connection
include '../scripts/connection.php';         // <-- Change Here, (if the path is different)
if (!$conn)
{
die('Could not connect: ' . mysql_error() );
}
mysql_select_db($db, $conn);



//this piece of code is good for "Show Basket" scripts in general
//should be connected and parameters should be defined already
function ShowOrder($escape_char,$pricing_table,$conn){
if (isset($_COOKIE["order"])){
?>
<table border="0" width="90%">
<tr>
<td colspan=6><span class=formnames><strong><?
include "../scripts/connection.php"; 

$login = $_GET['login'];

if (!$conn) 
{ 
  die( 'Could not connect: ' . mysql_error() ); 
   }
mysql_select_db($db, $conn); 

$result = mysql_query("SELECT * FROM album WHERE login = '$login'");

while($row = mysql_fetch_array($result)) 
{ 
$groom_firstname = $row['groom_firstname']; 
$ceremony = $row['ceremony']; 

  if ($groom_firstname == 'X') 
{  
  $albumname = "The " . $row['ceremony'] . " of " . $row['bride_firstname'];
} 
  else
{
  $albumname = "The " . $row['ceremony'] . " of " . $row['bride_firstname'] . " " . $row['bride_surname'] . " and " . $row['groom_firstname'] . " " . $row['groom_surname'];
}
}
echo $albumname ;?></strong></td>
</tr>
<tr>
<td width="10%">     </td>
<td width="20%" align=center><span class=formnames><strong>Image ID</strong></td>
<td width="30%" align=center><span class=formnames><strong>Item Description</strong></td>
<td width="15%" align=center><span class=formnames><strong>Price</strong></td>
<td width="10%" align=center><span class=formnames><strong>Quantity</strong></td>
<td width="10%" align=right><span class=formnames><strong>Sub Total</strong></td>
</tr>

<tr>
<td colspan=6><HR color="#666666"></td>
</tr>
<?php

$query="SELECT * FROM $pricing_table ORDER BY 'price' ASC";
$result=mysql_query( $query , $conn ) or die( "<strong>Query Error</strong>: " . mysql_error() . "<br><strong>Query</strong>: $query<br><br>" );

// retrieving the information from the pricing table
while ($row = mysql_fetch_array($result)) {
	$item_price[$row['refnum']]=$row['price'];$item_description[$row['refnum']]=$row['descr'];
}

$total=0;
$order_items=split($escape_char, $_COOKIE["order"]);
for($i=0;$i<intval(sizeof($order_items)/3);$i++){
?>
 <tr>
  <td width="150"><img src="<?php echo $order_items[3*$i]; ?>" width="100" border="0" align="top" style="border-style:outset; border-color: black; border-width:1px;"></td>
  <td width="20%" align=center><span class=formnames><strong><?php echo substr($order_items[3*$i],strpos($order_items[3*$i],'/')+1); ?></strong></td>
  <td width="30%" align=center><span class=formnames><strong><?php echo $item_description[$order_items[3*$i+1]]; ?></strong></td>
  <td width="15%" align=center><span class=formnames><strong><?php echo $item_price[$order_items[3*$i+1]]; ?></strong></td>
  <td width="10%" align=center><span class=formnames><strong><?php echo $order_items[3*$i+2]; ?></strong></td>
  <td width="10%" align=right><span class=formnames><strong><?php printf("%02.2f",$order_items[3*$i+2]*$item_price[$order_items[3*$i+1]]); $total=$total+$order_items[3*$i+2]*$item_price[$order_items[3*$i+1]]; ?></strong></td>
 </tr><tr>
<td colspan=6><HR color="#666666"></td>
</tr>
<?php
}
   echo "<tr><td colspan=6 align=\"right\"><span class=formnames><strong> Total: ";
   printf("%02.2f",$total);
   echo "</strong></td></tr>";
   echo "</table>";
}
}




if (isset($_POST['email'])){
?>
<html>
<head>
<?php


//The insertion into the Database
$query="SELECT * FROM $pricing_table ORDER BY price ASC";
$result=mysql_query( $query , $conn ) or die( "<strong>Query Error</strong>: " . mysql_error() . "<br><strong>Query</strong>: $query<br><br>" );

// retrieving the information from the pricing table
while ($row = mysql_fetch_array($result)) {
	$item_price[$row['refnum']]=$row['price'];$item_description[$row['refnum']]=$row['descr'];
}

$total=0;
$total_quantity=0;
$order_items=split($escape_char, $_COOKIE["order"]);
for($i=0;$i<intval(sizeof($order_items)/3);$i++){
	$total=$total+$order_items[3*$i+2]*$item_price[$order_items[3*$i+1]];
	$total_quantity=$total_quantity+$order_items[3*$i+2];
}

$orderdate = date("Y-m-d");


$general_order_query="INSERT INTO orders (albumname, orderdate, name_first, name_last, email, address1, address2, city, state, zip, country, phone, comments, ship_name, ship_address1, ship_address2, ship_city, ship_state, ship_zip, ship_country, ship_phone, ordered_items,total_quantity,total) VALUES('".mysql_real_escape_string($_POST[albumname])."','$orderdate','".mysql_real_escape_string($_POST[name_first])."', '".mysql_real_escape_string($_POST[name_last])."', '".mysql_real_escape_string($_POST[email])."', '".mysql_real_escape_string($_POST[address1])."', '".mysql_real_escape_string($_POST[address2])."', '".mysql_real_escape_string($_POST[city])."', '".mysql_real_escape_string($_POST[state])."', '".mysql_real_escape_string($_POST[zip])."', '".mysql_real_escape_string($_POST[country])."', '".mysql_real_escape_string($_POST[phone])."', '".mysql_real_escape_string($_POST[comments])."', '".mysql_real_escape_string($_POST[ship_name])."', '".mysql_real_escape_string($_POST[ship_address1])."', '".mysql_real_escape_string($_POST[ship_address2])."', '".mysql_real_escape_string($_POST[ship_city])."', '".mysql_real_escape_string($_POST[ship_state])."', '".mysql_real_escape_string($_POST[ship_zip])."', '".mysql_real_escape_string($_POST[ship_country])."', '".mysql_real_escape_string($_POST[ship_phone])."', '".mysql_real_escape_string($_POST[ordered_items])."', '".$total_quantity."', '".$total."')";

mysql_query( $general_order_query , $conn ) or die( "<strong>Query Error</strong>: " . mysql_error() . "<br><strong>Query</strong>: $query<br><br>" );



// Inserting the details of the order into order_details
$order_id=mysql_insert_id();
$details_query='';
for($i=0;$i<intval(sizeof($order_items)/3);$i++){
$details_query=$details_query."('".$order_id."','".$order_items[3*$i]."','".$order_items[3*$i+1]."','".$item_description[$order_items[3*$i+1]]."','".$order_items[3*$i+2]."','".$order_items[3*$i+2]*$item_price[$order_items[3*$i+1]]."'),";
}

$details_query="INSERT INTO order_details (id,file_name,refnum,descr,quantity, subtotal) VALUES".substr_replace($details_query,"",-1);

mysql_query( $details_query , $conn ) or die( "<strong>Query Error</strong>: " . mysql_error() . "<br><strong>Query</strong>: $query<br><br>" );


echo "<b>the order has been sent...</b>"; // here include your "Thank You" page...


} else {
?>
<?
$user = $_GET['user'];
?>
<html>
<head>

<STYLE TYPE='text/css'>

body{padding:0;border:0;margin:0;}
html{padding:0;border:0;margin:0;}

H1{color:#999999; font-size:16pt; font-family:Century Gothic,Arial,Helvetica,sans-serif; font-weight:bold; }
.MainText{line-height:pt; text-align:left; font-style:normal; color:#515054; font-size:10pt; font-family:Century Gothic,Arial,Helvetica,sans-serif; font-weight:normal; }
.formnames{text-align:left; font-style:normal; color:#515054; font-size:9pt; font-family:Century Gothic,Arial,Helvetica,sans-serif; font-weight:normal; }
.warning{color:#CC0000; background-color:#ffffff; font-size:9pt; font-family:Century Gothic,Arial,Helvetica,sans-serif; font-weight:bold; }
.result{color:#515054; font-size:10pt; font-family:Century Gothic,Arial,Helvetica,sans-serif; font-weight:bold; }

INPUT{font-family:Century Gothic,Arial,Helvetica,sans-serif; font-style:normal; color:#000000; font-size:9pt; font-weight:normal; }
SELECT{font-family:Century Gothic,Arial,Helvetica,sans-serif; font-style:normal; color:#000000; font-size:9pt; font-weight:normal; }
OPTION{font-family:Century Gothic,Arial,Helvetica,sans-serif; font-style:normal; color:#000000; font-size:9pt; font-weight:normal; }
TEXTAREA{font-family:Century Gothic,Arial,Helvetica,sans-serif; font-style:normal; color:#000000; font-size:9pt; font-weight:normal; }

A{color:#666666; font-family:Century Gothic; font-size:10pt; font-weight:normal; text-decoration:underline; }
A:Visited{color:#666666; font-family:Century Gothic; font-size:10pt; font-weight:normal; text-decoration:underline; }
A:Hover{color:#666666; font-family:Century Gothic; font-size:10pt; font-weight:normal; text-decoration:none; }
</STYLE>

<script type='text/javascript' language='javascript'>
function getCookie (name) {
var dcookie = document.cookie; 
var cname = name + "=";
var clen = dcookie.length;
var cbegin = 0;
        while (cbegin < clen) {
        var vbegin = cbegin + cname.length;
                if (dcookie.substring(cbegin, vbegin) == cname) {
                var vend = dcookie.indexOf (";", vbegin);
                        if (vend == -1) vend = clen;
                return unescape(dcookie.substring(vbegin, vend));
                }
        cbegin = dcookie.indexOf(" ", cbegin) + 1;
                if (cbegin == 0) break;
        }
return null;
}

function ListCountries()
{
 var Countries=new Array("Afghanistan","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antigua and Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia","Botswana","Bouvet Island","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Central African Rep","Chad","Chile","China","Christmas Island","Colombia","Comoros","Congo","Congo","Cook Islands","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Rep","East Timor","Ecuador","Egypt","El Salvador","Falkland Islands","Faroe Islands","Fiji","Finland","France","Gabon","Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea","Kuwait","Kyrgyzstan","Lao","Latvia","Lebanon","Lesotho","Liberia","Liechtenstein","Lithuania","Luxembourg","Macau","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia","Monaco","Mongolia","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk Island","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Pitcairn","Poland","Portugal","Puerto Rico","Qatar","Romania","Russia","Rwanda","Saint Lucia","Samoa","San Marino","Saudi Arabia","Senegal","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","St. Helena","Sudan","Suriname","Swaziland","Sweden","Switzerland","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tokelau","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Viet Nam","Western Sahara","Yemen","Yugoslavia","Zambia","Zimbabwe");
 var CountryCodes=new Array("AF","AL","DZ","AS","AD","AO","AI","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BA","BW","BV","BR","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CO","KM","CG","CD","CK","CR","CI","HR","CU","CY","CZ","DK","DJ","DM","DO","TP","EC","EG","SV","FK","FO","FJ","FI","FR","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GN","GW","GY","HT","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IL","IT","JM","JP","JO","KZ","KE","KI","KR","KW","KG","LA","LV","LB","LS","LR","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MC","MN","MS","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","NO","OM","PK","PW","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RO","RU","RW","LC","WS","SM","SA","SN","SC","SL","SG","SK","SI","SB","SO","ZA","ES","LK","SH","SD","SR","SZ","SE","CH","TW","TJ","TZ","TH","TG","TK","TO","TT","TN","TR","TM","TV","UG","UA","AE","GB","US","UY","UZ","VU","VA","VE","VN","EH","YE","YU","ZM","ZW");
 var NumCountries = (eval(Countries).length);
//alert(NumCountries+" Countries");

 for (k =0;k <= (NumCountries-1);k++)
	{
	 document.write('<OPTION VALUE="'+CountryCodes[k]+'_'+Countries[k]+'">'+Countries[k]+'</OPTION>');
	}
}

</script>

</head>

<script type='text/javascript' language='javascript'>

function orderSubmit(type) 
{
 if (type == 'order')
	{
	 if ( ( checkRequired() ) )
		{
       //      document.order.form_action.value = type;
		 document.order.submit();
		 return true;
		}
	 else
		{
		 return false;
		}
	}
}



function checkRequired()
{


 if (!document.order.name_first.value.length ||
            !document.order.name_last.value.length ||
            !document.order.email.value ||
            !document.order.address1.value.length ||
            !document.order.city.value.length ||
            !document.order.state.value.length ||
            !document.order.zip.value.length ||
            !document.order.country.value.length ||
            !document.order.phone.value.length)
	{ 
	 alert('You have not completed all required Customer Details!\n\n' +
	 'Please complete your Name, Email, Full Address and\n' +
	 'Daytime Contact Telephone number to continue.');

	 document.order.name_first.focus();
	 return false;
	}


 if (document.order.email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)== -1)
	{
	 alert('Your Email Address is Invalid!\n\n'+'Please check and try again');
	 document.order.email.focus();
	 return false;
	}


	 return true;

}

function copyToShipping()
{
 if (document.order.same_flag.checked)
	{
	 document.order.ship_name.value		= document.order.name_first.value+' '+document.order.name_last.value;
	 document.order.ship_address1.value	= document.order.address1.value;
	 document.order.ship_address2.value	= document.order.address2.value;
	 document.order.ship_city.value		= document.order.city.value;
	 document.order.ship_state.value	= document.order.state.value;
	 document.order.ship_zip.value		= document.order.zip.value;
	 document.order.ship_country.value	= document.order.country.value;
	 document.order.ship_phone.value	= document.order.phone.value;
	}
}

</script>
<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<body bgcolor="#ffffff">



<TABLE border="0" width="100%" CELLPADDING="0" CELLSPACING="0">


<TR>
<TD ALIGN="center" VALIGN="top">
<table border="0" width="75%"> 


</table>


<FORM METHOD="POST" NAME="order">

<!-- The Ordered Items -->
<?php 

ShowOrder($escape_char,$pricing_table,$conn);
?>

<!--VISIBLE ORDER INPUT TYPES HERE-->

<table border="0" width="75%">

<!--CUSTOMER PERSONAL DETAILS FORM-->


<tr><td colspan=6><p class=MainText></p>
</td></tr>
<TR>
<TD align="Left" colspan="6"><p class=MainText><strong>Placing Your Order.</strong><br>To place this order, please supply the following details which, upon submitting, will <strong>only</strong> be used for the purposes of processing your order.<br><br><strong>Customer Details:</strong></p></TD>

</TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>First Name:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="name_first" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Surname:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="name_last" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Email Address:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="email" SIZE="30"></TD>
</TR>
<TR><TD colspan="6"> </TD></TR>

<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Address Line1:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="address1" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Address Line2:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="address2" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Town/City:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="city" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>County:</span></TD>

<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="state" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Postcode:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="zip" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Country:</span></TD>
<TD align="LEFT" colspan="4"><SELECT NAME="country" SIZE="1">
<OPTION VALUE="GB_United Kingdom">United Kingdom</OPTION>

<script type='text/javascript' language='javascript'>

ListCountries()

</script>	
</SELECT></TD></TR>

<TR><TD colspan="6"> </TD></TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Daytime Tel No:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="phone" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" valign="top" colspan="5"> </TD><TD> </TD>
</TR>

<TR><TD colspan="6"> </TD></TR>
<TR>

<TD align="Left" colspan="6"><span class=formnames><em>Please supply any additional information that you feel is relevant to this order.</em></span></TD>
</TR>
<TR>
<TD align="RIGHT" VALIGN="TOP" colspan="2"><span class=formnames>Special Notes:</span></TD>
<TD align="LEFT" colspan="4"><TEXTAREA NAME="comments" ROWS=4 COLS=32></TEXTAREA></TD>
</TR>
<TR><TD colspan="6"> </TD></TR>
<!--END OF CUSTOMER PERSONAL DETAILS FORM-->
<!--SHIPPING ADDRESS DETAILS-->


<TR>
<TD align="LEFT" colspan="2"><span class=MainText><strong>Delivery Address:</strong></span></TD>

<TD align="LEFT" colspan="4"><span class=formnames><input type="checkbox" name="same_flag" value="" onClick="copyToShipping(); document.order.ship_phone.focus()">Same as above</span></TD>
</TR>

<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Recipient Name:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" name="ship_name" onChange="disableSameFlag()" SIZE="30"></TD>
</TR>
<TR><TD colspan="6"> </TD></TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Address Line1:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="ship_address1" onChange="disableSameFlag()" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Address Line2:</span></TD>

<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="ship_address2" onChange="disableSameFlag()" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Town/City:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="ship_city" onChange="disableSameFlag()" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>County:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="ship_state" onChange="disableSameFlag()" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Postcode:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="ship_zip" onChange="disableSameFlag()" SIZE="30"></TD>
</TR>

<TR>
<TD align="RIGHT" colspan="2"><span class=formnames>Country:</span></TD>
<TD align="LEFT" colspan="4"><SELECT NAME="ship_country" SIZE="1" onChange="disableSameFlag()">

<script type='text/javascript' language='javascript'>

ListCountries()

</script>
</SELECT></TD></TR>
<TR><TD colspan="6"> </TD></TR>
<TR>
<script type='text/javascript' language='javascript'>
document.write('<input type=HIDDEN name=ordered_items value='+getCookie('order')+'>');
</script>
<TD align="RIGHT" colspan="2"><span class=formnames>Daytime Tel No:</span></TD>
<TD align="LEFT" colspan="4"><INPUT TYPE="text" NAME="ship_phone" onChange="disableSameFlag()" SIZE="30"></TD>
</TR>
<TR>
<TD align="RIGHT" valign="top" colspan="5"> </TD><TD> </TD>

</TR>
<!--END OF SHIPPING ADDRESS DETAILS-->

<!--PAYMENT PAGE FRAME-->
<!--END OF PAYMENT PAGE FRAME-->

<!--CREATE ALBUM NAME TO INPUT ALBUM INFO IN ORDER DATABASE-->
<?
if (!$conn) 
{ 
  die( 'Could not connect: ' . mysql_error() ); 
   }
mysql_select_db($db, $conn); 

$result = mysql_query("SELECT * FROM album WHERE login = '$login'");

while($row = mysql_fetch_array($result)) 
{ 
$groom_firstname = $row['groom_firstname']; 
$ceremony = $row['ceremony']; 

  if ($groom_firstname == 'X') 
{  
  $albumname = "The " . $row['ceremony'] . " of " . $row['bride_firstname'];
} 
  else
{
  $albumname = "The " . $row['ceremony'] . " of " . $row['bride_firstname'] . " " . $row['bride_surname'] . " and " . $row['groom_firstname'] . " " . $row['groom_surname'];
}
}
?>
<!--END OF CREATE ALBUM NAME TO INPUT ALBUM INFO IN ORDER DATABASE-->
</TR>
<TR>
<TD align="center" COLSPAN="6"><INPUT TYPE="hidden" NAME="albumname" value="<? echo $albumname ; ?>">
<input type="Reset" value="Clear Form">    
<? //<input type="button" name="SubmitButton" value="Process Order" onClick="orderSubmit('order')"> ?>
<input type="submit" name="Submit" value="Process Order"></TD>
</TR>
</FORM>
</TABLE>
<!--END OF SHIPPING ADDRESS DETAILS-->
</TD>
</TR>
</TABLE>
</center>
</p>


<?php
} 

mysql_close($conn);
?>
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.