Log in

View Full Version : Problem..



gitarr_mannen
12-18-2007, 02:15 PM
Hi guys,
I have this problem and i'm hoping that someone here can help me, i'm a noob to Java, PHP etc, programing... Ok here we go.
I have a gallery and when the users browse the gallery they can click on a link if they want to buy a certain photo. If they click on the "Buy this print" link a page called "prints.htm" is loaded, on that page there's a drop-down list to chose wich photo they want to buy, when they have chose the photo a small thumbnail is shown to the left, that's fine, but my problem is, when the user has clicked on a certain photo they want to buy, i want that certain photo show up as a thumbnail directly, instead of chose it from the drop-down list, kind of hard to explain.

Surf away to;
www.mikaelraymond.com
On the index file there's 3 "Latest Additions" pictures, if you click on one them and then click on "Buy This Print" then you're taken to the print.htm file, and there you see what my problem is.

Best wishes,
Mikael

chechu
12-18-2007, 02:25 PM
Again, please, with a link to what you already have.

gitarr_mannen
12-18-2007, 02:31 PM
Ops, sorry for that..
Ok, i uploaded my site and here's the address;
www.mikaelraymond.com
On the index file there's 3 "Latest Additions" pictures, if you click on one them and then click on "Buy This Print" then you're taken to the print.htm file, and there you see what my problem is.

Best whishes,
Mikael

BLiZZaRD
12-18-2007, 03:32 PM
You just need to send the "name" attribute to the prints.htm page.

Everything is set up to accept it, just use $_POST to set the name value and then use $_POST to get the attribute on the prints.htm page.

The site is nice, and the art is fab, but if I may make one suggestion:

make your links NOT grey. It took me 4 minutes to click on the "buy this print" link, and that was WITH your instructions above.

If you want to sell, make it easy for the buyer to buy ;)

gitarr_mannen
12-18-2007, 04:08 PM
Thanks for your reply,
Can you please give me some examples on how the code would look like?
Yes, i know about the bright link color, i will change that as soon as i get the harder parts done..

BLiZZaRD
12-18-2007, 04:45 PM
well.. JS is NOT my strong point, but it would be something like this:

on the buy link:



<form action="part2.html" method="post">
<a href= "prints.html" name=image_thumb value="image1">Click here to buy print</a>
</form>


and in the JS script on prints.html:



<script type="text/javascript">
function showimage(t)
{
if (!document.images)return;
document.images[t.getAttribute("name").replace("select","pics")].src=t.options[t.selectedIndex].value
else{ document.images = <?php echo $_POST["image_thumb"]; ?>
}
</script>


basically you tell the script if nothing is selected from the drop down, then use the posted attribute for "image_thumb" which you have given a value on clicking the link previous.

gitarr_mannen
12-18-2007, 05:35 PM
Thanks for taking your time trying to help me here, but sorry to say, i can't get this to work...
I get this validate error in Dreamweaver;
The tag: "a" doesn't have an attribute: "value" in currently active versions.
Hmm, if i understood the code right, i change the "image1" in the buy code to the name of the corresponding name in the drop down in the "prints.htm" file?

BLiZZaRD
12-18-2007, 05:54 PM
yes and the "image_thumb" to whatever your image category is as well.

I didn't realize you were using Dreamweaver.. that is probably your first mistake ;)

gitarr_mannen
12-18-2007, 06:21 PM
I give it another try..
Oh, and my second mistake was that i didn't learned Java programing.. :-)

And I thought that Dreamweaver was great app?!
Wich software do you recomend?

gitarr_mannen
12-18-2007, 07:03 PM
bugger...can't get it to work how hard i try..... :-(

BLiZZaRD
12-18-2007, 09:14 PM
Well, as stated before I am NOT good with JS, yet.

I will try to get a working example in a little while (maybe tomorrow - as it is time to go home now :) )

Keep plugging away, it can't be that hard... can it?

