lostnvegas Posted March 23, 2012 Share Posted March 23, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/259530-a-rather-unique-problem/ Share on other sites More sharing options...
creata.physics Posted March 23, 2012 Share Posted March 23, 2012 How are you loading the images? Have you just tried using the html code to load the image? I looked at index2.php and saw the issue is located there so i would need to see the contents of that file or at least the code relating to the issue. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/259530-a-rather-unique-problem/#findComment-1330376 Share on other sites More sharing options...
lostnvegas Posted March 23, 2012 Author Share Posted March 23, 2012 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]" ; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/259530-a-rather-unique-problem/#findComment-1330379 Share on other sites More sharing options...
creata.physics Posted April 2, 2012 Share Posted April 2, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/259530-a-rather-unique-problem/#findComment-1333416 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.