-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Everything posted by CroNiX
-
[SOLVED] UniqueID function - would uniqueID ever be repeated?
CroNiX replied to limitphp's topic in PHP Coding Help
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. -
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.
-
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.
-
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.
-
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();
-
Never used one, but a google of 'php graph' turned up lots of things.
-
[SOLVED] I need an email verification with my Signup script!
CroNiX replied to samoi's topic in PHP Coding Help
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. -
Are you sending it to another server? Why does it HAVE to be through the URL?
-
[SOLVED] I need an email verification with my Signup script!
CroNiX replied to samoi's topic in PHP Coding Help
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. -
example of the string?
-
can you give an example of the string? Why does it have to be sent through the URL?
-
That is so messed up looking I don't even know where to begin.
-
[SOLVED] I need an email verification with my Signup script!
CroNiX replied to samoi's topic in PHP Coding Help
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( ... -
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.
-
endless pagination / endless scrolling during paging
CroNiX replied to anujgarg's topic in Javascript Help
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.... -
$SQL="SELECT UNIX_TIMESTAMP(".$this->tblLastLog.")-3600 as lastLog FROM ".$this->tbl;
-
well, since UNIX_TIMESTAMP is in seconds, subtract 60 * 60 seconds to subtract an hour...
-
How do you make an Administrative Control Panel for a website?
CroNiX replied to Allenj713's topic in PHP Coding Help
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/ -
Thats how I took this statement...seems like a clock to me?
-
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>
-
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.
-
How do you make an Administrative Control Panel for a website?
CroNiX replied to Allenj713's topic in PHP Coding Help
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. -
ah yes, forgot to mention the rDNS entry...
-
[SOLVED] I need an email verification with my Signup script!
CroNiX replied to samoi's topic in PHP Coding Help
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 }