Photo-Graffix -> Checkout Page.

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

Post June 25th, 2007, 8:45 pm

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
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 25th, 2007, 8:45 pm

  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Joined: May 22, 2004
  • Posts: 3415
  • Loc: Richland, WA
  • Status: Offline

Post June 25th, 2007, 9:10 pm

Each time is in its own row in a way. I just seperated the name and the description.
#define NULL (::rand() % 2)
  • Brian Jester
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jan 06, 2006
  • Posts: 61
  • Loc: Bayonne, New Jersey USA
  • Status: Offline

Post June 25th, 2007, 9:59 pm

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.
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Joined: May 22, 2004
  • Posts: 3415
  • Loc: Richland, WA
  • Status: Offline

Post June 25th, 2007, 10:09 pm

Do you want the desciption to be shown in the cart? You can do what you want by editing the file I gave you.


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>&nbsp;</td>' . "\n";
 
     echo "\t" . '</tr>' . "\n";
 
     // // // // // // // // // // // // //
 
   }
 
   // DISPLAYS AFTER ORDER INFORMATION  //
 
   echo '</table>' . "\n";
 
   // // // // // // // // // // // // //
 
 
  1.  
  2. // DISPLAYS BEFORE ORDER INFORMATION //
  3.  
  4.    echo '<table  border=\'0\'>' . "\n";
  5.  
  6.    // // // // // // // // // // // // //
  7.  
  8.    
  9.  
  10.    foreach ($arrayCART as $id => $name)
  11.  
  12.    {
  13.  
  14.      // DISPLAYS INBETWEEN ITEMS BEFORE  //
  15.  
  16.    
  17.  
  18.      // // // // // // // // // // // // //
  19.  
  20.      foreach ($arrayCART[$id] as $key => $info)
  21.  
  22.      {
  23.  
  24.        //   DISPLAYS PER EACH ITEM FIELD   //
  25.  
  26.        echo "\t" . '<tr>' . "\n";
  27.  
  28.        echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
  29.  
  30.        echo "\t" . '</tr>' . "\n";
  31.  
  32.        // // // // // // // // // // // // //
  33.  
  34.    
  35.  
  36.      }
  37.  
  38.      //  DISPLAYS INBETWEEN ITEMS AFTER  //
  39.  
  40.      echo "\t" . '<tr>' . "\n";
  41.  
  42.      echo "\t\t" . '<td>&nbsp;</td>' . "\n";
  43.  
  44.      echo "\t" . '</tr>' . "\n";
  45.  
  46.      // // // // // // // // // // // // //
  47.  
  48.    }
  49.  
  50.    // DISPLAYS AFTER ORDER INFORMATION  //
  51.  
  52.    echo '</table>' . "\n";
  53.  
  54.    // // // // // // // // // // // // //
  55.  
  56.  



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>&nbsp;</td>
</tr>
<!-- repeat -->
<tr>
<td>Name2</td>
</tr>
<tr>
<td>Desciption2</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<!-- repeat -->
</table>
  1. <table border='0'>
  2. <tr>
  3. <td>Name</td>
  4. </tr>
  5. <tr>
  6. <td>Desciption</td>
  7. </tr>
  8. <tr>
  9. <td>&nbsp;</td>
  10. </tr>
  11. <!-- repeat -->
  12. <tr>
  13. <td>Name2</td>
  14. </tr>
  15. <tr>
  16. <td>Desciption2</td>
  17. </tr>
  18. <tr>
  19. <td>&nbsp;</td>
  20. </tr>
  21. <!-- repeat -->
  22. </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";
       // // // // // // // // // // // // //
   
     }
  1.      foreach ($arrayCART[$id] as $key => $info)
  2.      {
  3.        //   DISPLAYS PER EACH ITEM FIELD   //
  4.        echo "\t" . '<tr>' . "\n";
  5.        echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
  6.        echo "\t" . '</tr>' . "\n";
  7.        // // // // // // // // // // // // //
  8.    
  9.      }


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";
 
       // // // // // // // // // // // // //
   
     }
  1.      foreach ($arrayCART[$id] as $key => $info)
  2.      {
  3.        //   DISPLAYS PER EACH ITEM FIELD   //
  4.  
  5.        echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
  6.  
  7.        // // // // // // // // // // // // //
  8.    
  9.      }


That will make something like this:

