Jump to content

requinix

Administrators
  • Content Count

    11,443
  • Joined

  • Last visited

  • Days Won

    223

Everything posted by requinix

  1. Then That's not what Barand was asking for. The question is about the data type: DATETIME, TIMESTAMP, VARCHAR, whatever. On top of that is the question of how the values are getting to the database. You mentioned time() - is that what you're using? Or date()? Maybe MySQL's NOW()? And please, I know you think it's funny, but it's off-topic. It doesn't need to be here. I mean, it's not even related to programming. Maybe check out Miscellaneous?
  2. Look at your variables. Make sure you're using the right ones in the right places.
  3. Then what did you mean when you asked
  4. PHP's time() function returns a Unix timestamp. It is the same value for everyone. You have to know something about where your user lives. With only PHP you can use geolocation on their IP address to get a good approximation. With Javascript you can get their "timezone" (UTC offset) with the Date object, which does not tell you their location.
  5. It won't print out anything because the code is invalid. We can't help you troubleshoot your code if you don't provide us with your real code.
  6. Apparently from the EXIF information that's embedded in the image. When you take a picture with most intelligent cameras now, they include metadata in the image about the orientation of the camera. Since the photo is always upright with respect to the camera, one can use the metadata to rotate the image so that it's upright with respect to the photographer. Unfortunately the camera (software) manufacturers didn't stop to consider that maybe the camera should automatically flip the image and then use EXIF to give the "original" orientation...
  7. Side comment: the image orientation should be fixed right when it's uploaded, not when it's being displayed to the user.
  8. 1. What is the URL in your browser's address bar? 2. What do you see when you View Source the page?
  9. I can't tell what code is in what file. Try this with a post: Put the filename on a line, hit the Code <> button and put the file's code in there, and repeat for the other files. That way everything is clean and separate and has syntax highlighting and doesn't force me to scroll so much.
  10. If you don't see it in the source then you added the code to the wrong template. Or you accidentally put it inside some block that's only outputted for logged-in users. Either way, needs to go somewhere else.
  11. For the record, if you're dealing with mobile devices then you can get GPS information - if the user allows you to do so. Non-mobile devices will give you information according to the IP address (user still has to approve), which will be more or less the same as the geolocation version. Basically, geolocation is only as good as a country and state. City is hit or miss.
  12. So you're saying you can find a custodian for $12 who will come clean your house for you?
  13. I really wouldn't have expected ASP Classic to be that bad at handling strings - I mean sure, strings are immutable, but reallocating that much bringing a 10x decrease in performance? While I was looking up whether it has some equivalent to StringBuilder (it doesn't) I found this that you might find interesting.
  14. H. H. Munro, aka Saki. Took me a while to find it.
  15. I know things are Slightly Unpleasant over there, but coming over here would be one of those "out of the fire, into the frying pan" things. Canada seems nice though.
  16. Be careful of Barand's quote: $50 is pretty good for an hourly rate - it's the travel costs that'll really get you.
  17. *You, supposed We can be both šŸ˜‰
  18. That also happens to be what I was trying to get you to do, so, šŸ‘
  19. First of all, that code makes my eyes hurt. <?php $dbHost = "localhost"; $dbName= "rptDatabase"; $dbUsername = "username"; $dbPassword = "password"; $conn = mysqli_connect($dbHost, $dbUsername, $dbPassword, $dbName); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $sql = mysqli_query($conn, "SELECT * FROM tblTraffic ORDER BY ip, date, time"); $report = mysqli_fetch_array($sql); echo "<table border='1'> <tr> <th>IP ADDRESS</th> <th>PAGE VISITED</th> <th>PREVIOUS PAGE</th> <th>DATE</th> <th>TIME</th> </tr>"; if (mysqli_num_rows($report) > 0) { while($row = mysqli_fetch_array($report)) { echo "<tr>"; //FOR EACH LOOP HERE? } } else { echo "0 results"; } $conn->close(); ?> Don't you think that looks a little better? Consistent? Don't have to look all over to see where {s and }s are? As for the question, A foreach loop is for going over each value inside an array, one at a time. Is that what you want to do here? Go over each column in the row one at a time? No, it's not what you want to do. What you want is to go over each row (you're already doing that) and print out values from the row into the table structure you set up. You've started a new row with that <tr>. Now you need to output each cell (a <td>) with the value inside it (from $row). Try that.
  20. Yeah, something more needs to change here. The form only supports one entry at a time. To support more than one, you'll have to (a) store each entry somewhere, best choice being a database, and then have the user hit some sort of Finish button so they can view the results, or (b) alter the form so that the user can enter more than one at a time. The second option is probably better: the user does all the work on one page, and when they submit you can show the results immediately. What do you want to do?
  21. function submit(){ global $API; if(empty($captcha) || $captcha == '' || !isset($captcha)) Variables defined outside functions are not available inside functions. They should be passed in as function arguments, like you're doing with post_content() and $query.
  22. User doesn't care. They don't look at URLs when they're just browsing around, and if they want to share the page they'll either use a share button or copy/paste what's up there. In fact that copying and pasting is a huge reason why ideas like putting session IDs into the URL (PHP's session.use_cookies/use_only_cookies) are strongly discouraged. That said, try to keep it simple. example.com/product.php?id=123 (or /products/123) is fine. Attempting to obfuscate it because you're scared, like example.com/product.php?product_id=uw433hyg5kishev6nyliser6nbyioq2gv49n68of325ob8nq534tb8, is not fine. People don't like things they can't understand: "123" is a number and people are okay with numbers, "B00005N5PF" is some sort of cryptic ID but it's okay too because it's short and easy to understand, but "uw433hyg5kishev6nyliser6nbyioq2gv49n68of325ob8nq534tb8" is a code and codes are for hackers. CoDeS aRe FoR hAcKeRs Probably, yeah. Lots of stuff on the internet already works like that. People are used to it.
  23. Implied in my reply was "you should look into why this is and deal with it accordingly". It's a symptom of a problem. If there are business needs that are changing, the problem is that the business doesn't know what it wants to do, and there needs to be more planning and thinking before rushing into development. If there are programming needs that change then... well, actually, there needs to be more planning and thinking before rushing into development for that too. That aside, in your shoes, I would regenerate the code every time. Use those files as a base and put your own implementation into, for example, traits - a thing that can be easily added into a class.
×
×
  • 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.