TheOne6152's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
36 (0.02 per day)
Joined:
11-February 09
Profile Views:
1,163
Last Active:
User is offline Feb 24 2013 03:25 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0

Latest Visitors

Icon   TheOne6152 has not set their status

Posts I've Made

  1. In Topic: How do I read user input (char) into an array?

    Posted 24 Feb 2013

    But how would I read each char into the array using a loop?
  2. In Topic: PHP mail form getting spam

    Posted 3 May 2012

    never mind on that last post. I finally got it. All I did was get your [CTphpnwb] code and where you wrote mess i put parenthesis and now it works perfect. Thankyou everyone for all the help. :)
  3. In Topic: PHP mail form getting spam

    Posted 3 May 2012

    View PostCTphpnwb, on 03 May 2012 - 02:19 PM, said:

    It wasn't intended to do anything different from your code. It was intended to clean it up a bit. It could still use more cleaning, and then some organization. The idea is to first make your code readable, then you can begin to think about whether or not it works.

    I am very grateful for your help, but right now i'm just trying to get it to work as soon as I can. I'm going to take your advice though and clean it up. But if anyone else could help me out with this, I would appreciate it.
  4. In Topic: PHP mail form getting spam

    Posted 3 May 2012

    View PostCTphpnwb, on 03 May 2012 - 11:37 AM, said:

    It appears to be working from here, but mail() only passes the message to your mail server. There's no way for it to know if the message was actually sent or received.

    Below is untested, but hopefully it will give you an idea about getting rid of repetitive code:
    <?php
    $message = <<<mess
    Name: !name \n
    Sex: !sex \n
    Age: !age \n 
    Birth Date: !birthdate \n
    Grade: !grade \n
    School: !school \n
    
    Insurance: !insurance \n
    Insurance Phone:!insphone \n
    Physician:!physician \n
    Physician Phone:!physphone \n
    Medican Condition: !medcon \n
    Other Medical Conditions: !medicalconditions \n
    
    Mother: !mothername \n
    E-Mail: !motheremail \n
    Work Phone: !motherwork \n
    Cell Phone: !mothercell \n
    Home Phone: !motherhome \n
    Employment: !motheremployment \n
    Address: !motheraddress \n
    Mother Permitted to pick up participant(s): !motherpickup \n
    
    Father: !fathername \n
    E-Mail: !fatheremail \n
    Work Phone: !fatherwork \n
    Cell Phone: !fathercell \n
    Home Phone: !fatherhome \n
    Employment: !fatheremployment \n
    Address: !fatheraddress \n
    Father Permitted to pick up participant(s): !fatherpickup \n
    
    Emergency Contact #1: !emergencyname1 \n
    Phone Number: !emegencyphone1 \n
    
    Emergency Contact #1: !emergencyname2 \n
    Phone Number: !emegencyphone2 \n
    
    Half Day or Full Day: !halforfull \n
    Plan: !plan \n
    Weeks: !week \n
    Other Dates: !other \n
    mess; // I'd read this in from a text file or database to keep it from cluttering the code.
    
    
    require_once('captcha/recaptchalib.php');
      $privatekey = "******";
      $resp = recaptcha_check_answer ($privatekey,
                                    $_SERVER["REMOTE_ADDR"],
                                    $_POST["recaptcha_challenge_field"],
                                    $_POST["recaptcha_response_field"]);
    
      if (!$resp->is_valid) {
        // What happens when the CAPTCHA was entered incorrectly
        die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
             "(reCAPTCHA said: " . $resp->error . ")");
      } else {
        // Your code here to handle a successful verification
    $expected_keys = array("name","sex","age","age","birthdate","birthdate","grade", "school","exptype", "expyears", 'insurance', 'insphone' , 'physician' , 'physphone', 'medcon', 'medicalconditions', 'mothername', 'motheremail', 'motherwork', 'mothercell', 'motherhome', 'motheremployment', 'motheraddress', 'motherpickup', 'fathername', 'fatheremail', 'fatherwork', 'fathercell', 'fatherhome', 'fatheremployment', 'fatheraddress', 'fatherpickup', 'emergencyname1', 'emegencyphone1', 'emergencyname2', 'emegencyphone2', 'halforfull', 'plan', 'other');
    $subject = " - FUTSOC Summer Soccer Program";
    $strip = array("name",/* email, <--- is missing!*/ 'mothername', 'motheremail', 'fathername', 'fatheremail');
    $replace = array();
    $with = array();
    foreach($expected_keys as $key) {
    	if(isset($_POST[$key])) {
    		if(in_array($key, $strip)) {
    			$with[] = stripslashes($_POST[$key]);
    		} else {
    			$with[] = $_POST[$key];
    		}
    		$replace[] = '!'.$key;
    	}
    }
    $week = '';
    foreach($_POST['week'] as $value) {
    	$week .= $value;
    }
    $with[] = "!week";
    $replace[] = $week;
    
    
    $from = "From: ".$_POST['motheremail'];
    $message = str_replace($replace, $with, $message);
    mail("youremail@yourhost.com", $subject, $message, $from);
    
    header ("location:http://www.futsocusa.net/fundingsummer.html"); 
      }
    ?>
    
    

    Okay I tried yours and it doesn't work either. one thing I noticed was that the one I made redirected me to the other page. the one you gave me just went to the submit_form.php page. Anything else someone can come up with? I'm sorry for my lack of knowledge on this, I'm just new to PHP.
  5. In Topic: PHP mail form getting spam

    Posted 3 May 2012

    Okay so I signed up for captcha and installed it and everything, but when I test the form it doesnt send it to my e-mail.

    Again, I greatly appreciate all your help guys.

    Here is where the new form is located: http://www.futsocusa...egistration.php
    Here is the php code
    <?php
    
    require_once('captcha/recaptchalib.php');
      $privatekey = "******";
      $resp = recaptcha_check_answer ($privatekey,
                                    $_SERVER["REMOTE_ADDR"],
                                    $_POST["recaptcha_challenge_field"],
                                    $_POST["recaptcha_response_field"]);
    
      if (!$resp->is_valid) {
        // What happens when the CAPTCHA was entered incorrectly
        die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
             "(reCAPTCHA said: " . $resp->error . ")");
      } else {
        // Your code here to handle a successful verification
    
    $subject =  $name . " - FUTSOC Summer Soccer Program"; 
    $name = $_POST["name"];
    $sex = $_POST['sex'];
    $age = $_POST["age"]; 
    $birthdate = $_POST["birthdate"];
    $grade = $_POST["grade"];
    $school = $_POST["school"];
    $exptype = $_POST["exptype"];
    $expyears = $_POST["expyears"];
    $insurance = $_POST["insurance"];
    $insphone = $_POST["insphone"]; 
    $physician = $_POST["physician"]; 
    $physphone = $_POST["physphone"];
    $medcon = $_POST["medcon"];
    $medicalconditions = $_POST["medicalconditions"];
    $mothername = $_POST["mothername"];
    $motheremail = $_POST["motheremail"];
    $motherwork = $_POST["motherwork"];
    $mothercell = $_POST["mothercell"];
    $motherhome = $_POST["motherhome"];
    $motheremployment = $_POST["motheremployment"];
    $motheraddress = $_POST["motheraddress"];
    $motherpickup = $_POST["motherpickup"];
    $fathername = $_POST["fathername"];
    $fatheremail = $_POST["fatheremail"];
    $fatherwork = $_POST["fatherwork"];
    $fathercell = $_POST["fathercell"];
    $fatherhome = $_POST["fatherhome"];
    $fatheremployment = $_POST["fatheremployment"];
    $fatheraddress = $_POST["fatheraddress"];
    $fatherpickup = $_POST["fatherpickup"];
    $emergencyname1 = $_POST["emergencyname1"];
    $emegencyphone1 = $_POST["emegencyphone1"];
    $emergencyname2 = $_POST["emergencyname2"];
    $emegencyphone2 = $_POST["emegencyphone2"];
    $halforfull = $_POST["halforfull"];
    $plan = $_POST["plan"];
    foreach($_POST['week'] as $value) {
    $week .= "$value";
    }
    $other = $_POST["other"];
    
    $name = stripslashes($name); 
    $email = stripslashes($email); 
    $mothername = stripslashes($mothername);
    $motheremail = stripslashes($motheremail);
    $fathername = stripslashes($fathername);
    $fatheremail = stripslashes($fatheremail);
    
    $message = "
    Name: $name \n
    Sex: $sex \n
    Age: $age \n 
    Birth Date: $birthdate \n
    Grade: $grade \n
    School: $school \n
    
    Insurance: $insurance \n
    Insurance Phone:$insphone \n
    Physician:$physician \n
    Physician Phone:$physphone \n
    Medican Condition: $medcon \n
    Other Medical Conditions: $medicalconditions \n
    
    Mother: $mothername \n
    E-Mail: $motheremail \n
    Work Phone: $motherwork \n
    Cell Phone: $mothercell \n
    Home Phone: $motherhome \n
    Employment: $motheremployment \n
    Address: $motheraddress \n
    Mother Permitted to pick up participant(s): $motherpickup \n
    
    Father: $fathername \n
    E-Mail: $fatheremail \n
    Work Phone: $fatherwork \n
    Cell Phone: $fathercell \n
    Home Phone: $fatherhome \n
    Employment: $fatheremployment \n
    Address: $fatheraddress \n
    Father Permitted to pick up participant(s): $fatherpickup \n
    
    Emergency Contact #1: $emergencyname1 \n
    Phone Number: $emegencyphone1 \n
    
    Emergency Contact #1: $emergencyname2 \n
    Phone Number: $emegencyphone2 \n
    
    Half Day or Full Day: $halforfull \n
    Plan: $plan \n
    Weeks: $week \n
    Other Dates: $other \n
    ";
    
    $from = "From: $motheremail";
    
    mail("youremail@yourhost.com", $subject, $message, $from);
    
    header ("location:http://www.futsocusa.net/fundingsummer.html"); 
      }
    ?>
    
    

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

TheOne6152 hasn't added any friends yet.

Comments

TheOne6152 has no profile comments yet. Why not say hello?