Jump to content

Pastulio

Members
  • Posts

    85
  • Joined

  • Last visited

    Never

Everything posted by Pastulio

  1. Sorry about that, ddMonth is a Global array storing all of the values of months there are in various languages. ddMonth is actually the "dropdown" menu used in the form so ddMonth contains Januari Februari March ... December but the problem is in another language it's Januari Februari MAART (dutch) ... December Thus If I wasn't using this dropdown array, the values wouldn't always work out. And what I'm trying to archieve is wheter the date entered is a VALID date.
  2. I have just written a Date Verification function for my form. The date entered by the user in the for is the date on which they Bought a certain product. Now The problems I'm having are the following: 1) I am using Language files, and I am unsure if I can use those globals withing a function. 2) What would be the best way for me to get specific error messages to the user. 3) Is there an easier way to do this, because it all seems a bit... farfetched. Here is the code to my function: (I also should mention that "ddMonth" is a global Array retrieved from the language file.) function checkDate ($day, $month, $year){ // Februari if ($month == $ddMonth[1]){ if ($day > 29){ return false; } elseif ($day == 29){ // Check if the entered year is a leapyear if ($year % 100 != 0 && ($year % 400 == 0 || $year % 4 == 0)){ return true; } else { return false; } } else { return true; } } // April if ($month == $ddMonth[3]){ if ($day > 30){ return false; } else { return true; } // June if ($month == $ddMonth[5]){ if ($day > 30){ return false; } else { return true; } // September if ($month == $ddMonth[8]){ if ($day > 30){ return false; } else { return true; } // November if ($month == $ddMonth[10]){ if ($day > 30){ return false; } else { return true; } } } Any help would be appreciated, thanks
  3. I don't quite get how it works... I've came to something like that. And now I'm thinking, how did I come up with this because 2000 / 4 = 500 and 2000 / 400 = 5, and none of them is "0". So I came to this conclusion: [code] // Check if the entered year is a leapyear if (!is_int($_POST['BoughtAtYear'] % 100) && (is_int($_POST['BoughtAtYear'] % 400) || is_int($_POST['BoughtAtYear'] % 4))){   // In this case the year would be a leapyear } else {   // In this case the year would not be a leapyear } [/code] Please tell me where I am wrong here :s EDIT: Sorry I just saw how stupid I was. the "%" indicator gives the rest and not the value X_X
  4. Thanks A lot man I'll try it but I've started from scratch so I'm gonna do that first.
  5. Still nothing think I'm gonna try to make one from scratch and if that doesn't work. The MySQL thing. Thanks a lot guys, hope you won't be hearing from me anymore
  6. Thanks a lot guys gonna check it out. I mean I've done hundreds of mail forms before and never had any problem =/. but gonna try the headers first and fill in the E-mail, and then contact the host . And if all else fails I'm just gonna make a MySQL database and create an inbox.
  7. I have used my hotmail account for the simple reason of verifying if the E-mail is getting sent. It does not appear in my inbox, nor my spam folder. I tried G-mail aswel, but the form is a Service Request for a company I'm doing, and it's pretty annoying that it doesn't work.
  8. Nope that's the problem. I'm sure the would be no Syntax error, but it does not display ANY error. but the mail is still not sent. I tried to make an "if" case for it and it always replied the mail could not be sent. Maybe the problem is host related I don't know. Thanks though =/
  9. This is the code from where my E-mail should be sent. But the mail will not send, Any Idea on as to why this is? any help would be greatly appreciated.
×
×
  • 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.