Results 1 to 9 of 9

Thread: Help!

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    2

    Help!

    hi guys

    i'm new to all this so please go easy as i don't even know if i'm in the right place

    if anyone can help me figure out the link construction for the 'add to basket' button for this particular item i'd be forever grateful

    http://www.picturesonwalls.com/Art_A...set=0&PageNo=1

    http://www.picturesonwalls.com/Art_Prints.asp?ID=998001

    cheers

  2. #2
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: Help!

    Welcome to the forum.

    Yeah, you are in the wrong place But i can help you because i fun with css a long ago.

    Code:
    <input type="button" class='Button_Cart' name="btnAddToCart" value="ADD TO BASKET" onClick="document.form1.submit();">
    Its a plain button of a html form that stuffed with some CSS, to change its look.

    Here is the CSS that is passed.

    Code:
    .Button_Cart		{background:#B4B4B4;
    					color:#000000;
    					cursor:pointer;
    					font-family:"Courier New", Courier, monospace;
    					font-size:10px;
    					height:20px;
    					width:100px;}
    Here is the link to whole css that is used to stuff the things on that page:
    http://www.picturesonwalls.com/Includes/Style.css

    You can post your non-vb6 questions in these forums:
    http://www.vbforums.com/forumdisplay.php?f=23

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help!

    Moved

  4. #4
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: Help!

    It doesnt matter what is the input, in php there are a tons of ways to input a data, the only difference is, that the values are not arrives to the $_POST[''] but these values will arrive to the $_GET[''] array. Thats all.

    Basicly, you can call an url like this:
    Code:
    http://mysite.com/cart.php?userid=12345&sessiondata=f44FnfaQn4468Gg&buyitem=10492
    .. the following values are filled:

    $_GET['userid'] // will be '12345'
    $_GET['sessiondata'] // will be 'f44FnfaQn4468Gg'
    $_GET['buyitem'] // will be '10492'

    You just have to extend your cart to accept $_GET's and $_POST's (which one is filled).

    Just take care about the session (and login) system, to not avoid the user session, otherwise your cart extension will be invalid, or just wont work. Walk thru the whole code to find out how it is identifies the user each time the code will run.

    Quote Originally Posted by ericthedog
    thanks for the guidance mate

    i had found that css myself but i'm wondering if there's a way of constructing a link to automatically add a product to your basket

    e.g.

    http://www.blackratpress.co.uk/produ...hp?gallery=yes

    you can either click 'buy' on the above page or use the link below to directly add the product to your basket

    http://www.blackratpress.co.uk/view-...voiceless-(red)

    cheers

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    2

    Re: Help!

    to be honest, that's like trying to read hieroglyphics, that's how new to this i am

    if anyone can construct the direct link for this product:

    http://www.picturesonwalls.com/Art_Prints.asp?ID=998001

    to be automatically added to the basket:

    http://www.picturesonwalls.com/Basket.asp

    i'd really appreciate it

  6. #6
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: Help!

    OOOps my fault, but your PM just mislead me, that you are about to use PHP code. But you are in the ASP scripting, i dont know much about it...

    Ask your questions here, this is the forum built for ASP scripting:
    http://www.vbforums.com/forumdisplay.php?f=4

    But, technically it should be the same just like in php. In ASP there are some lines in your code, where you can get the input fields from the html form. You just have to extend the code, to be able to retrieve the query strings, then you can compare which one contains the item id, that you can use to add an item to the basket.

    So, this way you will get only one ASP script that does the two job, based on which method you call.

    If you call the asp without any html form post, or query string, it will display the basket.
    Code:
    http://www.picturesonwalls.com/Basket.asp
    But, if you call the same ASP but specified some query string, the appropirate method will be fired
    Code:
    http://www.picturesonwalls.com/Basket.asp?do=addbasket&itemid=12345
    
    or
    
    http://www.picturesonwalls.com/Basket.asp?do=delbasket&index=3
    
    and so on..
    Or, you can handle it simply, by using the html forms.

    Code:
    <input type="button" class='Button_Cart' name="btnAddToCart" value="ADD TO BASKET" onClick="document.form1.submit();">
    <input type="button" class='Button_Cart' name="btnDelFromCart" value="REMOVE FROM BASKET" onClick="document.form1.submit();">
    Last edited by Jim Davis; Nov 21st, 2008 at 12:24 PM.

  7. #7
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Help!

    @Jim_Davis: can you post the original PM to this thread? it would help me understand more.

    Also, please dont ask technical questions through pm, it helps if it is available for the whole forum to see
    My usual boring signature: Something

  8. #8
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: Help!

    @dclamp the only PM i received is the above quote i posted up there!

  9. #9
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Help!

    That form uses the POST method (as it well should). You can't construct a direct link to submit a POST request.

    That isn't your site, is it? Why do you need to do this?

Posting Permissions

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



Click Here to Expand Forum to Full Width