Code: [ Select ]
<table border='0'>
<tr>
<td>Name</td>
<td>Desciption</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<!-- repeat -->
<tr>
<td>Name2</td>
<td>Desciption2</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<!-- repeat -->
</table>
  1. <table border='0'>
  2. <tr>
  3. <td>Name</td>
  4. <td>Desciption</td>
  5. </tr>
  6. <tr>
  7. <td>&nbsp;</td>
  8. </tr>
  9. <!-- repeat -->
  10. <tr>
  11. <td>Name2</td>
  12. <td>Desciption2</td>
  13. </tr>
  14. <tr>
  15. <td>&nbsp;</td>
  16. </tr>
  17. <!-- repeat -->
  18. </table>
#define NULL (::rand() % 2)
  • Brian Jester
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jan 06, 2006
  • Posts: 61
  • Loc: Bayonne, New Jersey USA
  • Status: Offline

Post June 26th, 2007, 4:31 am

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
  • Beginner
  • No Avatar
  • Joined: Jan 06, 2006
  • Posts: 61
  • Loc: Bayonne, New Jersey USA
  • Status: Offline

Post June 27th, 2007, 10:25 am

Any luck with getting the table code to work?
  • Brian Jester
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Jan 06, 2006
  • Posts: 61
  • Loc: Bayonne, New Jersey USA
  • Status: Offline

Post June 29th, 2007, 6:44 pm

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.

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>&nbsp;</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">&nbsp;&nbsp; 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">&nbsp;&nbsp; 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"> &nbsp;&nbsp;&nbsp;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">&nbsp;&nbsp; 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">&nbsp;&nbsp; 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">&nbsp;&nbsp; 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">&nbsp;&nbsp; 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>
&nbsp;

// Brian Modified from this point down

<div align="left">
<table border="0" width="100%">
    <tr>
        <td><font face="Verdana" size="2">&nbsp;Item Number:

&nbsp;<?php $name = strip_tags($_GET['photoname']); ?><?php echo $name

?>
        </font> </td>
        <td><font face="Verdana" size="2">&nbsp; Description:

&nbsp;<?php $desc = strip_tags($_GET['description']); ?><?php echo

$desc ?></font></td>
        <td><font face="Verdana" size="2">&nbsp; Quantity:

</font> <input type="text" name="quantity" size="4">
        </td>
    </tr>
