Photo-Graffix -> Checkout Page.
- Brian Jester
- Beginner


- Joined: Jan 06, 2006
- Posts: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
Another quick question...Would it be possible to put each item that was clicked on from the gallery into a seperate row in a table? Ex: How a shopping cart usually does. Meaning for every item the person wanted to purchase, that item would get put into a table row, like a shopping cart. And add a 'quantity' text box to that table for each item so they could specify a quantity for how many of that item they wish to order.
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
June 25th, 2007, 8:45 pm
- SpooF
- ٩๏̯͡๏۶


- Joined: May 22, 2004
- Posts: 3415
- Loc: Richland, WA
- Status: Offline
- Brian Jester
- Beginner


- Joined: Jan 06, 2006
- Posts: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
Actually, what I mean is this, let's say I click on an item from the gallery, and then I wanted that item to show up in a table like this:
<div align="center">
<table border="0">
<tr>
<td>Item:</td>
<td>echo $name = $_GET['photoname'];</td>
</tr>
</table>
</div>
That would put one item in, but how about if I go to add another item, and I wanted that product to go in a new row in that table? How can that be accomplished? I just wanted to make it so that if I add more than one product (each being a different item) they would line up in rows in a table, but if they are the same item, they could just adjust the quantity by a text box and putting a number to change the quantity.
<div align="center">
<table border="0">
<tr>
<td>Item:</td>
<td>echo $name = $_GET['photoname'];</td>
</tr>
</table>
</div>
That would put one item in, but how about if I go to add another item, and I wanted that product to go in a new row in that table? How can that be accomplished? I just wanted to make it so that if I add more than one product (each being a different item) they would line up in rows in a table, but if they are the same item, they could just adjust the quantity by a text box and putting a number to change the quantity.
- SpooF
- ٩๏̯͡๏۶


- Joined: May 22, 2004
- Posts: 3415
- Loc: Richland, WA
- Status: Offline
Do you want the desciption to be shown in the cart? You can do what you want by editing the file I gave you.
// DISPLAYS BEFORE ORDER INFORMATION //
echo '<table border=\'0\'>' . "\n";
// // // // // // // // // // // // //
foreach ($arrayCART as $id => $name)
{
// DISPLAYS INBETWEEN ITEMS BEFORE //
// // // // // // // // // // // // //
foreach ($arrayCART[$id] as $key => $info)
{
// DISPLAYS PER EACH ITEM FIELD //
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
echo "\t" . '</tr>' . "\n";
// // // // // // // // // // // // //
}
// DISPLAYS INBETWEEN ITEMS AFTER //
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td> </td>' . "\n";
echo "\t" . '</tr>' . "\n";
// // // // // // // // // // // // //
}
// DISPLAYS AFTER ORDER INFORMATION //
echo '</table>' . "\n";
// // // // // // // // // // // // //
The code above will produce something like this:
If you want the name and the description to be in the same row you can remove the <tr> tags here:
Make it something like this:
That will make something like this:
PHP Code: [ Select ]
// DISPLAYS BEFORE ORDER INFORMATION //
echo '<table border=\'0\'>' . "\n";
// // // // // // // // // // // // //
foreach ($arrayCART as $id => $name)
{
// DISPLAYS INBETWEEN ITEMS BEFORE //
// // // // // // // // // // // // //
foreach ($arrayCART[$id] as $key => $info)
{
// DISPLAYS PER EACH ITEM FIELD //
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
echo "\t" . '</tr>' . "\n";
// // // // // // // // // // // // //
}
// DISPLAYS INBETWEEN ITEMS AFTER //
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td> </td>' . "\n";
echo "\t" . '</tr>' . "\n";
// // // // // // // // // // // // //
}
// DISPLAYS AFTER ORDER INFORMATION //
echo '</table>' . "\n";
// // // // // // // // // // // // //
- // DISPLAYS BEFORE ORDER INFORMATION //
- echo '<table border=\'0\'>' . "\n";
- // // // // // // // // // // // // //
- foreach ($arrayCART as $id => $name)
- {
- // DISPLAYS INBETWEEN ITEMS BEFORE //
- // // // // // // // // // // // // //
- foreach ($arrayCART[$id] as $key => $info)
- {
- // DISPLAYS PER EACH ITEM FIELD //
- echo "\t" . '<tr>' . "\n";
- echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
- echo "\t" . '</tr>' . "\n";
- // // // // // // // // // // // // //
- }
- // DISPLAYS INBETWEEN ITEMS AFTER //
- echo "\t" . '<tr>' . "\n";
- echo "\t\t" . '<td> </td>' . "\n";
- echo "\t" . '</tr>' . "\n";
- // // // // // // // // // // // // //
- }
- // DISPLAYS AFTER ORDER INFORMATION //
- echo '</table>' . "\n";
- // // // // // // // // // // // // //
The code above will produce something like this:
Code: [ Select ]
<table border='0'>
<tr>
<td>Name</td>
</tr>
<tr>
<td>Desciption</td>
</tr>
<tr>
<td> </td>
</tr>
<!-- repeat -->
<tr>
<td>Name2</td>
</tr>
<tr>
<td>Desciption2</td>
</tr>
<tr>
<td> </td>
</tr>
<!-- repeat -->
</table>
<tr>
<td>Name</td>
</tr>
<tr>
<td>Desciption</td>
</tr>
<tr>
<td> </td>
</tr>
<!-- repeat -->
<tr>
<td>Name2</td>
</tr>
<tr>
<td>Desciption2</td>
</tr>
<tr>
<td> </td>
</tr>
<!-- repeat -->
</table>
- <table border='0'>
- <tr>
- <td>Name</td>
- </tr>
- <tr>
- <td>Desciption</td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- <!-- repeat -->
- <tr>
- <td>Name2</td>
- </tr>
- <tr>
- <td>Desciption2</td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- <!-- repeat -->
- </table>
If you want the name and the description to be in the same row you can remove the <tr> tags here:
PHP Code: [ Select ]
foreach ($arrayCART[$id] as $key => $info)
{
// DISPLAYS PER EACH ITEM FIELD //
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
echo "\t" . '</tr>' . "\n";
// // // // // // // // // // // // //
}
{
// DISPLAYS PER EACH ITEM FIELD //
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
echo "\t" . '</tr>' . "\n";
// // // // // // // // // // // // //
}
- foreach ($arrayCART[$id] as $key => $info)
- {
- // DISPLAYS PER EACH ITEM FIELD //
- echo "\t" . '<tr>' . "\n";
- echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
- echo "\t" . '</tr>' . "\n";
- // // // // // // // // // // // // //
- }
Make it something like this:
PHP Code: [ Select ]
foreach ($arrayCART[$id] as $key => $info)
{
// DISPLAYS PER EACH ITEM FIELD //
echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
// // // // // // // // // // // // //
}
{
// DISPLAYS PER EACH ITEM FIELD //
echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
// // // // // // // // // // // // //
}
- foreach ($arrayCART[$id] as $key => $info)
- {
- // DISPLAYS PER EACH ITEM FIELD //
- echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
- // // // // // // // // // // // // //
- }
That will make something like this:
Code: [ Select ]
<table border='0'>
<tr>
<td>Name</td>
<td>Desciption</td>
</tr>
<tr>
<td> </td>
</tr>
<!-- repeat -->
<tr>
<td>Name2</td>
<td>Desciption2</td>
</tr>
<tr>
<td> </td>
</tr>
<!-- repeat -->
</table>
<tr>
<td>Name</td>
<td>Desciption</td>
</tr>
<tr>
<td> </td>
</tr>
<!-- repeat -->
<tr>
<td>Name2</td>
<td>Desciption2</td>
</tr>
<tr>
<td> </td>
</tr>
<!-- repeat -->
</table>
- <table border='0'>
- <tr>
- <td>Name</td>
- <td>Desciption</td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- <!-- repeat -->
- <tr>
- <td>Name2</td>
- <td>Desciption2</td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- <!-- repeat -->
- </table>
#define NULL (::rand() % 2)
- Brian Jester
- Beginner


