SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: if and else

  1. #1
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    if and else

    Hello, im setting up a shopping cart and i was wondering.. how to set up an if/else (i think thats what i need to do) i have a price collumn and a size collumn and a size_price collumn so i have the template setup already for the size and size_price way. i want to set up another template for just the price way.

    so if price is null it uses the size/size_price template and if price is not null then it uses the price template.

  2. #2
    That's Right. notepad_coder's Avatar
    Join Date
    Apr 2002
    Location
    Colorado
    Posts
    835
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    if ($price == NULL) {
        
    // load size/size_price template;
    } else {
        
    // load price template;

    - the lid is off the maple syrup again!

  3. #3
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    made the screen white out. hrmm

  4. #4
    That's Right. notepad_coder's Avatar
    Join Date
    Apr 2002
    Location
    Colorado
    Posts
    835
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you post the code you are using? you may try changing it to 'if ($price == "") {}'
    - the lid is off the maple syrup again!

  5. #5
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i fixed it i got it working tyvm


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
  •