Jump to content

Vermillion

Members
  • Posts

    118
  • Joined

  • Last visited

    Never

About Vermillion

  • Birthday 05/20/1992

Contact Methods

  • Website URL
    http://www.dreamspirited.com

Profile Information

  • Gender
    Not Telling
  • Location
    Bolivia

Vermillion's Achievements

Member

Member (2/5)

0

Reputation

  1. It would be helpful to see the code you are using for echoing your countries. We will figure something out from there.
  2. Hi guys, I decided to write to my own DateTime class mainly because the one PHP comes with doesn't do anything I want it to do. I need to implement a way of using DST for countries that use it, but I myself live in a place where DST is never used, so it's hard for me, so I have a few questions, first some questions related to DST itself and then the ones in PHP so I can implement it. * When does the DST enter in effect? * When does it end? * Is it the same for every year? * Do all the countries that use DST move their clocks one hour ahead or the time that needs to be changed varies from place to place? * How exactly can I get "The second Sunday of every march" with PHP?
  3. Suppose I have the following DateTime string. 20100312122636 How can I determine what day is it based on it? I want to know what day (Sunday, Monday, Tuesday...) is based on that string, but I can't figure a way to do it.
  4. Alright, I swear I am close on solving my whole problems for once and for all. Please bear with me till then. I have never been good with htaccess. I am trying to find a way to use the auto_prepend_file with it with no luck. Also, is there a way to include all the files from the API with that statement at once, or can I just include one? It would be very nice to be able to include all my API in just one htaccess so I can use it without creating a require hell once again.
  5. Is there a way to do it without modifying the php.ini file? My host will not be dedicated unfortunately .
  6. Alright, I get it for the most part. But where exactly do I put that __autoload() function? Also, here is a hierarchy of my work so far, I hope this can help you help me (file names are in blue, normal folders in black): www - projectfreedom -- FreedomAPI.php -- FreedomAPI --- class.DateTime.inc.php --- Connection ---- Communication ----- class.Message.inc.php ----- class.PrivateMessage.inc.php I test everything in the FreedomAPI.php file. Eventually, I will make more directories inside www and inside projectfreedom, so the __autoload function will become very handy, once I know how to use it lol.
  7. Hey there! First of all, thanks a bunch for the reply. I really appreciate it. I have been into PHP for 4 years and into OOP for 3 years and I never heard about __autoload() haha. Can you give me more info about it? I will really appreciate it.
  8. Hi guys, it has been a while since the last time I came here... I am now working on my website in the most "professional" way for me. I am using OOP, Namespaces, and all that, and here is where I have a question: The root namespace is called "FreedomAPI", and in that namespace I will put all the functions that are too general to fit in another subnamespace. I have no problem with that, the thing is that I don't know where to create those general functions. would it be a good solution to put them in a "functions.php", and then just include that file with the rest of my classes? My framework is sorta complex, and I have had a horrible experience trying to include all the files in different levels of directories in the servers, so I don't know what to do about where to write those functions.
  9. I really appreciate it but I have checked your code and I came to the conclusion that I can't adapt it to mine, so can you just help me to get mine right? Your code scared me when I saw it had references, and I already suck with pointers in C++, so I may just check them another day . I just really need to see why when I echo the $_SESSION['captcha'] variable it is different than the captcha in the picture. I mean, both strings are the same variable, and I don't modify it in any other line after I create it.
  10. I have been coding my site for months now, and weeks on just the registration script. Today, I had planned to finally finish my registration script, but I noticed that there's a problem with my captcha scripts thanks to the fact that my Ajax wouldn't deliver the correct Captcha. So trying to hunt the bug down, I started to make the script, and surprisingly, I found the bug very quickly, but unfortunately I still can't find a solution for it. This is the script that outputs the Captcha image: <?php session_start(); // Everything related to the Captcha. $captchamd5 = md5(microtime() * mktime()); $string = substr($captchamd5, 0, 7); //The Captcha string will only have 7 characters. $captcha = imagecreatefrompng("../graphics/captcha_bg.png"); $white = imagecolorallocate($captcha, 255, 255, 255); $line = imagecolorallocate($captcha, 233, 239, 239); imageline($captcha, 0, 0, 39, 29, $line); imageline($captcha, 40, 0, 64, 29, $line); imagestring($captcha, 5, 20, 10, $string, $white); $_SESSION['captcha'] = $string; header("Content-type: image/png"); imagepng($captcha); ?> And the test page I made to test it just has this code: <?php session_start(); ?> <?php echo '<img src="AwingsCLF/register/captcha.php"/>'; echo $_SESSION['captcha']; ?> Like you can see, the first script assigns the value to my $_SESSION['captcha'] array value, and the second script echoes that output, but first including the captcha as an image. The problem is that the values on the Captcha are different; what I echo is different than what I see in the image, like you can see on the pic below: Any help with this will be really appreciated. I don't want to change the way the whole thing works because I have a complex PHP class that handles registrations that comes from both browsers with JS enabled and for browsers without it. So I really need to get that session variable working right.
  11. Are you sure you want to encrypt passwords? Because the best move is usually to hash the passwords (hashing passwords and encrypting them are different things). There are 2 PHP functions that can hash passwords: sha1() and md5(). If I remember correctly, sha1() uses a 64bits (or less?) hashing algorithm, whereas md5() uses 128bits, if I remember correctly. I always heard that md5() was safer, so I always use that one.
  12. I was told it wasn't recommended as well... But I don't want to use a variable for that. I think I will see about using relative paths and that stuff.
  13. Thanks both. I tried theonlydrayk's solution and that one worked wonderfully .
  14. OOP is a painful concept to understand at first, but once you get it, you love it. You really do. I know I felt in love of it... Anyways, you can really do everything with it in a safe, quick, and to-the-point way. Consider what Daniel0 said: Imagine you, the person, are the object. You have a function to take your (my apologies for this example, lol) clothes off. You wouldn't want other people to take your clothes off, would you? .
  15. I made a thread about this a while ago, same topic, same everything lol. I believe the answer to the "do you need to be x years old to take it" was no, you can take it any time you are ready. I wish I could take it after I turn 17, hope I have the knowledge by then .
×
×
  • 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.