Jump to content

MDCode

Members
  • Posts

    640
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by MDCode

  1. Sorry about the above post ^.   Had to go and edit timed out.  What Barand was saying was to return the session to the JQuery in json format since that is what your dataType is:

    $test = $_SESSION['test'][$userAnswer];
    echo json_encode($test);

    Then JQuery will receive the value of $test as the data var in  

    success: function(data) {

    So basically just change your PHP to that and see what the result of the append is.

  2. The SQL part is easy.  The map part will span past SQL.  The query will depend on how much data you plan on storing, and how you plan to constantly store and update the location data to know how far away the aircraft is and what position in height they are at.

  3. Untested

    <?php
     
    // Base path starts with attachments
    $upload_path = "attachments/";
     
    // Check if the year directory exists, if not, create it
    if(is_dir($upload_path.date("Y")))
        $upload_path .= date("Y")."/";
    else {
        mkdir($upload_path.date("Y"));
        $upload_path .= date("Y")."/";
    }
     
    // Next, check the month by word
    if(is_dir($upload_path.date("F"))
        $upload_path .= date("F")."/";
    else {
        mkdir($upload_path.date("F"));
        $upload_path .= date("F")."/";
    }
     
    // Next check the day of the month with leading zeros
    if(is_dir($upload_path.date("d"))
        $upload_path .= date("d")."/";
    else {
        mkdir($upload_path.date("d"));
        $upload_path .= date("d")."/";
    }
     
    echo $upload_path;
     
    ?>

    That should get your upload path created if it doesn't exist, or use it if it does.  The path should be accessible through the $upload_path variable.

  4. The backticks should not be causing that error.  Try this:

    SELECT SUM(`reservation_pax`) FROM `reservations` WHERE `reservation_time` = '8:00:00' AND `reservation_date` = '{$_SESSION['selectedDate']}' AND `reservation_hidden` ='0'

    I posted that on my server and no syntax errors occurred.  Just know that trusting the integrity sessions is bad.  You should properly escape that as well.

  5. I'm not sure how your date is set up in the database but you can just add on to your WHERE clause like this:

    $result = mysql_query("SELECT SUM(`reservation_pax`) FROM `reservations` WHERE `reservation_time` = '8:00' AND `date` = 'Enter some date here' ");

    That will get the sum of guests where the reservation time was at 8:00 and the date was whatever you enter.

  6.  

    <link rel="stylesheet" type="text/css" href="http://pickmysmoker.com/style.css" media="screen" />
    <style type="text/css">
    
    #maincontainer{height: 1435px;}
    
    #content{padding: 0 20px 10px 20px;}
    
    h4{padding-top: 20px;}
    
    .article{font-size: 16px;}
    
    #sidebar{margin: -1070px 0 0 630px;}
    
    #review-text{
    font-size: 14px;
    font-style: italic;
    }
    
    </style>

     

    That is part of the page source of your website.  There is some styling in a file called style.css and there is what is wrapped in the <style></style> that I also posted

  7. That setup is very unorganized.  It would take too much time looking back and forth to see what's happening in your code.

     

    1: Indent your code.  It's so hard to read.

    2: Functions should be kept in a separate file.

    3: Instead of using switch functions that just call functions, why not just layout your registration?

    <?php
     
    // Process registration
     
    ?>
    <html>
    <head>
        <title>Registration</title>
    </head>
    <body>
    
        <!-- Just put your form here -->
     
    </body>
    </html>

    My guess would be these lines here:

     

     

    if(!$connect){
    
    die(mysql_error());
    
    }

    $connect is not set in your connection.php

  8. If you want it accessible through a form and still seen in your span, you'll have to add it to a hidden input.

     

     

    <input type="hidden" name="grand_total" value="grand_total_amount_here">

     

    Either way it will still be editable by a user.  The only way to do it securely would be to follow mac_gyver's advice.

×
×
  • 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.