Jump to content

smy101

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

smy101's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks! That didn't work as written, but I modified it slightly and it works perfect now. The "$offset" time was subtracting minutes rather than hours so I had to modify it as follows: $offset = -60; // -60 minutes; date("F j, Y, g:i a", time()+60*$offset); That subtracted exactly 1 hour off the time so its all good now. Thanks for the help.
  2. SO I have a script with the following line of code: date("F j, Y, g:i a"); Which returns the time like: "March 16, 2007, 12:25 pm" The problem is that is in Eastern time (presumably where my server is) and I need it to return in Central time. Can someone tell me what I need to modify to get that to return Central time? Thanks in advance!
  3. Can anyone else help me with this problem? Thanks!
  4. Thanks, but again I don't need it to echo the error so that I can see it upon Submission. I need it to completely execute the script and mail message A if its valid or message B if its invalid. I do not want to see an error or a confirmation when I click "Submit." I want it to fully execute the script and if it's an invalid email, I want to get an email stating that it was invalid. Also, the above script you use is just a simple validation method, right? It only checks to see if an email address is in proper format - correct? I need something to also check the domain and see if the domain and even the email address itself is valid with the domain. Thanks again for your help.
  5. Are you saying to replace that line in my code, or only use that snippet instead? B/C that doesn't validate very thoroughly alone and I Also don't see how to execute the next part of my script if I leave it at that. Thanks for your help. Replace this: if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $Email)) { $result[0]=false; $result[1]="$Email is not properly formatted"; return $result; } To this: if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $Email)){ Echo "Invalid e-mail address"; } I put echo here it will give up the error with ease. I don't really need it to echo the error, though. I need it to completely execute the script and mail message A if its valid or message B if its invalid. I'm confused. Thanks again!
  6. Are you saying to replace that line in my code, or only use that snippet instead? B/C that doesn't validate very thoroughly alone and I Also don't see how to execute the next part of my script if I leave it at that. Thanks for your help.
  7. I'm sorry, did you come here to help or taunt me?
  8. I know what he meant, but he could have approached it a little better considering this is a HELP forum. The guy acted like I asked him to mow my lawn and paint my house.
  9. It executes as though the email address were invalid EVERYTIME even when testing with a valid email address.
  10. Forget to take your Midol today? All I asked for was some help finding the right script. I didnt ask you to write the whole thing for me. A point in the right direction would have been sufficient. I searched the forums here and elsewhere and found several similar topics, but none specific enough for what I needed. I also DID try to do it myself and obviously that didn't work either or I wouldn't be here asking for HELP in the PHP HELP FORUM! Also, I did ask "nicely," as even the title says "PLEASE!" I think you need a nap. For anyone else out there not feeling like a jerk tonight, here is where I tried to start from, using this script, but to no avail. Most of the script came from here: http://www.zend.com/zend/spotlight/ev12apr.php <?php $Name = $_REQUEST['Name']; $Email = $_REQUEST['Email']; $currentdate = date("F j, Y, g:i a"); $message1 = "This is my message!"; $message2 = "Email address given is invalid!"; $me = "myemail@myemail.com"; function ValidateMail($Email) { global $HTTP_HOST; $result = array(); if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $Email)) { $result[0]=false; $result[1]="$Email is not properly formatted"; return $result; } list ( $Username, $Domain ) = split ("@",$Email); if (getmxrr($Domain, $MXHost)) { $ConnectAddress = $MXHost[0]; } else { $ConnectAddress = $Domain; } $Connect = fsockopen ( $ConnectAddress, 25 ); if ($Connect) { if (ereg("^220", $Out = fgets($Connect, 1024))) { fputs ($Connect, "HELO $HTTP_HOST\r\n"); $Out = fgets ( $Connect, 1024 ); fputs ($Connect, "MAIL FROM: <{$Email}>\r\n"); $From = fgets ( $Connect, 1024 ); fputs ($Connect, "RCPT TO: <{$Email}>\r\n"); $To = fgets ($Connect, 1024); fputs ($Connect, "QUIT\r\n"); fclose($Connect); if (!ereg ("^250", $From) || !ereg ( "^250", $To )) { $result[0]=false; $result[1]="Server rejected address"; return $result; } } else { $result[0] = false; $result[1] = "No response from server"; return $result; } } else { $result[0]=false; $result[1]="Can not connect E-Mail server."; return $result; } $result[0]=true; $result[1]="$Email appears to be valid."; return $result; } // end of function if ($result == "$Email appears to be valid.") { mail( $email_list, "Thank you for registering!", $message1, "From: $me" ); header( "Location: http://www.mywebsite.com ); } else { mail( $email_list, "$username is an Invalid Email address ", $message2, "From: $me" ); header( "Location: http://www.mywebsite.com" ); };
  11. OK, so I'm trying to have a script that is used as an action script for a simple HTML form. The HTML form will simply have a field to enter an email address. The HTML Form action will use "emailvalidate.php". I need for the PHP script to validate a REAL email addres. I have tried other scripts on the internet, but no luck. Upon validation, here is what I need executed: if (validation == "true") { mail( $email_list, "Thank you for registering!", $message1, "From: $me" ); header( "Location: http://www.mywebsite.com ); } else { mail( $email_list, "$username is an Invalid Email address ", $message2, "From: $me" ); header( "Location: http://www.mywebsite.com" ); }; So upon validation, if the email is valid, it will send Message A to the email in question, me and a third party. If it is invalid, it will instead send Message B to me and a third party stating the email was invalid. I would like for the validation to be as extensive as possible, while remaining functional for ALL email addresses. I've noticed some validation is very extensive, but will only work for pop3 addresses. So I guess I just want to be thorough while remaining inclusive to all addresses. Thanks in advance! ???
  12. Thanks, but I'm having problems with how to write the code to merge with the current function of the form. Would you, or anyone else, mind showing me how I need to write the code? I can live without the numbering thing, but I need to get the text log file set up. Thanks again!
  13. If it matters, here is the line on the html form that sends it to process the form: <form name="formname" method="post" action="/folder/formprocess.php">
  14. Ok, so I have a basic HTML form set up to be processed via "formprocessor.php" "formprocessor.php" collects the user submitted data and emails it to the appropriate email address depending on which person is selected on the form. My question is this: I would like to have the data posted to a text file simultaneously in order to log each instance of the form being submitted. So, say a person fills out the following on a form: Name:  John Doe Email:  john@doe.com Phone:  123-456-7890 Address:  123 John Doe Street Then they select the appropriate representative to send it to via a drop-down list on the same form, so lets say they select to send it to "Bob Doe" The form would then email "Bob Doe" the collected data. I would like to have it also simultaneously post a new entry to a basic text file (or equivalent). So everytime they select "Bob Doe" it also writes a new entry with the same info to "bobdoe.txt" If they select "Jane Doe" it would write it to "janedoe.txt" and so on and so forth. Can this be done simulatenously by using the same submit button that is used to process the email script?  Also, if there was a way for it to precede each new entry by a single-digit increasing number that would be great, too. Im guessing this can be done using the fopen, fwrite or something similar, but I cant get it figured out. Any help is greatly appreciated.  Thanks in advance.  ???
×
×
  • 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.