Skip to main content
August 15, 2007
Question

undefined variable

  • August 15, 2007
  • 1 reply
  • 307 views
Hello, I am setting up a basic shopping cart.

Upon (form) submission of an "add to cart" button I get an undefined variable error.

This is because the "add to cart" form is submitting to "thispage" i.e itself, which contains an invoked database search function.
That search function relies on an externally provided keyword which is passed from another webpage upon the first load of that page.
How can I make that externally submitted variable exist for the duration of multiple reloads of that page ie. each time the "add to cart" buttons are submitted ?

thanks kindly for any help.
    This topic has been closed for replies.

    1 reply

    Inspiring
    August 15, 2007
    use if/else logic for the presence of the keyword that comes from the other page. If it's there (isDefined() will tell you), do what you need to do, otherwise, do the Add to Cart stuff.