Results 1 to 4 of 4

Thread: PHP Photo Album script v2.11 with hidden form variable declaration for PayPal

  1. #1
    Join Date
    Jun 2010
    Location
    Texas :( USA
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Angry PHP Photo Album script v2.11 with hidden form variable declaration for PayPal

    1) Script Title: PHP Photo Album script v2.11 with hidden form variable declaration - A lot of views, not one response?

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...photoalbum.htm

    3) Describe problem:

    Okay, I am not strong in javascript. I taught myself php pretty well, but javascript has too many repeat variable names and un-obvious functions for me to grasp it.

    Having said that, I am trying to use the lightbox style feature on the PHP PhotoAlbum and use a PayPal button with it. I edited the "footer" <div> code to include a PayPal button, and I need a hidden field that has the value of that particular picture that has been expanded, so that when the customer hits the "Buy Now" button, it of course carries over the particular item number (the picture name- ie: 01.jpg) to PayPal, so I know which product to send them. I'm going to attach the segment of code I am referring to as well as the website url I am talking about. It's probably extremely eaasy for someone with common javascript sense, and if it were a php thing, I would have no problem, but I don't get it. I will try to color code it some it makes easy to read sense.

    From the ddphpalbum.js file, line 128 - OF course you can see I added a lot to it, and the stuff in PINK Is all good.
    Code:
    definefooter: '<div class="footerbar"><form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="XXXXXXXXXXXXX"><input type="hidden" name="on0" value="Sizes"><font color="white">Sizes</font><select name="os0"><option value="16&quot; x 20&quot;">16&quot; x 20&quot; $29.99</option><option value="12&quot; x 16&quot;">12&quot; x 16&quot; $24.99</option><option value="8.5&quot; x 11&quot;">8.5&quot; x 11&quot; $21.99</option></select><input type="hidden" name="on1" value="Enter Artwork ID"><input type="hidden" name="os1" maxlength="60" value= "??" ></td></tr></table><input type="hidden" name="currency_code" value="USD">&nbsp;  &nbsp;  &nbsp;  &nbsp;<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynow_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">&nbsp;  &nbsp;  &nbsp;  &nbsp; <a onClick="thumbnailviewer.closeit()"><font color="white">CLOSE X</font></a></form></div>', //Define HTML for footer interface


    If you're familiar with this script, I could really use your help on this. I thank anyone in advance.
    Last edited by rockdog1; 06-11-2010 at 01:13 PM. Reason: format code

  2. #2
    Join Date
    Jun 2010
    Location
    Texas :( USA
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Did I do something wrong? Noone is respnding to my post at all, tho many have looked and I know that it's a simple fix for anyone that knows javascript (as I don't). Any advise on how one can get their post answered?

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This isn't a dedicated help line, have some patience. Besides, this tends to require at least a passing understanding of PayPal. I mean, you could probably solve it without that, but it definitely helps. And you must know the script at least a little too.

    Anyways, the form you have is OK just like it is, though I might change it a little. You want to set the value of os1 when the user clicks on a thumbnail so that it's set when and if they click the buy now button. You can do that here:

    Code:
    new phpimagealbum({
    	albumvar: myvacation, //ID of photo album to display (based on getpics.php?id=xxx)
    	dimensions: [22,1],
    	sortby: ["file", "asc"], //["file" or "date", "asc" or "desc"]
    	showsourceorder: true, //Show source order of each picture? (helpful during set up stage)
    	onphotoclick:function(thumbref, thumbindex, thumbfilename){
    		thumbnailviewer.loadimage(thumbref.src, "fit2screen")
    	}
    })
    Like so:

    Code:
    	onphotoclick:function(thumbref, thumbindex, thumbfilename){
    		document.getElementsByName('os1')[0].value = thumbfilename;
    		thumbnailviewer.loadimage(thumbref.src, "fit2screen")
    	}
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. The Following User Says Thank You to jscheuer1 For This Useful Post:

    rockdog1 (06-11-2010)

  5. #4
    Join Date
    Jun 2010
    Location
    Texas :( USA
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    It was that simple. You're a gentleman, and a scholar, thank you so much!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •