Jump to content

smy101

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Everything posted by smy101

  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.  ???
  15. [quote author=thorpe link=topic=118574.msg484624#msg484624 date=1166081295] Just insert a timestamp into the database allong with the feedback. eg; [code] INSERT INTO feedback (feedback,datetime) VALUES ('$feedback',NOW()); [/code] [/quote] Thank you for such a quick response, but I'm confused on where you mean I should put that code. The form is not operating with a database.  Upon submit, it simply emails me the returned values. Basically I have an HTML form which upon "Submit" uses the php script to gather the values and email them to me.
  16. Could someone please show me the proper code to have a simple HTML/PHP form return the time and date the form was submitted for Central Time zone? I have a basic "feedback" form that I would like to also print out the exact date & time the form was submitted when it returns the rest of the information on the form. Thanks in advance for any help.
  17. I can't figure out how to stop it from sending me the HTML tags. Is there some way that I can set it up to strip starting at the "=" sign and isolating text forward until it hits the "<" and backwards until it hits the ">" brackets of the html tags? Thanks again for your help.
  18. [quote author=thorpe link=topic=109005.msg439108#msg439108 date=1158889925] How is the html getting into your form in the first place? You could try running it through [url=http://php.net/strip_tags]strip_tags[/url], but there might be a better way. It shouldn't really be there to start with is all. [/quote] I'm not entirely sure.  I used a PHP Form Generator that I found somewhere on the web.  I'll have to look around all the files to see if I can find out why.
  19. Ok, so I set up a basic HTML/PHP form for a user-submittable feedback form.  When the submission is emailed to me, it is in this form: [code] <font color=blue>Full Name</font> = John Doe <font color=blue>Phone Number = 1231231231 <font size=1 color=#FF0000>*</font><font color=blue>Email Address = john@johndoe.com [/code] What I would like to happen is to either filter it through another script or set up a seperate script that I can manually copy/paste into and the script will strip away the unneeded material.  I use to know how to do this but it escapes me now.  Basically I need a script that once submitted with the above code, will spit out something like: [b]Full Name = John Doe Phone Number = 1231231231 Email Address = john@johndoe.com[/b] Any suggestions on what code to use or if anyone knows of an existing script that I can modify, I would be greatly appreciative.
  20. [quote author=kenrbnsn link=topic=108540.msg436791#msg436791 date=1158613882] Do not use the full URL to include file that reside on your server. Just use the local file path: [code]<?php include('vary.php'); ?>[/code] Ken [/quote] That did it.  If you don't mind me asking (if you know), why does it behave that way?
  21. [quote author=Devil_Banner link=topic=108540.msg436776#msg436776 date=1158611830] Hi, I'm new at this myself.. ;but maybe you should try a "require" instead of "include" for your variable file Hope this helps. [/quote] Hi, thanks for the suggestion.  I tried that, but I get the same thing.  Any other suggestions?
  22. Ok, I'm pretty sure what I'm trying to do is simple b/c forever ago when I started learning PHP, I think I had it. Now, I'm catching hell, so someone please help and I'll dance at your wedding. Here's the scenario: I have my main page, which we'll call "main.php" for simplicity. I also have a seperate file for my common variables, we'll call it "vary.php". What I'm trying to do is include "vary.php" into "main.php" so that I can echo the variables in "main.php" but be able to change the "vary.php" file if need be. So, lets say "vary.php" looks like this: [code]<?php $email="myemail@mysite.com"; $phone="555-555-5555"; $fax="555-555-5555"; ?>[/code] Somewhere in "main.php" I try to call the $email variable like so:  [code]<?php echo"Email:";  echo"$email"; ?>[/code] However, it does not recognize the variable, and only shows "Email:              " Which tells me it's not reading my included "vary.php" file with the variables in it. The way I tried to do it was just like the other files I have included, like so: [code]<?php include("http://www.mysite.com/php/pages/vary.php"); ?>[/code] The other files on the "main.php" (such as "navigationbar.php" and "footer.php") work fine, but this one doesn't. So, my question is, how do I include (or whatever function I need to use) in order to have a seperate file for my standard variables, and be able to echo them on the "main.php" file? 1 Cookie to the first person that can help. 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.