Jump to content

DarkKnight2011

Members
  • Posts

    67
  • Joined

  • Last visited

Posts posted by DarkKnight2011

  1. hi,

     

    To get an additional window to appear that will show content from another URL then yes, you could use something like

     

    window.open(url, "Popup Window", "width=400,height=300,resizable=yes");

     

    Although, As gristoi stated, this is a very old (and also annoying) way of showing information even if it's not intended for advertisements, the code provided by gristoi can be used to popup a form or some other small information on the current page the user is viewing, Which is much preferrred.

     

    And yeah, Inline javascript.... eeeeeewww :o

  2. Try this...

    <script>
        $(function() {
            $( "#delDate" ).datepicker({
                dateFormat: 'd MM yy',
                changeMonth: true,
                changeYear: true,
                minDate: "+1D",
                constrainInput: true
            });
    
            var currentdate = new Date();
    
            if (currentdate.getHours() >= 17) {
                currentdate.setDate(currentdate.getDate() + 2);
    
                $( "#delDate" ).datepicker( "option", "minDate", currentdate);
    
            }
        });
    </script>
    
  3. I would suggest that you use an associative array, ie.

    $arr = array(
        'value1' => 1,
        'value2' => 2
    );
    
    echo $arr['value1'];
    
    // outputs 1
    

    or given your latest comment...

    $arr = array(
        'tableName' => 'Table1',
        'tableData => array(
            'value1' => 1
         )
    );
    
  4. Yeah I agree, This does sound like a fairly big project, if your new i would personally suggest that you start off with something smaller first,

     

    There are alot of considerations regarding which technologies to use for a project, and varies for each one. Personally my choice for that application would probably be

     

    Backend - PHP (Symfony2/Zend Framework 2)

    FrontEnd - ExtJs (www.sencha.com) or maybe something like BackboneJS with Twitter Bootstrap

     

    But to use those things would take a lot of learning,

     

    Maybe try a smaller project and see how you progress, You could of course hire an experienced developer to build this on your behalf but it would be expensive

  5. Like Jessica has mentioned, when a user is registered or changes their password, store the date this occured in the user table, Then in your script you can check to see if that was last done more than 90 days ago, if it was more then show a change password screen otherwise success

  6. sorry I'm really missing something here I think, maybe this helps...

    $color = '';
    
    switch($severity)
    {
        case 'Extreme':
            $color = 'red';
            break;
        case 'Severe':
            $color = 'amber';
            break;
        default:
            $color = 'white';
    }
    
    echo "<span style='color: $color;'>$severity</span>";
    
    

    Does that help?

  7. SELECT requests.*, users.*, areas.* FROM requests 
    LEFT JOIN users ON requests.requesterID = users.userid 
    LEFT JOIN areas ON requests.areaID = areas.areaID
    

    try that, you had brackets in there which weren't needed

  8. try this..

    // Create connection
    $con=mysqli_connect("localhost","root","","inshapewebsite");
    // Check connection
    
    if (mysqli_connect_errno($con))
    {
        echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }  
    
    $clid=111;
    $date=date("m.d.y");
    $foodS = '';
    $total = 0;
    
    foreach ($_SESSION['foodTypes'] as $food)
    {
        $foodS= $foodS . ",". $food;
    }
    
    $calories = (int) calculate($_SESSION['foodTypes']);
     
    $query = "SELECT Calories FROM caloriescounter where ID=$clid AND Date = '$date'";
    $result1 = mysqli_query($con,$query);
    $row = mysqli_fetch_array($result1);
    $total = $calories + (int) $row['Calories'];
    
    $sql = "INSERT INTO caloriescounter (ID, Date, Lunch, Calories)
    VALUES ($clid, '$date','$foodS', $total)
    ON DUPLICATE KEY UPDATE Lunch = '$foodS'";
    
    var_dump($sql);
    
    echo 'The amount of Calories registered is: ' . $total;
        $result = mysqli_query($con, $sql) or die(mysqli_error());
     
    //mysqli_query($con,"INSERT INTO caloriescounter (ID, Date, Lunch)
    //VALUES ('$clid', '$date','$foodS')");
    mysqli_close($con);
     
        // session exists and has content
        // process the array list here.
    // after the processing, empty the session
        $_SESSION['foodTypes'] = array();
      }
    
  9. sorry i dont understand what your trying to do, could you maybe give some example code even if it is wrong and i'll see if i can fix it? will help to understand the issue.

     

    things i need to know...

    • what values would you expect to receive
    • what logic do you want to apply to those values
    • what is the output

    Thanks, sorry i just dont get it lol

  10. As far as I know, you cannot use the same id more than once, that could be throwing an error an causing your issue,

     

    they could all have the class menu, and the id's can be button1, button2 etc

  11. If you want to get the ip address of a local machine accessing your website then that previous code will still work, if your trying to the ip address of the machine your website is running on try this...

    $localIP = gethostbyname(trim('hostname'));
    

    I think it only works on linux though

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