</table>
</div>
  1. <?php
  2. /**
  3. * @author Travis Person
  4. * @copyright 2007
  5. * Developed with PHP Designer 2007 
  6. *        http://mpsoftware.de
  7. *
  8. */
  9.     // Start a session.
  10.     session_start();
  11.     // Grab information from URL.
  12.     $name = strip_tags($_GET['photoname']); 
  13.     $desc = strip_tags($_GET['description']);
  14.     // If this is the first time viewing page make the 
  15. cart session var an array.
  16.     if (!$_SESSION['cart'])
  17.     {
  18.      $_SESSION['cart'] = array();
  19.     }
  20.     
  21.     // Add items to the item array.
  22.     $arrayITEM['NAME'] = $name;
  23.     $arrayITEM['DESC'] = $desc;
  24.     // Transfer array.
  25.     $arrayCART = $_SESSION['cart'];
  26.     
  27.             
  28.     // If they have submited a form they arnt going to need to add
  29. another item so we wont.
  30.     if (!$_POST['submit'])
  31.     {
  32.      // Put informtion into the cart.
  33.      array_push($arrayCART, $arrayITEM);
  34.     
  35.     
  36.      // Store the cart back in the session.
  37.      $_SESSION['cart'] = $arrayCART;
  38.     }
  39.     
  40.     // DISPLAYS BEFORE ORDER INFORMATION //
  41.     echo '<table border=\'0\'>' . "\n";
  42.     // // // // // // // // // // // // //
  43.     
  44.     foreach ($arrayCART as $id => $name)
  45.     {
  46.      // DISPLAYS INBETWEEN ITEMS BEFORE //
  47.     
  48.      // // // // // // // // // // // // //
  49.      foreach ($arrayCART[$id] as $key => $info)
  50.      {
  51.       //  DISPLAYS PER EACH ITEM FIELD  //
  52.       echo "\t" . '<tr>' . "\n";
  53.       echo "\t\t" . '<td>' . $key . ':' . $info . '</td>' . "\n";
  54.       echo "\t" . '</tr>' . "\n";
  55.       // // // // // // // // // // // // //
  56.     
  57.      }
  58.      // DISPLAYS INBETWEEN ITEMS AFTER //
  59.      echo "\t" . '<tr>' . "\n";
  60.      echo "\t\t" . '<td>&nbsp;</td>' . "\n";
  61.      echo "\t" . '</tr>' . "\n";
  62.      // // // // // // // // // // // // //
  63.     }
  64.     // DISPLAYS AFTER ORDER INFORMATION //
  65.     echo '</table>' . "\n";
  66.     // // // // // // // // // // // // //
  67.     
  68.     echo '<br>' . "\n";
  69.     echo '<br>' . "\n";
  70.     echo '<br>' . "\n";
  71.     
  72.     // If the form is submited we want to display the information
  73. they entered.
  74.     if ($_POST['submit'])
  75.     {
  76.     
  77.      // Process submition.
  78.      $f_name = $_POST['f_name'];
  79.      $f_addr = $_POST['f_addr'];
  80.      $f_city = $_POST['f_city'];
  81.      $f_state = $_POST['f_state'];
  82.      $f_zipcode = $_POST['f_zipcode'];
  83.      $f_phone = $_POST['f_phone'];
  84.      $f_email = $_POST['f_email'];
  85.     
  86.      // Put submited information into a varible to display (You
  87. dont really need to store if but its standard for me).
  88.      $message .= 'Name:' . $f_name . "<br>\n";
  89.      $message .= 'Address:' . $f_addr . "<br>\n";
  90.      $message .= 'City:' . $f_city . "<br>\n";
  91.      $message .= 'State:' . $f_state . "<br>\n";
  92.      $message .= 'Zip:' . $f_zipcode . "<br>\n";
  93.      $message .= 'Phone:' . $f_phone . "<br>\n";
  94.      $message .= 'Email:' . $f_email . "<br>\n";
  95.     
  96.      // Display the message.
  97.      echo $message;
  98.     
  99.     }
  100.     else
  101.     {
  102.      // If they have not submited there order then we want to give
  103. them the option too.
  104.     
  105.     
  106.      // THIS IS JUST A BUNCH OF HTML CODE DISPLAYED LINE BY LINE
  107. //
  108.      // THIS IS JUST A BUNCH OF HTML CODE DISPLAYED LINE BY LINE
  109. //
  110.      // THIS IS JUST A BUNCH OF HTML CODE DISPLAYED LINE BY LINE
  111. //
  112.     
  113.      // There is nothing really crazy about this code below, just
  114. standard html.
  115.      echo '     <h2>Continue Checkout</h2>' . "\n";
  116.      echo '     <table border="0" cellpadding="3"
  117. cellspacing="0" width="500" bgcolor="#EEEFEE" style="border: D6DFE8
  118. solid 1px">' . "\n";
  119.      echo '      <tr valign="top">' . "\n";
  120.      echo '       <td></td><td><div class="noprint"><p
  121. align="left"><font face="Verdana" size="2" color="FF0000"><b>Info
  122. Text</b></font></div></td>' . "\n";
  123.      echo '      </tr>' . "\n";
  124.      echo '            <form method="post"
  125. name="myform">' . "\n";
  126.      echo '            <tr>' . "\n";
  127.      echo '       <td width="100" height="31"><font
  128. face="Verdana" size="2">&nbsp;&nbsp; Name:</font></td>' . "\n";
  129.      echo '       <td width="251" height="31"><font
  130. face="Verdana" size="2">' . "\n";
  131.      echo '        <input maxlength=40 size=40
  132. name="f_name" tabindex="1" value="">' . "\n";
  133.      echo '       </font></td>' . "\n";
  134.      echo '      </tr>' . "\n";
  135.      echo '      <tr>' . "\n";
  136.      echo '       <td width="100" height="31"><font
  137. face="Verdana" size="2">&nbsp;&nbsp; Address:</font></td>' . "\n";
  138.      echo '       <td width="251" height="31"><font
  139. face="Verdana" size="2">' . "\n";
  140.      echo '             <input maxlength=40 size=40
  141. name="f_addr" tabindex="2"> ' . "\n";
  142.      echo '             </font></td>' . "\n";
  143.      echo '      </tr>' . "\n";
  144.      echo '      <tr>' . "\n";
  145.      echo '       <td width="100" height="31"><font
  146. face="Verdana" size="2"> &nbsp;&nbsp;&nbsp;City:</font></td>' . "\n";
  147.      echo '       <td width="251" height="31"><font
  148. face="Verdana" size="2">' . "\n";
  149.      echo '        <input maxlength=20 size=20
  150. name="f_city" tabindex="3"></font></td>' . "\n";
  151.      echo '      </tr>' . "\n";
  152.      echo '      <tr>' . "\n";
  153.      echo '       <td width="100" height="31"><font
  154. face="Verdana" size="2">&nbsp;&nbsp; State:</font></td>' . "\n";
  155.      echo '       <td width="251" height="31"><font
  156. face="Verdana" size="2">' . "\n";
  157.      echo '             <select name="f_state"
  158. tabindex="4">' . "\n";
  159.      echo '                 <option
  160. value="0">State...</option>' . "\n";
  161.      echo '                 <option
  162. value="Na">Other / Not USA</option>' . "\n";
  163.      echo '                 <option value="AL"
  164. >Alabama</option>' . "\n";
  165.      echo '                 <option value="AK"
  166. >Alaska</option>' . "\n";
  167.      echo '                 <option value="AZ"
  168. >Arizona</option>' . "\n";
  169.      echo '                 <option value="AR"
  170. >Arkansas</option>' . "\n";
  171.      echo '                 <option value="CA"
  172. >California</option>' . "\n";
  173.      echo '                 <option value="CO"
  174. >Colorado</option>' . "\n";
  175.      echo '                 <option value="CT"
  176. >Connecticut</option>' . "\n";
  177.      echo '                 <option value="DE"
  178. >Delaware</option>' . "\n";
  179.      echo '                 <option value="DC"
  180. >District of Columbia</option>' . "\n";
  181.      echo '                 <option value="FL"
  182. >Florida</option>' . "\n";
  183.      echo '                 <option value="GA"
  184. >Georgia</option>' . "\n";
  185.      echo '                 <option value="HI"
  186. >Hawaii</option>' . "\n";
  187.      echo '                 <option value="ID"
  188. >Idaho</option>' . "\n";
  189.      echo '                 <option value="IL"
  190. >Illinois</option>' . "\n";
  191.      echo '                 <option value="IN"
  192. >Indiana</option>' . "\n";
  193.      echo '                 <option value="IO"
  194. >Iowa</option>' . "\n";
  195.      echo '                 <option value="KS"
  196. >Kansas</option>' . "\n";
  197.      echo '                 <option value="KY"
  198. >Kentucky</option>' . "\n";
  199.      echo '                 <option value="LA"
  200. >Louisiana</option>' . "\n";
  201.      echo '                 <option value="ME"
  202. >Maine</option>' . "\n";
  203.      echo '                 <option value="MD"
  204. >Maryland</option>' . "\n";
  205.      echo '                 <option value="MA"
  206. >Massachusetts</option>' . "\n";
  207.      echo '                 <option value="MI"
  208. >Michigan</option>' . "\n";
  209.      echo '                 <option value="MN"
  210. >Minnesota</option>' . "\n";
  211.      echo '                 <option value="MS"
  212. >Mississippi</option>' . "\n";
  213.      echo '                 <option value="MO"
  214. >Missouri</option>' . "\n";
  215.      echo '                 <option value="MT"
  216. >Montana</option>' . "\n";
  217.      echo '                 <option value="NE"
  218. >Nebraska</option>' . "\n";
  219.      echo '                 <option value="NV"
  220. >Nevada</option>' . "\n";
  221.      echo '                 <option value="NH"
  222. >New Hampshire</option>' . "\n";
  223.      echo '                 <option value="NJ"
  224. >New Jersey</option>' . "\n";
  225.      echo '                 <option value="NM"
  226. >New Mexico</option>' . "\n";
  227.      echo '                 <option value="NY"
  228. >New York</option>' . "\n";
  229.      echo '                 <option value="NC"
  230. >North Carolina</option>' . "\n";
  231.      echo '                 <option value="ND"
  232. >North Dakota</option>' . "\n";
  233.      echo '                 <option value="OH"
  234. >Ohio</option>' . "\n";
  235.      echo '                 <option value="OK"
  236. >Oklahoma</option>' . "\n";
  237.      echo '                 <option value="OR"
  238. >Oregon</option>' . "\n";
  239.      echo '                 <option value="PA"
  240. >Pennsylvania</option>' . "\n";
  241.      echo '                 <option value="RI"
  242. >Rhode Island</option>' . "\n";
  243.      echo '                 <option value="SC"
  244. >South Carolina</option>' . "\n";
  245.      echo '                 <option value="SD"
  246. >South Dakota</option>' . "\n";
  247.      echo '                 <option value="TN"
  248. >Tennessee</option>' . "\n";
  249.      echo '                 <option value="TX"
  250. >Texas</option>' . "\n";
  251.      echo '                 <option value="UT"
  252. >Utah</option>' . "\n";
  253.      echo '                 <option value="VT"
  254. >Vermont</option>' . "\n";
  255.      echo '                 <option value="VA"
  256. >Virginia</option>' . "\n";
  257.      echo '                 <option value="WA"
  258. >Washington</option>' . "\n";
  259.      echo '                 <option value="WV"
  260. >West Virginia</option>' . "\n";
  261.      echo '                 <option value="WI"
  262. >Wisconsin</option>' . "\n";
  263.      echo '                 <option value="WY"
  264. >Wyoming</option>' . "\n";
  265.      echo '                </select></font></td>'
  266. . "\n";
  267.      echo '      </tr>' . "\n";
  268.      echo '      <tr>' . "\n";
  269.      echo '       <td width="100" height="31"><font
  270. face="Verdana" size="2">&nbsp;&nbsp; Zip:</font></td>' . "\n";
  271.      echo '       <td width="251" height="31"><font
  272. face="Verdana" size="2">' . "\n";
  273.      echo '        <input maxlength=10 size=10
  274. name="f_zipcode" tabindex="5">' . "\n";
  275.      echo '       </font></td>' . "\n";
  276.      echo '      </tr>' . "\n";
  277.      echo '             <tr>' . "\n";
  278.      echo '        <td width="100" height="31"><font
  279. face="Verdana" size="2">&nbsp;&nbsp; Phone#:</font></td>' . "\n";
  280.      echo '       <td width="243" height="31"><font
  281. face="Verdana" size="2">' . "\n";
  282.      echo '        <input maxlength=16 size=16
  283. name="f_phone" tabindex="7">' . "\n";
  284.      echo '       </font></td>' . "\n";
  285.      echo '      </tr>' . "\n";
  286.      echo '      <tr>' . "\n";
  287.      echo '       <td width="100" height="31"><font
  288. face="Verdana" size="2">&nbsp;&nbsp; E-mail:</font></td>' . "\n";
  289.      echo '       <td width="253" height="31"><font
  290. face="Verdana" size="2">' . "\n";
  291.      echo '        <input maxlength=40 size=40
  292. name="f_email" tabindex="8" value="">' . "\n";
  293.      echo '       </font></td>' . "\n";
  294.      echo '      </tr>' . "\n";
  295.      echo '      <tr>' . "\n";
  296.      echo '       <td colspan="2" width="520"><div
  297. class="noprint"><p align="center"><font face="Verdana" size="2">' .
  298. "\n";
  299.      echo '         <input type=submit value="Click Here
  300. to Submit" name=submit tabindex="9">' . "\n";
  301.      echo '       </font></p></div></td>' . "\n";
  302.      echo '      </tr>' . "\n";
  303.      echo '            </form>' . "\n";
  304.      echo '     </table>' . "\n";
  305.     }
  306. ?>
  307. <br>
  308. &nbsp;
  309. // Brian Modified from this point down
  310. <div align="left">
  311. <table border="0" width="100%">
  312.     <tr>
  313.         <td><font face="Verdana" size="2">&nbsp;Item Number:
  314. &nbsp;<?php $name = strip_tags($_GET['photoname']); ?><?php echo $name
  315. ?>
  316.         </font> </td>
  317.         <td><font face="Verdana" size="2">&nbsp; Description:
  318. &nbsp;<?php $desc = strip_tags($_GET['description']); ?><?php echo
  319. $desc ?></font></td>
  320.         <td><font face="Verdana" size="2">&nbsp; Quantity:
  321. </font> <input type="text" name="quantity" size="4">
  322.         </td>
  323.     </tr>
  324. </table>
  325. </div>


Also, I changed this part:

Code: [ Select ]
$name = strip_tags($_GET['photoname']); 
$desc = strip_tags($_GET['description']);
  1. $name = strip_tags($_GET['photoname']); 
  2. $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
  • Beginner
  • No Avatar
  • Joined: Jan 06, 2006
  • Posts: 61
  • Loc: Bayonne, New Jersey USA
  • Status: Offline

Post July 3rd, 2007, 8:41 am

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.

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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.