Jump to content

DarkKnight2011

Members
  • Posts

    67
  • Joined

  • Last visited

Everything 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
  2. Did this work ok for you? could you please mark as answered if so, Thanks
  3. try one of these or maybe best to buy a book, but be prepared to put alot of time into it, You can't master programming languages easily www.php.net http://www.codecademy.com/tracks/php The topic of your post concerns me though, it wont be fast lol
  4. 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>
  5. 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 ) );
  6. 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
  7. 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
  8. your welcome mate, could you mark the question as answered, Good luck with the project
  9. 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?
  10. that is the var_dump($sql) line we added earlier, just remove it, was to try and find out what is happening with the query
  11. sorry what do you mean? the query looks ok? I have never used on duplicate key to be honest so not sure about that
  12. 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
  13. in this case your using a variable that hasn't been defined before, so either your calculate function isn't working or you need to initialise it first, ie. add $calories = 0; near the top of your code before you use it in a calculation
  14. try this http://www.codecademy.com/tracks/php
  15. The value is being passed into the query correctly, i think it may be due to the ON DUPLICATE KEY statement, why dont you auto increment the ID key? try running that query directly in mysql client / phpmyadmin / mysql workbench and it will show the error that is being thrown
  16. 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(); }
  17. so you need to know how to get the $severity variable assigned from the code in the XML file itself? you would need to provide a sample from the xml file or a sample of the array
  18. try this... $result = mysqli_query($con,"INSERT INTO caloriescounter (ID, Date, Lunch, Calories) VALUES ('$clid', '$date','$foodS', '$total') ON DUPLICATE KEY UPDATE Lunch = '$foodS'") or die(mysqli_error()); You might need to check the mysqli_error() bit, I haven't used mysqli for a while
  19. Does it echo out the total? you shouldn't enclose the $total value in quotes as it is a number like you said "INSERT INTO caloriescounter (ID, Date, Lunch, Calories) VALUES ($clid, '$date','$foodS', $total)
  20. 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
  21. 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
  22. You will still a form element with the value for the total in order to post it, If you could show your code for the form I can help
  23. 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.