1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Help

Discussion in 'PHP & Perl' started by mere2180, Feb 9, 2011.

  1. mere2180

    mere2180 Newbie

    Joined:
    Jan 26, 2011
    Messages:
    18
    Likes Received:
    129
    Wasn't sure where this was spossed to go, but this is the code for shopperpress. Whenever I goto add a product, I click on it and i get the javascript void error. I went ahead and pulled up the code and this is where I am stuck. It won't let me add any products. What could be wrong?

    Code:
       <p>[<a href='javascript:void(0);' onClick="addProduct('<?php echo $cats; ?>','<?php echo $_POST['amazon']['country']; ?>','<?php echo $data['asin']; ?>');">add product</a>] - [ <a href="<?php echo $data['url']; ?>" target="_blank">View Item</a> ]</p>
     
    Last edited: Feb 9, 2011
  2. artizhay

    artizhay BANNED BANNED

    Joined:
    Nov 21, 2010
    Messages:
    1,867
    Likes Received:
    1,335
    Post your PHP code, including the form sending that POST request.
     
  3. HungryMind

    HungryMind Newbie

    Joined:
    Jul 10, 2010
    Messages:
    9
    Likes Received:
    0
    Try: $_REQUEST['amazon'];
     
  4. Crazy

    Crazy Jr. Executive VIP

    Joined:
    Jun 13, 2009
    Messages:
    640
    Likes Received:
    319
    Occupation:
    VB, C#, XHTML, CSS, PHP, MySQL, JavaScript, jQuery
    Location:
    Everywhere
    Information is too limited. Get Firebug if you're using Firefox, or even just look at the Firefox error log. It'll specify what's throwing the error.
     
  5. easyroms

    easyroms Newbie

    Joined:
    Nov 5, 2009
    Messages:
    15
    Likes Received:
    1
    Try this perhaps:
    HTML:
       <p>[<a href='#' onClick="return (addProduct('<?php echo $cats; ?>','<?php echo $_POST['amazon']['country']; ?>','<?php echo $data['asin']; ?>') && false);">add product</a>] - [ <a href="<?php echo $data['url']; ?>" target="_blank">View Item</a> ]</p>
    
    You should not use inline scripting by the way (onClick=) , try using jQuery to bind events to those HTML elements.
     
    Last edited: Feb 17, 2011