Jump to content

moise

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

moise's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi, nearly there! :) the only error i am getting is, it does recognise my email. i am not getting the "please enter an email address" but i am getting "Please enter a valid email address" any ideas on how to solve this current problem please? i checked the mail validation and it seems correct to me. many thanks.
  2. thanks kingphilip, i did the changes before... the error was in here in fact. [code]} else {   echo "OH NOOOO!"; } [/code] i had to just delete it. but the bad new is it sends email, but i get the mailer.php page the following wierd message [quote] Please enter your Name and/or Surname ! Please enter a subject title ! Please enter an email Thanks , Your message has been submitted ! Click here to continue [/quote] this happened, when i tried to both send a empty form and a form with just the email field filled, meaning doesn't check my form fields for validation. how did i managed that ??? ? ??? ? These are the php details of my form. [code] form action="mailer.php" method="post"> <input type="text" name="name" value="<? echo $name; ?>" size="30" /> <input  type="text" name="email" value="<? echo $email; ?>" size="30" /> <input  type="text" name="subject" value="<? echo $subject; ?>" size="30" /> <textarea  name="message" cols="25" rows="4"></textarea> <input type="submit" value="Send" name="submit" class="button" /> <input type="reset" value="Reset" class="button" /> [/code] many thanks again.
  3. thanks Nhoj but i am still getting the parse error : syntax error, unexpected T_STRING on line 17 i have no clue on this...
  4. thanks matt, this is what i came up with: [code]<?php if(isset($_POST['submit'])) {   $to = "moisea@yahoo.com, moise_tavares@yahoo.com";     $subject = $_POST['subject'];   $name_field = $_POST['name'];   $email_field = $_POST['email'];   $message = $_POST['message'];   $body = "$message";   $continue = "/"; // homepage or "mypage.htm" or "http://www.elsewhere.com/page.htm"   // email validation   $error_msg='';           if(trim($name)==''{               $error_msg.="Please enter your Name and/or Surname !<br>";     }           if(trim($subject)=='' {               $error_msg.="Please enter a subject title !<br>";     } if(trim($email_input)=='') {           $error_msg.="Please enter an email<br>";     } else {           // check if email is a valid address in this format username@domain.com           if(!ereg("[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]", $email_input)) $error_msg.="Please enter a valid email address<br>";     }             // display error message if any, if not, proceed to other processing       if($error_msg==''){           // other process here       } else {           echo "<font color=red>$error_msg</font>";       } } mail($to, $subject, $body); } else { echo "OH NOOOO!"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <div id="contact-message"> <!--Thank you <b><?php $name_field ?></b> <br>Your message has been sent to <b><?php $to ?></b> <p><a href="<?php print $continue; ?>">Click here to continue</a></p> --> <?php echo "Thanks <b>$name_field</b>, Your message has been submitted to <b>$to</b>!"; ?><p><a href="<?php print $continue; ?>">Click here to continue</a></p> </div> </body> </html> [/code] but i am getting this parse error:[quote]Parse error: syntax error, unexpected '{' in /home/.malcsi/myusername/myweb.com/mailer.php on line 16[/quote] when i deleted the "{" i get the following parse too.[quote]Parse error: syntax error, unexpected T_VARIABLE in /home/.malcsi/myusername/myweb.com/mailer.php on line 17[/quote] can someone help me fix this problem please? many thanks.
  5. i sorted [quote]how will i make the messages display on a new page message.php for exple.[/quote] but still have a problem of verification of fields. this is what i've got for the email verificaton, but doen't seem right because it keep telling me that my email address is invalid.here's the code [code]<?php // Function  email address validation checking   function isValidEmail($email){       $pattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$";           if (eregi($pattern, $email)){         return true;       }       else {         return false;       }    }         if (isset($_POST['submit']))         {             if (isValidEmail($_POST['email'])){                 echo "The email: ".$_POST['email']." is valid! ";             }             else{                 echo " The email: ".$_POST['email']." is invalid! ";             }         }       ?>[/code] any idea how to verify an text field too? many thanks.
  6. thanks jesirose it works, but how will i make the messages display on a new page message.php for exple. i also notice this form sends emails without any field being filled how would i make a stop on it. sorry might be dumb questions but i am new. i started a server sidec email verification function[code]// Function  email address validation checking   function isValidEmail($email){       $pattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$";           if (eregi($pattern, $email)){         return true;       }       else {         return false;       }    }[/code] but it seems that does not stop it from sending bank email . many thanks.
  7. hello i am trying to build a contact form but i am having the following problem and wonder if anyone could help. i need to the contact form to able to show success or error message in a new page and verify if all fields have been filled, how do i do that please? [code]<?php if(isset($_POST['submit'])) {   $to = "user1@yahoo.com, user2@yahoo.com";       $name_field = $_POST['name'];   $email_field = $_POST['email'];   $subject = $_POST['subject'];   $message = $_POST['message'];   $body = "$message";   $continue = "/"; // will send me to my  homepage [b]echo "Thanks $name_field, Your message has been submitted to $to!"; <p><a href="<?php print $continue; ?>">Click here to continue</a></p>"[/b] // i need to display the lines above in a new page mail($to, $subject, $body); } else { echo "OH NOOOO!"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> </body> </html> [/code] i am getting the following error: [quote]Parse error: syntax error, unexpected $end in /home/.malcsi/moisea66/tyreese.upfrontec.com/mailer.php on line 39[/quote] many thanks.
  8. hello, i am trying to get my email to show just the message entered on my textarea, how would i get to do that? Because i am getting the following : name: mymane email: mymane@yahoo.com subject: test again.... message: testing! hope it'll be ok, this time, this time submit: Send instead of just the message posted (testing! hope it'll be ok, this time, this time) could you please help? here's the code... ---- $my_email = "myemail@yahoo.com"; $errors = array(); if($_SERVER['REQUEST_METHOD'] == "POST"){$form_input = $_POST;}elseif($_SERVER['REQUEST_METHOD'] == "GET"){$form_input = $_GET;}else{exit;} function build_message($request_input){if(!isset($message_output)){$message_output = "";}if(!is_array($request_input)){$message_output = $request_input;}else{foreach($request_input as $key => $value){if(!is_numeric($key)){$message_output .= "\n\n".$key.": ".build_message($value);}else{$message_output .= "\n\n".build_message($value);}}}return $message_output;} $message = build_message($form_input); $message = $message . "\n\n-- \nThank you for using  http://tyreesetavares.com"; $message = stripslashes($message); $subject = $_POST['subject']; $headers = "From: " . $form_input['email'] . "\n" . "Return-Path: " . $form_input['email'] . "\n" . "Reply-To: " . $form_input['email'] . "\n"; mail($my_email,$subject,$message,$headers); -------
  9. hello i am, looking for a news system tutorials that has a more link. i've  seen this one [url=http://www.phpfreaks.com/quickcode/Article-content-in-the-front-page/526.php]http://www.phpfreaks.com/quickcode/Article-content-in-the-front-page/526.php[/url]but doesn't seem complete. any ideas where to find a simple one. many thanks guys!
  10. come on please! LOL ...any help would be appreciated...desparate here!
  11. hi, i was using test files to display some of my website contents[code]<div id="content"> <p> <?php $filename="mypagecontent.txt"; $fp=fopen ($filename, "r") or die ("Couldn't open $filename"); while (! feof ($fp)) { $line = fgets ($fp, 1024); print "$line<br>"; } ?> </p> </div>[/code], however, i have a page were i would like to display several contents (7) at the same place with pagination. all files are in a folder and i would please like some help to sort this out. any help is welcome... many thanks.
  12. hi, i would like to know how to get the a php pagination for txt files as shown below [code]<?php $filename="mycontent.txt"; $fp=fopen ($filename, "r") or die ("Couldn't open $filename"); while (! feof ($fp)) { $line = fgets ($fp, 1024); print "$line<br>"; } ?>[/code] i need a php pagination please, as i have about 7 .txt files to display on different pages. any ideas on how to get this sorted? many thanks for having a look.
  13. hello, can anyone help me on how to set my rows back to 1 after testing? it starts with numbers like 12. help please!
×
×
  • 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.