Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Posts posted by CroNiX

  1. It's not enough to just make the LINKS lowercase and with dashes. That's easy peasy to do when building the links/anchors.

     

    $link = "A New Product";
    $link = strtolower(str_replace(' ', '-', $link));
    echo $link; // a-new-product
     

    Your app has to RESPOND to those lowercased/dashed urls as well, which you haven't told us or shown us how you are doing that. Right now they respond to the upper cased links with spaces in it because you have it coded that way somewhere.

  2. What does $status look like after you do this:

    $status = array_map('strval', $var['receiver']) + array(0);

    I'm not sure what that array(0) is supposed to do. Shouldn't those be square brackets and why are you adding that anyway?

     

    Besides that, it doesn't look like your database is normalized for your statuses. It seems those should be IDs instead of their names.

  3. Although you do run the risk of ticking them off. Personally I'd use placeholder data to demo a product to a specific company that you haven't been contracted by. It doesn't need their actual prices, etc., to show them what it would look like with their data.

  4. Sorry, I see you are posting with ajax. I'd suggest trying to get it to work without the ajax and then try adding it in.

     

    It would be helpful if you did a print_r($_POST) at the top of your page receiving the form data to see if everything was POSTed correctly.

     

    It might also be useful to use jQuery's built in method for building the form data to submit instead of building your own.

    data: $('#contact').serialize()
  5. Try this just before your query:

    //set a default value for the subcategory. This will be used if no subcategory exists in the URL
    $subcategory = 'Computing';
    
    //Check if the subcategory exists in $_GET, and it contains a value. If it does, use that value for the subcategory.
    if (isset($_GET['subcategory'] && trim($_GET['subcategory']) != '')
    {
      $subcategory = trim($_GET['subcategory']);
    }
    
    //Perform the query using the subcategory. Either the default, or the one passed via the URL.
    $sql = "SELECT * FROM categories WHERE Category = '$subcategory' ORDER BY subcategory ASC";
  6. Another thing, you are assuming everything will work by the way you've written your code. You need to test things with code, like how do you know if your db connection actually connected successfully? How do you know that your queries aren't failing since you don't test for that? You just make a query and move along. Just about everything in mysqli has a method to test to see if it was successful or not before continuing on.

     

    http://php.net/manual/en/mysqli.quickstart.connections.php

    Check here to see how they test to see if the connection was successful and showing the errors if it wasn't.

     

    Same with performing a query:

    http://php.net/manual/en/mysqli.query.php

  7. It would probably be much better for the user to be able to see the times available directly on the calendar within each day rather than having to hover over each day to see it. They just want to know what's available so they can book and appointment, right? It would also be a lot more user friendly to just have a form that pops up when clicking on a day (actually clicking on the available timeslot they want to book for) to create an appointment. The same popup can be used for all days, and you can grab the year/month/day/time they selected from the calendar depending on what they clicked on.

  8. I'd just use ajax to retrieve the content.

    You could start with your first tab populated, and show the tab.

    The other tabs would be empty.

    When clicking on the other tabs, check to see if they're empty, and if so retrieve content via ajax. If not just display the tab normally.

    If user clicks on same tab again, it will already have the content and not fire the ajax request a 2nd time

    if (this_tab_content.html() == '') //nothing in tab yet
    {
      //fire ajax to retrieve content for this tab
    
      //success: function(response) {
      //  this_tab_content.html(response.tab_html); //on ajax success, replace content of tab with resulting html
      //}
    }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.