gitarr_mannen
12-18-2007, 09:39 PM
I'm getting bolder and bolder, and i don't want to get bold yet.. :-) its that hard for me.. :-)
I appreciate that you have taken your time for this and if you come up with a working example, i would yell Hallelujah and i don't have to buy a wig.. :-)

gitarr_mannen
12-19-2007, 03:21 PM
Time to bug you a bit BLiZZaRD...
Did you come up with a working example?..

Cheers..

BLiZZaRD
12-19-2007, 03:32 PM
Not time yet.. I just logged in at work and am catching up. Will work on something in a little bit :)

BLiZZaRD
12-19-2007, 05:26 PM
Just had another look, and without a live example (on my end) I won't be able to tet properly.. I missed the callTo earlier though..

on the link (buy print) try adding the value and name as follows:



<form action="prints.htm" method="post">
<a href= "prints.html" name=firstselect value="orderimages/the bike.jpg">Click here to buy print</a>
</form>


Where the bike.jpg is the image name on the page with the buy me link.

Give that a try and we will see where we are...

(I still think there is something missing, but I am not seeing it)

gitarr_mannen
12-19-2007, 05:37 PM
Excellent... will give it a try.. let you know how it goes...

gitarr_mannen
12-19-2007, 06:05 PM
Bummer again.... didn't work..

BLiZZaRD
12-19-2007, 06:27 PM
Okay, I am going to be stabbing at things here until it clicks for me, and for that I apologize.

Did you put the code there and remove the dummy.gif code? One may over writ the other. I will go have a think on it...

We may have to re-write that whole section with better JS... I will ponder a bit though and take more medicine hoping my head will clear and I can think and breathe.

gitarr_mannen
12-19-2007, 06:52 PM
Order a pizza and a 6 pack, then you're home free.. :-)
No, i guess i have to have that piece of code there, if someone chose to select a photo without going through the "Buy this print" link... I was not working on the "prints.htm" file, just on the "latest-l.html" file...

BLiZZaRD
12-19-2007, 07:01 PM
hrmm.. I didn't see the latest-l.html page, or is that just your test page?

unless John comes in with a quick fix (which I am sure there is one), I will take a better look at some codes I have laying around and make a working example you can draw from.

gitarr_mannen
12-19-2007, 07:30 PM
The latest-l.htm file is loaded if you click on the left "Latest Addition" image on the front page, but i could have taken another file with photos in them, such as bw.htm (as in black&white gallery page)or any other.

The thing i'm looking for is this.
A. A user can click on the "prints" link on the navbar and scroll the available photos and chose one from the list, after the selection, a thumbnail is shown to the left. (This part is working)

B. Or, the user can browse through the gallery and if the user decide to buy one, he/she just click on the "buy this print" link and the "prints.htm" page will load with the selected photo shown to the left as a thumbnail. (This is the part that don't work).

I just write the above to make sure that we're not misunderstanding each other..

BLiZZaRD
12-19-2007, 08:44 PM
Thank you for that. While I am working on the mark up for this, would you be opposed to haveing 2 different pages?

Meaning if they use Option A from your post, as it is working fine, we leave that alone, and then we can just recode the links and make another page for Option B.

The trick here is that both final pages (prints.htm for option A and another for Option B) would look identical, just work a tad different.

We may not have too, but it was something that just popped into mind.

gitarr_mannen
12-19-2007, 09:01 PM
No problem at all to have 2 different pages, but i cant see how they will function, i mean, every link on the site that has a "Buy this print" or if the user clicks on the "Prints" link on the navbar, leads to the same place, to the "prints.htm" page.. If there's a workaround for this, so why not?

jscheuer1
12-21-2007, 04:28 PM
Seems to work fine for the first two images.

BLiZZaRD
12-21-2007, 04:58 PM
Aye, it does :)

You figured it out then? Great!

Thanks for looking John!

gitarr_mannen
12-21-2007, 10:46 PM
Yep, i found a solution with help elsewhere, but a big thanks Blizzard for your help and for taking your time, very much appreciated...