Jump to content

phpretard

Members
  • Posts

    821
  • Joined

  • Last visited

    Never

Posts posted by phpretard

  1. I should be more specific...

     

    I need to pull the info from the fantastic array you just gave me.

     

    [P1040054.jpg] => Array
            (
                [picture] => ALBUMS/Holmes_Adams/P1040054.jpg <-----//////////////////////THAT
                [file] => P1040054.jpg
                [s46] => 4 x 6
                [QU46] => 30
                [s57] => 5 x 7
                [QU57] => 20
                [s810] => 8 x 10
                [QU810] => 10
                [order_photo] => Order This Photo
            )
    
    
    foreach ($_SESSION as $file => $val){
    
    echo"<img src='THAT'>";

  2. That works.

     

       
    
    [P1040054.jpg] => Array
            (
                [picture] => ALBUMS/Holmes_Adams/P1040054.jpg <-----//////////////////////THAT
                [file] => P1040054.jpg
                [s46] => 4 x 6
                [QU46] => 30
                [s57] => 5 x 7
                [QU57] => 20
                [s810] => 8 x 10
                [QU810] => 10
                [order_photo] => Order This Photo
            )
    
    

     

    What if I wanted to echo <img src='THAT'>

  3. A user goes to the site >> they see a photo they want >> they click on it >> Now they are looking at a form with the picture they chose and size options.  They select the size and quantity and submit. >>> now they are redirected to a page that display there order details.

     

     

    Not haveing left the site yet... they see another photo they like >>> they click on it >>> and it takes them to the same form with a different picture(picture# is the unique ID - I would like to name and store the session array by that number). When they submit the new picture it forwards them to the same details page and displays the content of the 2 session vars.

     

    and again and again.

     

    My problem.

     

    On the details page it displays a picture for each ITEM in the array...not each array.

     

    If I order a new photo...it replaces the old instead of showing both.

     

     

     

     

     

     

  4. I need to create a new session each time a form is submitted.

     

    Kind of a shopping cart with no database...

     

    ///////////THE EXISTING CODE
    <?php
    
    if(isset($_POST['order_photo'])){
    
      foreach($_POST as $key => $val){
       $_SESSION[$key] = $val;
      }
    }
    
    ///////////CURRENTLY OUTPUTS
    
    $_SESSION:Array
    (
        [picture] => ALBUMS/Holmes_Adams/P1040050.jpg
        [file] => P1040050.jpg
        [s46] => 4 x 6
        [QU46] => 10
        [s57] => 5 x 7
        [QU57] => 20
        [s810] => 8 x 10
        [QU810] => 30
        [order_photo] => Order This Photo
    )
    
    ?>
    
    /////////////I NEED NEW CODE TO OUTPUT THIS
    
    $_SESSION:Array1
    (
        [picture] => ALBUMS/Holmes_Adams/P1040050.jpg
        [file] => P1040050.jpg
        [s46] => 4 x 6
        [QU46] => 10
        [s57] => 5 x 7
        [QU57] => 20
        [s810] => 8 x 10
        [QU810] => 30
        [order_photo] => Order This Photo
    )
    
    $_SESSION:Array2
    (
        [picture] => ALBUMS/Holmes_Adams/DIFFERENT NUMBER.jpg
        [file] => DIFFERENT NUMBER.jpg
        [s46] => 4 x 6
        [QU46] => DIFFERENT QUANTITY
        [s57] => 5 x 7
        [QU57] => DIFFERENT QUANTITY
        [s810] => 8 x 10
        [QU810] => DIFFERENT QUANTITY
        [order_photo] => Order This Photo
    )
    
    and so on....

     

    All this comes from the same form with different values.

  5. Here is what I have now:

     

    <?
    echo"
    <div id='content_container'>
            <!-- rounded corners - top **** -->
            <div class='rtop'><div class='r1'></div><div class='r2'></div><div class='r3'></div><div class='r4'></div></div>
            <div id='content'>
              <h1>A good snapshot stops a moment from running away.</h1>
              <div class=sub_title>$title</div>
              <p>PAGE UNDER CONSTRUCTION<br><br>";
    echo '<pre>$_SESSION:' . print_r($_SESSION,true) . '</pre>';
    
    echo"
    <br><br><br>Picture Number: $file<br>
    <table bgcolor=$purple border=0 width=100% bgcolor=#FFECFF cellspacing=0 cellpadding=0 style='border: 2px solid $purple'>
    <tr>
    	<td width=10% rowspan=2><img src='".$_SESSION['picture']."'style='border: 2px solid $purple'></td>
    </tr>
    <tr>
    <td bgcolor=#ffffff colspan=2 valign=top style='border-bottom: 2px solid $purple'>";
    
    $count = count($_SESSION);
    for($i=0; $i<$count; $i++){
    
    echo "
    <table border=0 width=100% cellspacing=0 cellpadding=0>
    		<tr bgcolor=$purple>
    			<td align=center style='color:white; padding-bottom:3px; font-family:arial narrow; ' colspan=2><font size=5>ORDER INFORMATION for Picture {$_SESSION[$i]['file']}</font></td>
    		</tr>
    		<tr>
    			<td align=right style='padding-right: 10px'><font size=4><u>Size</u></td>
    			<td><font size=4><u>Quantity</u></font></td>
    		</tr>\n";
    
    $pic_size = array("4 x 6" => "QU46", "5 x 7" => "QU57", "8 x 10" => "QU810");
    
    foreach ($_SESSION[$i] as $file => $val){               ////////////////////////////////////////////////LINE 38
    
    if($file == "QU46" || $file == "QU57" || $file == "QU810"){
    
    echo"		      
    		<tr>
    			<td align=right style='padding-right: 10px' height='30'><font color=$purple size=3>".array_search($file, $pic_size)."</td>
    			<td height='30'><font size=3><b>$val</b></font></td>
                           </tr>\n";
      }
    }
    
    echo "</table>\n";
    }
    echo"		
    </td>
    
    </tr>
    <tr>
    	<td width=10% colspan=2 bgcolor=$purple>
    	<!--<input type=button value='Update'>-->
    	<input type=button value='Remove From Order'></td>
    	<td bgcolor=$purple>
    	 </td>
    </tr>
    </table>
    		<br>
    
    ";
    
    //}			
    echo"			
              </p>
            </div>
            <!-- rounded corners - bottom **** -->
            <div class='rbottom'><div class='r4'></div><div class='r3'></div><div class='r2'></div><div class='r1'></div></div>
          </div>
    ";
    
    ?>
    

     

    Here is what I get:

     

    Warning: Invalid argument supplied for foreach() in /home/content/r/e/m/rememberthe/html/pages/checkout.php on line 38

     

     

    I can't even explain what the page looks like???

     

    I didn't realize that there was a place in this forum to pay for services.  Do you think it's wrong/offensive to offer the sight a donation as opposed to paying the person helping me?

  6. Please keep in mind my objective is to store multiple sesion arrays all with different values.

     

    If you look at the result of an order on the link above I think it would best describe my problem.

     

    ie.

     

    $_SESSION:Array1
    (
        [picture] => ALBUMS/Holmes_Adams/P1040050.jpg
        [file] => P1040050.jpg
        [s46] => 4 x 6
        [QU46] => 10
        [s57] => 5 x 7
        [QU57] => 20
        [s810] => 8 x 10
        [QU810] => 30
        [order_photo] => Order This Photo
    )
    
    $_SESSION:Array2
    (
        [picture] => ALBUMS/Holmes_Adams/DIFFERENT NUMBER.jpg
        [file] => DIFFERENT NUMBER.jpg
        [s46] => 4 x 6
        [QU46] => DIFFERENT QUANTITY
        [s57] => 5 x 7
        [QU57] => DIFFERENT QUANTITY
        [s810] => 8 x 10
        [QU810] => DIFFERENT QUANTITY
        [order_photo] => Order This Photo
    )
    
    and so on....
    
    

     

    Then each would be displayed seperatly in there own HTML table.

     

    I keep relating it (in my head) to a while loop.

     

    I am trying the code change you gave me.

  7. I am sorry.  When I said table I meant <table></table>

     

    foreach ($_SESSION as $file => $val){
    
    echo"
    <table border=0 width=100% cellspacing=0 cellpadding=0>
    		<tr bgcolor=$purple>
    			<td align=center style='color:white; padding-bottom:3px; font-family:arial narrow; ' colspan=2><font size=5>ORDER INFORMATION</font></td>
    		</tr>
    		<tr>
    			<td align=right style='padding-right: 10px'><font size=4><u>Size</u></td>
    			<td><font size=4><u>Quantity</u></font></td>
    		</tr>
    		<tr>
    			<td align=right style='padding-right: 10px' height='30'><font color=$purple size=3>4 x 7:</td>
    			<td height='30'><font size=3><b>".$_SESSION['QU46']."</b></font></td>
    		</tr>
    		<tr>
    			<td align=right style='padding-right: 10px' height='30'><font color=$purple size=3>5 x 7:</td>
    			<td height='30'><font size=3><b>".$_SESSION['QU57']."</b></font></td>
    		</tr>
    		<tr>
    			<td align=right style='padding-right: 10px' height='30'><font color=$purple size=3>8 x 10:</td>
    			<td height='30'><font size=3><b>".$_SESSION['QU810']."</b></font></td>
    		</tr>
    </table>
    ";
    }
    ?>
    

  8. This code is executed when you submit the order form ... THANK YOU KEN:

    <?php
    
    
    if (isset($_POST['order_photo'])) {
    
    $file = array();
    
    $file[0] = $_POST['S46'];
    $file[1] = $_POST['QU46'];
    $file[2] = $_POST['S57'];
    $file[3] = $_POST['QU57'];
    $file[4] = $_POST['S810'];
    $file[5] = $_POST['QU810'];
    $file[6] = $_POST['file'];
    $file[7] = $_POST['picture'];
    
    foreach($file as $val){
    
        $_SESSION[$val] = $val;
    }
    
    }
    
    header( 'Location: http://www.rememberthetimephotos.com/index.php?page=checkout&BM=$file' );
    ?>
    
    
    
    I am trying to display the stored information on the next page with this:
    
    <?
    THE SESSION IS BEING STARTED
    
    echo"
    <div id='content_container'>
            <!-- rounded corners - top **** -->
            <div class='rtop'><div class='r1'></div><div class='r2'></div><div class='r3'></div><div class='r4'></div></div>
            <div id='content'>
              <h1>A good snapshot stops a moment from running away.</h1>
              <div class=sub_title>$title</div>
              <p>Checkout page UNDER CONSTRUCTION<br><br>";
    echo '<pre>$_SESSION:' . print_r($_SESSION,true) . '</pre>';
    
    foreach ($_SESSION as $file => $val){
    
    echo"
    <br><br><br>Picture Number: ONE PEICE OF THE VARIABLE HERE<br>
    <table bgcolor=$purple border=0 width=100% bgcolor=#FFECFF cellspacing=0 cellpadding=0 style='border: 2px solid $purple'>
    <tr>
    	<td width=10% rowspan=2><img src='ONE PEICE OF THE VARIABLE HERE'style='border: 2px solid $purple'></td>
    </tr>
    <tr>
    <td bgcolor=#ffffff colspan=2 valign=top style='border-bottom: 2px solid $purple'>
    <table border=0 width=100% cellspacing=0 cellpadding=0>
    		<tr bgcolor=$purple>
    			<td align=center style='color:white; padding-bottom:3px; font-family:arial narrow; ' colspan=2><font size=5>ORDER INFORMATION</font></td>
    		</tr>
    		<tr>
    			<td align=right style='padding-right: 10px'><font size=4><u>Size</u></td>
    			<td><font size=4><u>Quantity</u></font></td>
    		</tr>
    		<tr>
    			<td align=right style='padding-right: 10px' height='30'><font color=$purple size=3>4 x 7:</td>
    			<td height='30'><font size=3><b>".ONE PEICE OF THE VARIABLE HERE."</b></font></td>
    		</tr>
    		<tr>
    			<td align=right style='padding-right: 10px' height='30'><font color=$purple size=3>5 x 7:</td>
    			<td height='30'><font size=3><b>".ONE PEICE OF THE VARIABLE HERE."</b></font></td>
    		</tr>
    		<tr>
    			<td align=right style='padding-right: 10px' height='30'><font color=$purple size=3>8 x 10:</td>
    			<td height='30'><font size=3><b>".ONE PEICE OF THE VARIABLE HERE."</b></font></td>
    		</tr>
    </table>
    
    </td>
    
    </tr>
    <tr>
    	<td width=10% colspan=2 bgcolor=$purple>
    	<!--<input type=button value='Update'>-->
    	<input type=button value='Remove From Order'></td>
    	<td bgcolor=$purple>
    	 </td>
    </tr>
    </table>
    		<br>
    
    ";
    
    }			
    echo"			
              </p>
            </div>
            <!-- rounded corners - bottom **** -->
            <div class='rbottom'><div class='r4'></div><div class='r3'></div><div class='r2'></div><div class='r1'></div></div>
          </div>
    ";
    
    ?>
    
    
    

     

    If you follow the links and place an order you'll see my problem.

  9. I know I have been asking this question in different ways for most of the day.  Well, I feel someone should be compensated for the fantastic help I have received thus far.  I'll probably donate it anyway but I would like some more help.  By the way...I am not charging my neighbor for this site.  The money will come from my pocket.

     

    Basically I need to allow someone to order different photos indicating the size and quantity.

     

    I think I have most of the code done.  I am stuck with the sessions information being stored and displayed properly.

     

     

    this takes you to the ordering page with a photo selected:

    http://www.rememberthetimephotos.com/index.php?page=forms/order&picture=ALBUMS/FLM-MINC/P1090702.jpg&BM=P1090702.jpg

     

    this takes you to the photo select page...CLICK ON A PHOTO TO GO TO THE ORDRING PAGE.

    http://www.rememberthetimephotos.com/index.php?page=albums/get_album&event=Sports&loc=FLM-MINC&name=Fondville%20Lewis%20Foote%20and%20Messer%20vs%20M%20Inc.

×
×
  • 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.