Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zane

  1. This only is a dead giveaway, without even looking at your code, that you are not comparing the input password with the database stored password correctly. You say that in order to login successfully you have to use the HASHED (not encrypted) password stored in the database. That can only mean that you are not hashing the input password before making the comparison.
  2. After further inspection of the code [that you] provided, I realize that you are outputting to the browser before your header call. Not to mention that fact that ginerjim pointed out I'll admit, overlooking the noscript tag was an ignorant thing to do, but forgetting to use the tag is pretty ironic. Surely you must have received a header redirect error? Straight from the manual it tells you:
  3. I can't believe I overlooked that!
  4. For one, you can use the HTML tag. Put the button inside it and it will only appear when javascript is not enabled.
  5. He means that in order for $_POST['submit'] to be set, the user would have to click on it. In your case, the form submits on change so it's assumable that no one will ever be clicking the submit button.
  6. $timeVar = explode(":", "02:15:37.5"); $totalSeconds = 0; foreach( $timeVar as $s) { switch( key($timeVar ) { case 0: //Hours --- 3600 secs in an hour $totalSeconds += ($s * 3600); break; case 1: //Minutes -- 60 secs in a minute $totalSeconds += ($s *60); break; case 2: //Seconds.milliseconds 1000 ms in a second list($a, $b) = each( explode( '.', $s) ); $totalSeconds += $a + ($b / 1000) break; } } echo $totalSeconds . " \n"; echo "Rounded up" . ceil( $totalSeconds ) . " \n"; echo "Rounded down" . floor( $totalSeconds ) . " \n";
  7. ah.. damnit, what the fuck?
  8. The biggest question is time. Do you have the time to learn C? If you're just an unemployed teenager who like programming, I would take the free time that you have an learn C. In short, it will not hurt you to know C As Kevin mentioned earlier though, it all depends on your needs. If you're just bored, I would go with C. if you're looking for a language that you can create a certain application with, learn C++ or C# or Java... Think of it like a vehicle. C++ would be your ability to add things to the car. New engine, new stereo system, new alternator, new upholstery , etcetera, etcetera, etcetera... Knowing C would be your ability to tweak of fix these things without even needing a "new" thing. For instance, say your alternator goes but you just happen to know exactly how to take it apart, change the brushes, make new brushes, whatever. Battery goes out and you know exactly which chemicals to get to renovate it. If you get into a fender bender and part of the body of your car is ripped off, leaving a gaping whole, then you would how to weld some old metal to the point that it looks brand new.
  9. $typecount should be $typeCount variables are case-sensitive. So, while( $row = mysqli_fetch_array($typeCount)) Barrands suggestion is the most ideal and most flexible solution. It only requires though that you re-organize your table structure. If you are willing to do that, then I would definitely go for it. If you cannot, then reference my above solution.
  10. Why not? If you have the time to accomplish such a thing then do it rather than daydream about it.
  11. Try using one query instead of five, especially since all of the queries you have are only different in that they have a different type. $typeCount = mysqli_query($con, " SELECT actcaseld, type, encdate, COUNT(*) AS thecount FROM `Stats` WHERE type IN ("Type 1", "Type 2 diet", "Type 2 ADA", "Type 2 ADA and Insulin", "Type 2 Insulin") AND actcaseld='New Client' AND encdate BETWEEN (SELECT bdate FROM `ReportRange` WHERE cf_id=1) AND (SELECT edate FROM `ReportRange` WHERE cf_id=1") GROUP BY type"); That should give you four rows, each with a thecount field of the count. echo "<table border='1' align='center'> <tr> <th></th> <th></th> <th>Type 1</th> <th>Type 2 Diet</th> <th>Type 2 ADA</th> <th>Type 2 ADA + Insulin</th> <th>Type 2 Insulin</th> </tr>\n"; echo "<tr>\n"; while( $row = mysqli_fetch_array($typecount) ) { echo "<td><center>{$row['thecount']}</center></td>\n"; } echo "</tr></table>";
  12. while( $row = mysql_fetch_array($result) ) { //Looking for 2 echo each($row) == 2 ? key($row) : null; }
  13. I went to google and searched for "undetermined entity reference" and the first result, which was the PHP manual, was this 6 years ago To avoid warning message "unterminated entity reference" you may use htmlentities() for escaping supplied value: <?php //... $dom->createElement('name', htmlentities($text)) //... ?> Omit the fact that it shows up at the very bottom of the page. Ctrl+F is your best friend in searching for information.
  14. You are getting the non-object error because of this line echo array_to_xml($xml_page_info,$wall)->asXML(); You have your parameters backwards... According to this line function array_to_xml($student_info, &$xml_page_info) $xml_page_info goes at the end.
  15. Exactly. But they also come in handy for writing source code for things such as email headers. By putting \r\n after each mail header you allow sendmail to distinguish the characteristics of that message and display them accordingly.
  16. \n Newlines will only ever "appear" in the source code. The same goes for \r RETURN; the tag is for HTML formatting and thus only functions in a browser. If you check the source code on something you are echoing , then you will clearly see it.
  17. According to the code you provided, that error is completely true. You did not provide the code that made the error, that is key to getting the best answer.
  18. Yea, explain these "designs".. If you're talking about what I think you are, then you are asking about a way to instantly upload files upon saving them? Use notepad++ along with its NppFTP extension.
  19. What version of PHP are you using? I don't see why the above wouldn't echo anything, other than version issues
  20. In order for margin: 0 auto to work, that specific element needs a width.
  21. mysql_query="SELECT BookID,BookTitle,BookInfo FROM mrmen WHERE BookID = $BookID"; Change to mysql_query("SELECT BookID,BookTitle,BookInfo FROM mrmen WHERE BookID = $BookID"); Also, you need to assign this to a variable if you want to do ANYTHING with it...
  22. use $i++ instead of $i+1
  23. PHP is a C-based framework essentially. If it wasn't for frameworks, we would still be using a language from the late 1960s.
  24. I just decided to give in an add columns for grade and quality to the products table.
×
×
  • 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.