Jump to content

A rather unique problem


lostnvegas

Recommended Posts

Hey everyone. I have been working on a cart for my site and I've reached an impasse. I coded up the cart, the add to cart, the delete from cart and the subtract from cart. Problem is I now see a need to put an image for everything that is added to the cart. I think i have devised a way to do it with frames, the left frame being the cart and the main frame is purely for the images. I am having trouble getting the code right between the two pages to work. I need a picture on the right of every item added to the cart. Here is the url for the cart: http://www.theblack44s.com/Merchant%20pages/index3.php

 

I know this kind of thing can get extensive and I don't mean to take up any more of your time than necessary so if there are any suggestions or ideas of where I can find this information to learn it that would be just as good. Hey thanks for your time!

A

Link to comment
Share on other sites

Of course (I meant to upload the script but this problem obviously has part of my brain) Sorry about that.

here is index2. I have index3 as the main frame page so index and index2 are the two frames.

 

<?php

 

        $hostname='black44users.db.8631036.hostedresource.com';

$username='************';

$password='**********';

$dbname='black44users';

$usertable='products';

 

$link = mysql_connect("$hostname", "$username", "$password");

mysql_select_db($dbname, $link);

 

$query_category="SELECT imageurl FROM products";

    $result_category = mysql_query($query_category);

    while($row=mysql_fetch_row($result_category))

        {

            header("Content-type: image/jpeg");

            echo "$row[0]";

        }

 

        $image = stripslashes($_REQUEST[imname]);

        $sql_query = "select imageurl from products where ImageTitle=\"Utas_vert".addslashes($image).".jpg\"";

 

        mysql_connect("localhost","xxxxxx","xxxxxx");

        mysql_select_db("xxxxxxxx");

        $query_category="SELECT ImageContent FROM Logo";

        $result_category = mysql_query($query_category);

        while($row=mysql_fetch_row($result_category))

        {

            header("Content-type: image/jpeg");

            echo "$row[0]" ;

        }

?>

Link to comment
Share on other sites

  • 2 weeks later...

For the second while loop are you sure the result should be:

  echo "$row[0]" ;

and not:

[/code] echo $row['ImageContent'];[/code]

 

Also you don't need to connect to the database a second time for your second query unless you are connection to an alternative database. If the latter you will need to specify the second link and have the query operate off of that link.

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.