Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. md5(microtime()); will give you a unique ID. The chances that 2 ids are generated at the same microsecond are, well, almost impossible. Yes you can store it in a database as you described...why couldn't you? If you are worried about duplicates and are storing the id in a table, you could always query the table to see if the id already exists, but using the method above with microtime you shouldn't need to do it.
  2. CroNiX

    Sessions

    Some ISP's, like AOL, do change the IP address on every page request. They are not the only ones...if you have a dynamic IP, which is most people, it can change.
  3. You can use javascript for this: <a href="#" onclick="this.href='http://www.google.com';">click me</a> I think this is what you are wanting to do... So when you hover over the link it displays '#' but when you click on it it goes to the url in the onclick event.
  4. Since probably not many people here know the extension you are using for joomla, it would probably be a good idea to ask on the joomla website, or the author of the extension.
  5. For me, I use camelCase for variables and CamelCase for classes, so it helps distinguish them. Not like you can't tell by the syntax (->, :: ) but I'm just anal that way LOL. A pet peeve of mine is that it seems the conventional wisdom is to start a class name with a capital, but I rarely see people use a capital when they instantiate it. like: $db = new DB();
  6. Never used one, but a google of 'php graph' turned up lots of things.
  7. No problem, you didn't disturb me or anyone else. That's what the site is about...asking questions and helping others. People just want to see that you try, and if you don't get it they will help. There should be a 'Solved' button below the post that you can click to mark this topic as solved.
  8. Are you sending it to another server? Why does it HAVE to be through the URL?
  9. You almost had it. I will simplify it so that you don't have to have the extra else as its not needed (as noted by your comment) <?php // this code is taken from the page! if(!$username || !$email || !$password) { echo("All fields are required, please go back and insert them all"); } elseif(mysql_num_rows($checkinguser) > 0 ) { echo("the user name $username is allready rigestered, have another one please!"); } elseif(!ereg ("^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$", $email)){ echo(" You entered a not valid email address, go back"); // this is what is required! } elseif(mysql_num_rows($checkingemail) > 0 ) { echo("The email $email is in use!!!"); } else{ $inserting = "INSERT INTO users (username, email, password) VALUES ('$username', '$email', '$encpass')"; $result= mysql_query($inserting); echo("Welcome $username <br> You Are Now Registered!"); } Notice the ! in front of the ereg expression, meaning NOT. I also indented your code. It makes it a lot easier to read and is good programming practice.
  10. can you give an example of the string? Why does it have to be sent through the URL?
  11. That is so messed up looking I don't even know where to begin.
  12. I did the hard part...now you should learn and attempt the easy part. Its basic php and using the code you already supplied it shouldn't be too hard to figure it out. You won't learn if I just do it for you (which is what this site is about...learning). Ill just give you a hint...its going to start with elseif( ...
  13. um, what is insertgoto? Never heard of it and its not in the mysql docs.... but, if you do an insert ... then you can use mysql_insert_id to get the id that the record was inserted into...pass it to the next page and then select it and display it.
  14. That would be easy to do with jquery or mootools, but it would take me awhile to figure it out with regular javascript that would work cross-browser....
  15. $SQL="SELECT UNIX_TIMESTAMP(".$this->tblLastLog.")-3600 as lastLog FROM ".$this->tbl;
  16. well, since UNIX_TIMESTAMP is in seconds, subtract 60 * 60 seconds to subtract an hour...
  17. Well, when I dumped your error message into google I got tons of hits...probably using registered globals....
  18. You might just want to check out Joomla/WordPress/Drupal etc. Either just use them or study them. Here is a place you can check them out... http://www.opensourcecms.com/
  19. Thats how I took this statement...seems like a clock to me?
  20. it seems like you could... <script> window.unload=closeFunction(); function closeFunction(){ //AJAX request to trigger PHP script //possibly add something to a database that a cronjob will check periodically } </script>
  21. I can see this being done with 3 images. 1) Blank clock face 2) Hour hand (everything else transparent) 3) Minute hand. (everything else transparent) Then its just a matter of using the GD image library and rotating the hour and minute images to the correct time.
  22. The first thing you will need is to create a user authentication script. You will have a database table with things like access level. Then for the ACP, you just check the users access level and see if they are an administrator, if not kick em out. Thats is in a nutshell. As mentioned above, if you are new it will take some learning to get this far...you need to learn how to access the database, insert info into it, retrieve it, etc.
  23. ah yes, forgot to mention the rDNS entry...
  24. if(ereg ("^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$", $email)){ //email is in valid format } else { //its not valid }
×
×
  • 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.