Jump to content

JasonLewis

Members
  • Posts

    3,347
  • Joined

  • Last visited

Everything posted by JasonLewis

  1. PDO is an abstraction layer. It just provides a set of easy functions that work on any database you use. So that's just saying you have the MySQL PDO driver installed, not sure if that is you're actual MySQL driver. I prefer PDO over MySQLi.
  2. Where exactly does it say the driver you are using? I was unable to find it...
  3. If it's not available to you, you could just re-create the method manually with a while loop, which I'm sure you have considered.
  4. Perhaps you have a loop that isn't working correctly, causing it to hang. You may need to debug your code and find out where it is hanging before jumping to any conclusions.
  5. Where you're header to redirect to the logged in page is, add the following if statement. if($Username == 'admin'){ header("Location: adminpage.php"); }else{ header("Location: loggedon.php"); }
  6. if($userResult == $myResult && $userResult < 0){ // do whatever } See http://php.net/manual/en/language.operators.php More specifically, see http://www.php.net/manual/en/language.operators.logical.php
  7. That happens after submitting the form? Try a var_dump() or print_r() on the $_POST variable. See what it outputs.
  8. Yup, another common method. I've been looking at the DateTime and DateTimeZone classes PHP offers, from what I can see they don't do a very good job.
  9. Apologies for double post. Been researching it further, and the general consensus is to convert to a neutral timezone, UTC/GMT to be more precise. I do not wish to leave the task up to MySQL, as the first option I mentioned above requires SUPER privileges and I do not wish to assume that one would have them. The safest option would be creating a time class, that handles your date/time. Convert dates to GMT prior to inserting into the database, then convert them to the users local timezone prior to display. That, at least to me, seems to be the preferred option. Of course if you do have SUPER privileges then assigning your database to your timezone would be a much easier solution.
  10. I was originally going to use #1, I just wasn't to sure on how widely available that solution is with other databases. Time is such a bitch when it comes to programming. If all else fails I guess I could just use gmdate. I went against your recommendation, because I'm living in Victoria. DST for the win!
  11. So the most relevant thread I found was here, I just want to get a little more information. In an application I'm developing, a user may decide to change their timezone. Currently I'm setting my timezone to GMT with date_default_timezone_set. However I just realized that when inserting date into MySQL DATETIME fields it is (quite obviously) using the server time. So what is the best method here. [*]Use SET GLOBAL time_zone = timezone; as indicated in the MySQL manual. [*]Change my field types to TIMESTAMP instead, from what I've read it converts it to UTC (which in essence is GMT) before storing in the database. After testing this though, it still inserts NOW() as the servers date/time. So not sure what the go is there. [*]Store a UNIX timestamp in the database, and convert it before display with PHP. I'm at a loss here as to what would be the cleanest, and most suitable solution for an application that depends heavily on the timezone so it can accurately display dates and time. Cheers.
  12. Use www.pingtest.net, I'm not sure how you can increase speed. But I do know that it's not all about the speed. I think it depends on things such as a wireless connection, wired, the type of broadband connection (cable, satellite, wireless etc) and many other factors. Could be your ISP as well, might help to give them a call and see what the go is.
  13. This is one of my pet peeves, but there is nothing more secure about POST. It may be slightly more obscure, but not enough so to make the argument that you added security to your app. Even script kiddies know how to use tools that show you the HTTP headers and let you manipulate them. If you need security, you have to engineer it in somehow. True, but POST is still the better option in this instance.
  14. You're using http as the object in JavaScript, when your object is called ajaxRequest, so you need to change these lines: http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", params.length); http.setRequestHeader("Connection", "close"); To: ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajaxRequest.setRequestHeader("Content-length", params.length); ajaxRequest.setRequestHeader("Connection", "close"); Also move these lines: var queryString = "?goahead=1&user=" + user + "&pass=" + pass + "&race=" + race + "&email=" + email + "&email2=" + email2 + "&security_code=" + security_code + "&planet=" + planet_name; ajaxRequest.open("POST", "register.php", true); ajaxRequest.send(queryString); So that they are above the setRequestHeader calls and in the Content-length header change params to queryString. You can also remove the ? from in front of goahead. In your PHP you are using $_GET in a few places still.
  15. It may not solve your problem. You should debug it, ensure that your variables are retrieved correctly with JavaScript. When you send the variables to PHP, again make sure that everything is set and is shown correctly, just die each variable and alert the response text with JavaScript. You need to trace the problem to its source, if you're not getting the correct output check your input. It's usually where it's screwing up.
  16. You can use POST with AJAX, see this article on how it's done. The reason I suggest you use POST for this kind of request is that you're inserting data, and it's much safer to use POST to send the data to the script then GET. GET should generally be used for when you are fetching data. As I said above, to make life a lot easier you can use the jQuery framework, it'll speed up your development.
  17. There are a few things you can use to clean your code up. For one, take a look at mysql_insert_id, you can use that instead of running a query after inserting the user data to retrieve the new user ID. Are you 100% sure that all variables are being set properly, that is, they are being retrieved and actually contain values both client and server side. I'd also like to recommend using a JavaScript library, such as jQuery. It neatens the whole process up. And when doing that, I'd POST the data, instead of using get. Someone could quite easily navigate to register.php in there browser and spam creation of users or worse.
  18. You'll need to check to see if they are wanting to view a members profile by checking the $_GET superglobal. So on members.php, you have it set to always show your information. You need to do some checking first. if(isset($_GET['id'])){ // they want to view a different member, set the id variable here and perhaps run the query }else{ // viewing your profile, run the query to grab the default information } // now you can show the information and it'll show depending on if they selected a memeber or not.
  19. Hah! That's pretty cool. Blowing up pages and what not, you'd have to be extremely bored I would imagine.
  20. No, but in the browser market they did play dirty. This is how they achieved their market domination. When users saw the Internet Explorer icon on their desktops they basically though that, "this is the internet". From recent events their market share is dropping and I would bet it will probably end up levelling out at 50/50 with IE users and everything else. People today still associate the 'e' with the internet, and probably have no idea of other ways to browse it.
  21. @CV: Points taken. Bet Microsoft are kicking themselves now, even though they would have had no idea the web would've turned out like it had. At the end of the day, I myself am glad the web is where it's at now.
  22. I'll admit that when I first started designing websites IE6 was the browser and I had no idea you could browse the web with anything other then that. Heck a lot of what you wrote then I had no idea occurred. I don't believe I just jumped on the bandwagon and made a 'I hate IE' sign and started parading around. I have my reasons for disliking IE. I dislike IE, not MS as a whole. I actually like MS. I'm a huge Xbox fan, don't see anything wrong with Windows as it does the job for me, but when it comes to IE I usually cringe just because for me, it doesn't do the job. I don't know heaps and heaps about the history of web browsers, introduction of world wide standards etc. But when these other companies came about and the W3C began to write up web standards that are globally recognized, I always wondered what was taking IE so long to offer support for these standards that everyone else was conforming too. Surely they would've realized that these new competitors were slowly (very slowly) eating away at their marketshare. The best move for IE would've been to fully support these new standards. Your post was interesting to read. I just seems to me that Microsoft has been stubborn with IE.
  23. While that is very true in the case of getting stuff to render the same in IE6, I very rarely find myself having to tweak much to get it working in 7/8. Agreed, not so much anymore. It's still not up to par with other major browsers though. It's just frustrating that it's taken them this long to actually (so it seems) follow standards and not make it up as they go.
  24. Because all the cool kids do of course. I'm just generally sick and tired of IE and it's pathetic attempt to render a web page. Too many times has IE made me stay up later then I had wanted due to its shitness.
  25. I got really really really angry when reading through some of the things on that site. Fuck I hate IE! Damnit!
×
×
  • 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.