- Joined: Jan 06, 2006
- Posts: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
I got errors with both of those bits of code. I tried putting them above the actual checkout code, then tried putting it under the checkout code, still got errors. When I put the table code above the checkout code, I got a session error, and when I put it below, I got a parse error. :S
- Brian Jester
- Beginner


- Joined: Jan 06, 2006
- Posts: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
- Brian Jester
- Beginner


- Joined: Jan 06, 2006
- Posts: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
Hi SpooF,
I tried getting the code to work from where we last left off, and wasn't able to get past the problem with getting the items that were clicked on to show in the printable page. Here's the code again, I have modified it only in the very bottom where the <div tag is right above the <table tag.
Also, I changed this part:
I added the strip_tags part in front of the ($GET statement. I was told by a member of another forum to add that. But they haven't replied since.
Like I say, the end result would be to display what has been clicked in the gallery to be displayed on the checkout page like a shopping cart in the sense that when you get to the checkout.php page, you can hit back and the page contents would remain, and new contents would be added when more items were clicked on.
I really appreciate your help in advance.
I tried getting the code to work from where we last left off, and wasn't able to get past the problem with getting the items that were clicked on to show in the printable page. Here's the code again, I have modified it only in the very bottom where the <div tag is right above the <table tag.
Code: [ Select ]
<?php
/**
* @author Travis Person
* @copyright 2007
*
* Developed with PHP Designer 2007
* http://mpsoftware.de
*
*/
// Start a session.
session_start();
// Grab information from URL.
$name = strip_tags($_GET['photoname']);
$desc = strip_tags($_GET['description']);
// If this is the first time viewing page make the
cart session var an array.
if (!$_SESSION['cart'])
{
$_SESSION['cart'] = array();
}
// Add items to the item array.
$arrayITEM['NAME'] = $name;
$arrayITEM['DESC'] = $desc;
// Transfer array.
$arrayCART = $_SESSION['cart'];
// If they have submited a form they arnt going to need to add
another item so we wont.
if (!$_POST['submit'])
{
// Put informtion into the cart.
array_push($arrayCART, $arrayITEM);
// Store the cart back in the session.
$_SESSION['cart'] = $arrayCART;
}
// DISPLAYS BEFORE ORDER INFORMATION //
echo '<table border=\'0\'>' . "\n";
// // // // // // // // // // // // //
foreach ($arrayCART as $id => $name)
{
// DISPLAYS INBETWEEN ITEMS BEFORE //
// // // // // // // // // // // // //
foreach ($arrayCART[$id] as $key => $info)
{
// DISPLAYS PER EACH ITEM FIELD //
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
echo "\t" . '</tr>' . "\n";
// // // // // // // // // // // // //
}
// DISPLAYS INBETWEEN ITEMS AFTER //
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td> </td>' . "\n";
echo "\t" . '</tr>' . "\n";
// // // // // // // // // // // // //
}
// DISPLAYS AFTER ORDER INFORMATION //
echo '</table>' . "\n";
// // // // // // // // // // // // //
echo '<br>' . "\n";
echo '<br>' . "\n";
echo '<br>' . "\n";
// If the form is submited we want to display the information
they entered.
if ($_POST['submit'])
{
// Process submition.
$f_name = $_POST['f_name'];
$f_addr = $_POST['f_addr'];
$f_city = $_POST['f_city'];
$f_state = $_POST['f_state'];
$f_zipcode = $_POST['f_zipcode'];
$f_phone = $_POST['f_phone'];
$f_email = $_POST['f_email'];
// Put submited information into a varible to display (You
dont really need to store if but its standard for me).
$message .= 'Name:' . $f_name . "<br>\n";
$message .= 'Address:' . $f_addr . "<br>\n";
$message .= 'City:' . $f_city . "<br>\n";
$message .= 'State:' . $f_state . "<br>\n";
$message .= 'Zip:' . $f_zipcode . "<br>\n";
$message .= 'Phone:' . $f_phone . "<br>\n";
$message .= 'Email:' . $f_email . "<br>\n";
// Display the message.
echo $message;
}
else
{
// If they have not submited there order then we want to give
them the option too.
// THIS IS JUST A BUNCH OF HTML CODE DISPLAYED LINE BY LINE
//
// THIS IS JUST A BUNCH OF HTML CODE DISPLAYED LINE BY LINE
//
// THIS IS JUST A BUNCH OF HTML CODE DISPLAYED LINE BY LINE
//
// There is nothing really crazy about this code below, just
standard html.
echo ' <h2>Continue Checkout</h2>' . "\n";
echo ' <table border="0" cellpadding="3"
cellspacing="0" width="500" bgcolor="#EEEFEE" style="border: D6DFE8
solid 1px">' . "\n";
echo ' <tr valign="top">' . "\n";
echo ' <td></td><td><div class="noprint"><p
align="left"><font face="Verdana" size="2" color="FF0000"><b>Info
Text</b></font></div></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <form method="post"
name="myform">' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> Name:</font></td>' . "\n";
echo ' <td width="251" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <input maxlength=40 size=40
name="f_name" tabindex="1" value="">' . "\n";
echo ' </font></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> Address:</font></td>' . "\n";
echo ' <td width="251" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <input maxlength=40 size=40
name="f_addr" tabindex="2"> ' . "\n";
echo ' </font></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> City:</font></td>' . "\n";
echo ' <td width="251" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <input maxlength=20 size=20
name="f_city" tabindex="3"></font></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> State:</font></td>' . "\n";
echo ' <td width="251" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <select name="f_state"
tabindex="4">' . "\n";
echo ' <option
value="0">State...</option>' . "\n";
echo ' <option
value="Na">Other / Not USA</option>' . "\n";
echo ' <option value="AL"
>Alabama</option>' . "\n";
echo ' <option value="AK"
>Alaska</option>' . "\n";
echo ' <option value="AZ"
>Arizona</option>' . "\n";
echo ' <option value="AR"
>Arkansas</option>' . "\n";
echo ' <option value="CA"
>California</option>' . "\n";
echo ' <option value="CO"
>Colorado</option>' . "\n";
echo ' <option value="CT"
>Connecticut</option>' . "\n";
echo ' <option value="DE"
>Delaware</option>' . "\n";
echo ' <option value="DC"
>District of Columbia</option>' . "\n";
echo ' <option value="FL"
>Florida</option>' . "\n";
echo ' <option value="GA"
>Georgia</option>' . "\n";
echo ' <option value="HI"
>Hawaii</option>' . "\n";
echo ' <option value="ID"
>Idaho</option>' . "\n";
echo ' <option value="IL"
>Illinois</option>' . "\n";
echo ' <option value="IN"
>Indiana</option>' . "\n";
echo ' <option value="IO"
>Iowa</option>' . "\n";
echo ' <option value="KS"
>Kansas</option>' . "\n";
echo ' <option value="KY"
>Kentucky</option>' . "\n";
echo ' <option value="LA"
>Louisiana</option>' . "\n";
echo ' <option value="ME"
>Maine</option>' . "\n";
echo ' <option value="MD"
>Maryland</option>' . "\n";
echo ' <option value="MA"
>Massachusetts</option>' . "\n";
echo ' <option value="MI"
>Michigan</option>' . "\n";
echo ' <option value="MN"
>Minnesota</option>' . "\n";
echo ' <option value="MS"
>Mississippi</option>' . "\n";
echo ' <option value="MO"
>Missouri</option>' . "\n";
echo ' <option value="MT"
>Montana</option>' . "\n";
echo ' <option value="NE"
>Nebraska</option>' . "\n";
echo ' <option value="NV"
>Nevada</option>' . "\n";
echo ' <option value="NH"
>New Hampshire</option>' . "\n";
echo ' <option value="NJ"
>New Jersey</option>' . "\n";
echo ' <option value="NM"
>New Mexico</option>' . "\n";
echo ' <option value="NY"
>New York</option>' . "\n";
echo ' <option value="NC"
>North Carolina</option>' . "\n";
echo ' <option value="ND"
>North Dakota</option>' . "\n";
echo ' <option value="OH"
>Ohio</option>' . "\n";
echo ' <option value="OK"
>Oklahoma</option>' . "\n";
echo ' <option value="OR"
>Oregon</option>' . "\n";
echo ' <option value="PA"
>Pennsylvania</option>' . "\n";
echo ' <option value="RI"
>Rhode Island</option>' . "\n";
echo ' <option value="SC"
>South Carolina</option>' . "\n";
echo ' <option value="SD"
>South Dakota</option>' . "\n";
echo ' <option value="TN"
>Tennessee</option>' . "\n";
echo ' <option value="TX"
>Texas</option>' . "\n";
echo ' <option value="UT"
>Utah</option>' . "\n";
echo ' <option value="VT"
>Vermont</option>' . "\n";
echo ' <option value="VA"
>Virginia</option>' . "\n";
echo ' <option value="WA"
>Washington</option>' . "\n";
echo ' <option value="WV"
>West Virginia</option>' . "\n";
echo ' <option value="WI"
>Wisconsin</option>' . "\n";
echo ' <option value="WY"
>Wyoming</option>' . "\n";
echo ' </select></font></td>'
. "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> Zip:</font></td>' . "\n";
echo ' <td width="251" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <input maxlength=10 size=10
name="f_zipcode" tabindex="5">' . "\n";
echo ' </font></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> Phone#:</font></td>' . "\n";
echo ' <td width="243" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <input maxlength=16 size=16
name="f_phone" tabindex="7">' . "\n";
echo ' </font></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> E-mail:</font></td>' . "\n";
echo ' <td width="253" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <input maxlength=40 size=40
name="f_email" tabindex="8" value="">' . "\n";
echo ' </font></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td colspan="2" width="520"><div
class="noprint"><p align="center"><font face="Verdana" size="2">' .
"\n";
echo ' <input type=submit value="Click Here
to Submit" name=submit tabindex="9">' . "\n";
echo ' </font></p></div></td>' . "\n";
echo ' </tr>' . "\n";
echo ' </form>' . "\n";
echo ' </table>' . "\n";
}
?>
<br>
// Brian Modified from this point down
<div align="left">
<table border="0" width="100%">
<tr>
<td><font face="Verdana" size="2"> Item Number:
<?php $name = strip_tags($_GET['photoname']); ?><?php echo $name
?>
</font> </td>
<td><font face="Verdana" size="2"> Description:
<?php $desc = strip_tags($_GET['description']); ?><?php echo
$desc ?></font></td>
<td><font face="Verdana" size="2"> Quantity:
</font> <input type="text" name="quantity" size="4">
</td>
</tr>
</table>
</div>
/**
* @author Travis Person
* @copyright 2007
*
* Developed with PHP Designer 2007
* http://mpsoftware.de
*
*/
// Start a session.
session_start();
// Grab information from URL.
$name = strip_tags($_GET['photoname']);
$desc = strip_tags($_GET['description']);
// If this is the first time viewing page make the
cart session var an array.
if (!$_SESSION['cart'])
{
$_SESSION['cart'] = array();
}
// Add items to the item array.
$arrayITEM['NAME'] = $name;
$arrayITEM['DESC'] = $desc;
// Transfer array.
$arrayCART = $_SESSION['cart'];
// If they have submited a form they arnt going to need to add
another item so we wont.
if (!$_POST['submit'])
{
// Put informtion into the cart.
array_push($arrayCART, $arrayITEM);
// Store the cart back in the session.
$_SESSION['cart'] = $arrayCART;
}
// DISPLAYS BEFORE ORDER INFORMATION //
echo '<table border=\'0\'>' . "\n";
// // // // // // // // // // // // //
foreach ($arrayCART as $id => $name)
{
// DISPLAYS INBETWEEN ITEMS BEFORE //
// // // // // // // // // // // // //
foreach ($arrayCART[$id] as $key => $info)
{
// DISPLAYS PER EACH ITEM FIELD //
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
echo "\t" . '</tr>' . "\n";
// // // // // // // // // // // // //
}
// DISPLAYS INBETWEEN ITEMS AFTER //
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td> </td>' . "\n";
echo "\t" . '</tr>' . "\n";
// // // // // // // // // // // // //
}
// DISPLAYS AFTER ORDER INFORMATION //
echo '</table>' . "\n";
// // // // // // // // // // // // //
echo '<br>' . "\n";
echo '<br>' . "\n";
echo '<br>' . "\n";
// If the form is submited we want to display the information
they entered.
if ($_POST['submit'])
{
// Process submition.
$f_name = $_POST['f_name'];
$f_addr = $_POST['f_addr'];
$f_city = $_POST['f_city'];
$f_state = $_POST['f_state'];
$f_zipcode = $_POST['f_zipcode'];
$f_phone = $_POST['f_phone'];
$f_email = $_POST['f_email'];
// Put submited information into a varible to display (You
dont really need to store if but its standard for me).
$message .= 'Name:' . $f_name . "<br>\n";
$message .= 'Address:' . $f_addr . "<br>\n";
$message .= 'City:' . $f_city . "<br>\n";
$message .= 'State:' . $f_state . "<br>\n";
$message .= 'Zip:' . $f_zipcode . "<br>\n";
$message .= 'Phone:' . $f_phone . "<br>\n";
$message .= 'Email:' . $f_email . "<br>\n";
// Display the message.
echo $message;
}
else
{
// If they have not submited there order then we want to give
them the option too.
// THIS IS JUST A BUNCH OF HTML CODE DISPLAYED LINE BY LINE
//
// THIS IS JUST A BUNCH OF HTML CODE DISPLAYED LINE BY LINE
//
// THIS IS JUST A BUNCH OF HTML CODE DISPLAYED LINE BY LINE
//
// There is nothing really crazy about this code below, just
standard html.
echo ' <h2>Continue Checkout</h2>' . "\n";
echo ' <table border="0" cellpadding="3"
cellspacing="0" width="500" bgcolor="#EEEFEE" style="border: D6DFE8
solid 1px">' . "\n";
echo ' <tr valign="top">' . "\n";
echo ' <td></td><td><div class="noprint"><p
align="left"><font face="Verdana" size="2" color="FF0000"><b>Info
Text</b></font></div></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <form method="post"
name="myform">' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> Name:</font></td>' . "\n";
echo ' <td width="251" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <input maxlength=40 size=40
name="f_name" tabindex="1" value="">' . "\n";
echo ' </font></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> Address:</font></td>' . "\n";
echo ' <td width="251" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <input maxlength=40 size=40
name="f_addr" tabindex="2"> ' . "\n";
echo ' </font></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> City:</font></td>' . "\n";
echo ' <td width="251" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <input maxlength=20 size=20
name="f_city" tabindex="3"></font></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> State:</font></td>' . "\n";
echo ' <td width="251" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <select name="f_state"
tabindex="4">' . "\n";
echo ' <option
value="0">State...</option>' . "\n";
echo ' <option
value="Na">Other / Not USA</option>' . "\n";
echo ' <option value="AL"
>Alabama</option>' . "\n";
echo ' <option value="AK"
>Alaska</option>' . "\n";
echo ' <option value="AZ"
>Arizona</option>' . "\n";
echo ' <option value="AR"
>Arkansas</option>' . "\n";
echo ' <option value="CA"
>California</option>' . "\n";
echo ' <option value="CO"
>Colorado</option>' . "\n";
echo ' <option value="CT"
>Connecticut</option>' . "\n";
echo ' <option value="DE"
>Delaware</option>' . "\n";
echo ' <option value="DC"
>District of Columbia</option>' . "\n";
echo ' <option value="FL"
>Florida</option>' . "\n";
echo ' <option value="GA"
>Georgia</option>' . "\n";
echo ' <option value="HI"
>Hawaii</option>' . "\n";
echo ' <option value="ID"
>Idaho</option>' . "\n";
echo ' <option value="IL"
>Illinois</option>' . "\n";
echo ' <option value="IN"
>Indiana</option>' . "\n";
echo ' <option value="IO"
>Iowa</option>' . "\n";
echo ' <option value="KS"
>Kansas</option>' . "\n";
echo ' <option value="KY"
>Kentucky</option>' . "\n";
echo ' <option value="LA"
>Louisiana</option>' . "\n";
echo ' <option value="ME"
>Maine</option>' . "\n";
echo ' <option value="MD"
>Maryland</option>' . "\n";
echo ' <option value="MA"
>Massachusetts</option>' . "\n";
echo ' <option value="MI"
>Michigan</option>' . "\n";
echo ' <option value="MN"
>Minnesota</option>' . "\n";
echo ' <option value="MS"
>Mississippi</option>' . "\n";
echo ' <option value="MO"
>Missouri</option>' . "\n";
echo ' <option value="MT"
>Montana</option>' . "\n";
echo ' <option value="NE"
>Nebraska</option>' . "\n";
echo ' <option value="NV"
>Nevada</option>' . "\n";
echo ' <option value="NH"
>New Hampshire</option>' . "\n";
echo ' <option value="NJ"
>New Jersey</option>' . "\n";
echo ' <option value="NM"
>New Mexico</option>' . "\n";
echo ' <option value="NY"
>New York</option>' . "\n";
echo ' <option value="NC"
>North Carolina</option>' . "\n";
echo ' <option value="ND"
>North Dakota</option>' . "\n";
echo ' <option value="OH"
>Ohio</option>' . "\n";
echo ' <option value="OK"
>Oklahoma</option>' . "\n";
echo ' <option value="OR"
>Oregon</option>' . "\n";
echo ' <option value="PA"
>Pennsylvania</option>' . "\n";
echo ' <option value="RI"
>Rhode Island</option>' . "\n";
echo ' <option value="SC"
>South Carolina</option>' . "\n";
echo ' <option value="SD"
>South Dakota</option>' . "\n";
echo ' <option value="TN"
>Tennessee</option>' . "\n";
echo ' <option value="TX"
>Texas</option>' . "\n";
echo ' <option value="UT"
>Utah</option>' . "\n";
echo ' <option value="VT"
>Vermont</option>' . "\n";
echo ' <option value="VA"
>Virginia</option>' . "\n";
echo ' <option value="WA"
>Washington</option>' . "\n";
echo ' <option value="WV"
>West Virginia</option>' . "\n";
echo ' <option value="WI"
>Wisconsin</option>' . "\n";
echo ' <option value="WY"
>Wyoming</option>' . "\n";
echo ' </select></font></td>'
. "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> Zip:</font></td>' . "\n";
echo ' <td width="251" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <input maxlength=10 size=10
name="f_zipcode" tabindex="5">' . "\n";
echo ' </font></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> Phone#:</font></td>' . "\n";
echo ' <td width="243" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <input maxlength=16 size=16
name="f_phone" tabindex="7">' . "\n";
echo ' </font></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td width="100" height="31"><font
face="Verdana" size="2"> E-mail:</font></td>' . "\n";
echo ' <td width="253" height="31"><font
face="Verdana" size="2">' . "\n";
echo ' <input maxlength=40 size=40
name="f_email" tabindex="8" value="">' . "\n";
echo ' </font></td>' . "\n";
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
echo ' <td colspan="2" width="520"><div
class="noprint"><p align="center"><font face="Verdana" size="2">' .
"\n";
echo ' <input type=submit value="Click Here
to Submit" name=submit tabindex="9">' . "\n";
echo ' </font></p></div></td>' . "\n";
echo ' </tr>' . "\n";
echo ' </form>' . "\n";
echo ' </table>' . "\n";
}
?>
<br>
// Brian Modified from this point down
<div align="left">
<table border="0" width="100%">
<tr>
<td><font face="Verdana" size="2"> Item Number:
<?php $name = strip_tags($_GET['photoname']); ?><?php echo $name
?>
</font> </td>
<td><font face="Verdana" size="2"> Description:
<?php $desc = strip_tags($_GET['description']); ?><?php echo
$desc ?></font></td>
<td><font face="Verdana" size="2"> Quantity:
</font> <input type="text" name="quantity" size="4">
</td>
</tr>
</table>
</div>
- <?php
- /**
- * @author Travis Person
- * @copyright 2007
- *
- * Developed with PHP Designer 2007
- * http://mpsoftware.de
- *
- */
- // Start a session.
- session_start();
- // Grab information from URL.
- $name = strip_tags($_GET['photoname']);
- $desc = strip_tags($_GET['description']);
- // If this is the first time viewing page make the
- cart session var an array.
- if (!$_SESSION['cart'])
- {
- $_SESSION['cart'] = array();
- }
- // Add items to the item array.
- $arrayITEM['NAME'] = $name;
- $arrayITEM['DESC'] = $desc;
- // Transfer array.
- $arrayCART = $_SESSION['cart'];
- // If they have submited a form they arnt going to need to add
- another item so we wont.
- if (!$_POST['submit'])
- {
- // Put informtion into the cart.
- array_push($arrayCART, $arrayITEM);
- // Store the cart back in the session.
- $_SESSION['cart'] = $arrayCART;
- }
- // DISPLAYS BEFORE ORDER INFORMATION //
- echo '<table border=\'0\'>' . "\n";
- // // // // // // // // // // // // //
- foreach ($arrayCART as $id => $name)
- {
- // DISPLAYS INBETWEEN ITEMS BEFORE //
- // // // // // // // // // // // // //
- foreach ($arrayCART[$id] as $key => $info)
- {
- // DISPLAYS PER EACH ITEM FIELD //
- echo "\t" . '<tr>' . "\n";
- echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
- echo "\t" . '</tr>' . "\n";
- // // // // // // // // // // // // //
- }
- // DISPLAYS INBETWEEN ITEMS AFTER //
- echo "\t" . '<tr>' . "\n";
- echo "\t\t" . '<td> </td>' . "\n";
- echo "\t" . '</tr>' . "\n";
- // // // // // // // // // // // // //
- }
- // DISPLAYS AFTER ORDER INFORMATION //
- echo '</table>' . "\n";
- // // // // // // // // // // // // //
- echo '<br>' . "\n";
- echo '<br>' . "\n";
- echo '<br>' . "\n";
- // If the form is submited we want to display the information
- they entered.
- if ($_POST['submit'])
- {
- // Process submition.
- $f_name = $_POST['f_name'];
- $f_addr = $_POST['f_addr'];
- $f_city = $_POST['f_city'];
- $f_state = $_POST['f_state'];
- $f_zipcode = $_POST['f_zipcode'];
- $f_phone = $_POST['f_phone'];
- $f_email = $_POST['f_email'];
- // Put submited information into a varible to display (You
- dont really need to store if but its standard for me).
- $message .= 'Name:' . $f_name . "<br>\n";
- $message .= 'Address:' . $f_addr . "<br>\n";
- $message .= 'City:' . $f_city . "<br>\n";
- $message .= 'State:' . $f_state . "<br>\n";
- $message .= 'Zip:' . $f_zipcode . "<br>\n";
- $message .= 'Phone:' . $f_phone . "<br>\n";
- $message .= 'Email:' . $f_email . "<br>\n";
- // Display the message.
- echo $message;
- }
- else
- {
- // If they have not submited there order then we want to give
- them the option too.
- // THIS IS JUST A BUNCH OF HTML CODE DISPLAYED LINE BY LINE
- //
- // THIS IS JUST A BUNCH OF HTML CODE DISPLAYED LINE BY LINE
- //
- // THIS IS JUST A BUNCH OF HTML CODE DISPLAYED LINE BY LINE
- //
- // There is nothing really crazy about this code below, just
- standard html.
- echo ' <h2>Continue Checkout</h2>' . "\n";
- echo ' <table border="0" cellpadding="3"
- cellspacing="0" width="500" bgcolor="#EEEFEE" style="border: D6DFE8
- solid 1px">' . "\n";
- echo ' <tr valign="top">' . "\n";
- echo ' <td></td><td><div class="noprint"><p
- align="left"><font face="Verdana" size="2" color="FF0000"><b>Info
- Text</b></font></div></td>' . "\n";
- echo ' </tr>' . "\n";
- echo ' <form method="post"
- name="myform">' . "\n";
- echo ' <tr>' . "\n";
- echo ' <td width="100" height="31"><font
- face="Verdana" size="2"> Name:</font></td>' . "\n";
- echo ' <td width="251" height="31"><font
- face="Verdana" size="2">' . "\n";
- echo ' <input maxlength=40 size=40
- name="f_name" tabindex="1" value="">' . "\n";
- echo ' </font></td>' . "\n";
- echo ' </tr>' . "\n";
- echo ' <tr>' . "\n";
- echo ' <td width="100" height="31"><font
- face="Verdana" size="2"> Address:</font></td>' . "\n";
- echo ' <td width="251" height="31"><font
- face="Verdana" size="2">' . "\n";
- echo ' <input maxlength=40 size=40
- name="f_addr" tabindex="2"> ' . "\n";
- echo ' </font></td>' . "\n";
- echo ' </tr>' . "\n";
- echo ' <tr>' . "\n";
- echo ' <td width="100" height="31"><font
- face="Verdana" size="2"> City:</font></td>' . "\n";
- echo ' <td width="251" height="31"><font
- face="Verdana" size="2">' . "\n";
- echo ' <input maxlength=20 size=20
- name="f_city" tabindex="3"></font></td>' . "\n";
- echo ' </tr>' . "\n";
- echo ' <tr>' . "\n";
- echo ' <td width="100" height="31"><font
- face="Verdana" size="2"> State:</font></td>' . "\n";
- echo ' <td width="251" height="31"><font
- face="Verdana" size="2">' . "\n";
- echo ' <select name="f_state"
- tabindex="4">' . "\n";
- echo ' <option
- value="0">State...</option>' . "\n";
- echo ' <option
- value="Na">Other / Not USA</option>' . "\n";
- echo ' <option value="AL"
- >Alabama</option>' . "\n";
- echo ' <option value="AK"
- >Alaska</option>' . "\n";
- echo ' <option value="AZ"
- >Arizona</option>' . "\n";
- echo ' <option value="AR"
- >Arkansas</option>' . "\n";
- echo ' <option value="CA"
- >California</option>' . "\n";
- echo ' <option value="CO"
- >Colorado</option>' . "\n";
- echo ' <option value="CT"
- >Connecticut</option>' . "\n";
- echo ' <option value="DE"
- >Delaware</option>' . "\n";
- echo ' <option value="DC"
- >District of Columbia</option>' . "\n";
- echo ' <option value="FL"
- >Florida</option>' . "\n";
- echo ' <option value="GA"
- >Georgia</option>' . "\n";
- echo ' <option value="HI"
- >Hawaii</option>' . "\n";
- echo ' <option value="ID"
- >Idaho</option>' . "\n";
- echo ' <option value="IL"
- >Illinois</option>' . "\n";
- echo ' <option value="IN"
- >Indiana</option>' . "\n";
- echo ' <option value="IO"
- >Iowa</option>' . "\n";
- echo ' <option value="KS"
- >Kansas</option>' . "\n";
- echo ' <option value="KY"
- >Kentucky</option>' . "\n";
- echo ' <option value="LA"
- >Louisiana</option>' . "\n";
- echo ' <option value="ME"
- >Maine</option>' . "\n";
- echo ' <option value="MD"
- >Maryland</option>' . "\n";
- echo ' <option value="MA"
- >Massachusetts</option>' . "\n";
- echo ' <option value="MI"
- >Michigan</option>' . "\n";
- echo ' <option value="MN"
- >Minnesota</option>' . "\n";
- echo ' <option value="MS"
- >Mississippi</option>' . "\n";
- echo ' <option value="MO"
- >Missouri</option>' . "\n";
- echo ' <option value="MT"
- >Montana</option>' . "\n";
- echo ' <option value="NE"
- >Nebraska</option>' . "\n";
- echo ' <option value="NV"
- >Nevada</option>' . "\n";
- echo ' <option value="NH"
- >New Hampshire</option>' . "\n";
- echo ' <option value="NJ"
- >New Jersey</option>' . "\n";
- echo ' <option value="NM"
- >New Mexico</option>' . "\n";
- echo ' <option value="NY"
- >New York</option>' . "\n";
- echo ' <option value="NC"
- >North Carolina</option>' . "\n";
- echo ' <option value="ND"
- >North Dakota</option>' . "\n";
- echo ' <option value="OH"
- >Ohio</option>' . "\n";
- echo ' <option value="OK"
- >Oklahoma</option>' . "\n";
- echo ' <option value="OR"
- >Oregon</option>' . "\n";
- echo ' <option value="PA"
- >Pennsylvania</option>' . "\n";
- echo ' <option value="RI"
- >Rhode Island</option>' . "\n";
- echo ' <option value="SC"
- >South Carolina</option>' . "\n";
- echo ' <option value="SD"
- >South Dakota</option>' . "\n";
- echo ' <option value="TN"
- >Tennessee</option>' . "\n";
- echo ' <option value="TX"
- >Texas</option>' . "\n";
- echo ' <option value="UT"
- >Utah</option>' . "\n";
- echo ' <option value="VT"
- >Vermont</option>' . "\n";
- echo ' <option value="VA"
- >Virginia</option>' . "\n";
- echo ' <option value="WA"
- >Washington</option>' . "\n";
- echo ' <option value="WV"
- >West Virginia</option>' . "\n";
- echo ' <option value="WI"
- >Wisconsin</option>' . "\n";
- echo ' <option value="WY"
- >Wyoming</option>' . "\n";
- echo ' </select></font></td>'
- . "\n";
- echo ' </tr>' . "\n";
- echo ' <tr>' . "\n";
- echo ' <td width="100" height="31"><font
- face="Verdana" size="2"> Zip:</font></td>' . "\n";
- echo ' <td width="251" height="31"><font
- face="Verdana" size="2">' . "\n";
- echo ' <input maxlength=10 size=10
- name="f_zipcode" tabindex="5">' . "\n";
- echo ' </font></td>' . "\n";
- echo ' </tr>' . "\n";
- echo ' <tr>' . "\n";
- echo ' <td width="100" height="31"><font
- face="Verdana" size="2"> Phone#:</font></td>' . "\n";
- echo ' <td width="243" height="31"><font
- face="Verdana" size="2">' . "\n";
- echo ' <input maxlength=16 size=16
- name="f_phone" tabindex="7">' . "\n";
- echo ' </font></td>' . "\n";
- echo ' </tr>' . "\n";
- echo ' <tr>' . "\n";
- echo ' <td width="100" height="31"><font
- face="Verdana" size="2"> E-mail:</font></td>' . "\n";
- echo ' <td width="253" height="31"><font
- face="Verdana" size="2">' . "\n";
- echo ' <input maxlength=40 size=40
- name="f_email" tabindex="8" value="">' . "\n";
- echo ' </font></td>' . "\n";
- echo ' </tr>' . "\n";
- echo ' <tr>' . "\n";
- echo ' <td colspan="2" width="520"><div
- class="noprint"><p align="center"><font face="Verdana" size="2">' .
- "\n";
- echo ' <input type=submit value="Click Here
- to Submit" name=submit tabindex="9">' . "\n";
- echo ' </font></p></div></td>' . "\n";
- echo ' </tr>' . "\n";
- echo ' </form>' . "\n";
- echo ' </table>' . "\n";
- }
- ?>
- <br>
-
- // Brian Modified from this point down
- <div align="left">
- <table border="0" width="100%">
- <tr>
- <td><font face="Verdana" size="2"> Item Number:
- <?php $name = strip_tags($_GET['photoname']); ?><?php echo $name
- ?>
- </font> </td>
- <td><font face="Verdana" size="2"> Description:
- <?php $desc = strip_tags($_GET['description']); ?><?php echo
- $desc ?></font></td>
- <td><font face="Verdana" size="2"> Quantity:
- </font> <input type="text" name="quantity" size="4">
- </td>
- </tr>
- </table>
- </div>
Also, I changed this part:
Code: [ Select ]
$name = strip_tags($_GET['photoname']);
$desc = strip_tags($_GET['description']);
$desc = strip_tags($_GET['description']);
- $name = strip_tags($_GET['photoname']);
- $desc = strip_tags($_GET['description']);
I added the strip_tags part in front of the ($GET statement. I was told by a member of another forum to add that. But they haven't replied since.
Like I say, the end result would be to display what has been clicked in the gallery to be displayed on the checkout page like a shopping cart in the sense that when you get to the checkout.php page, you can hit back and the page contents would remain, and new contents would be added when more items were clicked on.
I really appreciate your help in advance.
- Brian Jester
- Beginner


- Joined: Jan 06, 2006
- Posts: 61
- Loc: Bayonne, New Jersey USA
- Status: Offline
I appreciate anyone having some time to fix this checkout page for me. I've tried and tried, and all I wanted to do was make a checkout page for this program so I could accept mail order payments...Seems a bit too steep for me to accomplish on my own.
Thanks alot to SpooF for his help along the way with this code...And if your busy atm or just don't feel like working on it atm, (I don't blame you)...Don't worry about it, but I thought I'd post this for anyone who's wants to try it.
Thanks again SpooF.
Thanks alot to SpooF for his help along the way with this code...And if your busy atm or just don't feel like working on it atm, (I don't blame you)...Don't worry about it, but I thought I'd post this for anyone who's wants to try it.
Thanks again SpooF.
1, 2
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 23 posts
- Users browsing this forum: No registered users and 100 guests
- You cannot post new topics in this forum
- You cannot reply to topics in this forum
- You cannot edit your posts in this forum
- You cannot delete your posts in this forum
- You cannot post attachments in this forum
