teamsilvamma's Profile User Rating: -----

Reputation: -2 Dishonored
Group:
Active Members
Active Posts:
153 (0.16 per day)
Joined:
17-January 12
Profile Views:
1,702
Last Active:
User is offline Feb 04 2014 09:13 PM
Currently:
Offline

Previous Fields

Country:
BR
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
Playstation
Your Car:
Dodge
Dream Kudos:
0
Icon   teamsilvamma has not set their status

Posts I've Made

  1. In Topic: subject and comment are not transferring

    Posted 4 Feb 2014

    doi!!! ::Slap to forehead:: It's always the smallest thing....sigh

    Thank you so much
  2. In Topic: email.php script is not sending.

    Posted 18 Jan 2014

    I realized I didn't change it in the actual message compile until I tested it a second time and didn't work. But I fixed that. And then I learned that I couldn't concatenate all the values in one validation statement. SO I fixed that as well and so far I only have the name and email being validated. Although I should have the phone number and websites validated as well. I'll do the research on that unless you'd like to teach me.

    As far as the conditional statement, I know it is pretty straight forward, I just was wondering where do I need to do this in the code?

    But I do have one question for you if you don't mind me asking so much help. I have a series of checkboxes that the user can choose one, or more. I need both options to compile in the email if he picked two our of four.

    And the file upload is sending the word "Array" in the email, instead of the actual photo

    Thanks for your help.

    This is what I have now by the way

    
    
    <?php
    if(isset($_POST['email'])) {
        
        // EDIT THE 2 LINES BELOW AS REQUIRED
        $email_to = "email@email.com";
        $email_subject = "Your email subject line";
    
         
        function died($error) {
            // your error code can go here
            echo "We are very sorry, but there were error(s) found with the form you submitted. ";
            echo "These errors appear below.<br /><br />";
            echo $error."<br /><br />";
            echo "Please go back and fix these errors.<br /><br />";
            die();
        }
    
        // validation expected data exists
        if(!isset($_POST['full_name'],$_POST['email'],$_POST['telephone'],$_POST['company'],$_POST['industry'],$_POST['website']) ||
            !isset($_POST['web-design'],$_POST['web_marketing'],$_POST['graphic_design']) || 
    	  !isset($_POST['purpose'],$_POST['domain'],$_POST['inspiration']) ||
    	  !isset($_POST['date_due'],$_FILES['file1'],$_FILES['file2'],$_FILES['file3'])) {
    		  		  
            died('We are sorry, but there appears to be a problem with the form you submitted.');       
        }
              
        $error_message = "";
          $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
      	if(!preg_match($email_exp,$_POST['email'])) {
        		$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
      	} 
        	$string_exp = "/^[A-Za-z .'-]+$/";
      	if(!preg_match($string_exp,$_POST['full_name'])) {
       		$error_message .= 'Invalid Entry. Try Again Please.<br />';
      	}
      	if(strlen($error_message) > 0) {
        		died($error_message);
      	}
        $email_message = "Form details below.\n\n";
        
        function clean_string($string) {
          $bad = array("content-type","bcc:","to:","cc:","href");
          return str_replace($bad,"",$string);
        }
           
        $email_message .= "Full Name: ".clean_string($_POST['full_name'])."\n";
        $email_message .= "Email: ".clean_string($_POST['email'])."\n";
        $email_message .= "Telephone: ".clean_string($_POST['telephone'])."\n";
        $email_message .= "Company: ".clean_string($_POST['company'])."\n"; 
        $email_message .= "Industry: ".clean_string($_POST['industry'])."\n";
        $email_message .= "Website: ".clean_string($_POST['website'])."\n";
        $email_message .= "Web design project requested: ".clean_string($_POST['web-design'])."\n";
        $email_message .= "Web marketing project requested: ".clean_string($_POST['web_marketing'])."\n";
        $email_message .= "Graphic design project requested: ".clean_string($_POST['graphic_design'])."\n";
        $email_message .= "Purpose for project: ".clean_string($_POST['purpose'])."\n"; 
        $email_message .= "Domains desired: ".clean_string($_POST['domain'])."\n"; 
        $email_message .= "Websites of Inspiration: ".clean_string($_POST['inspiration'])."\n";  
        $email_message .= "Due by: ".clean_string($_POST['date_due'])."\n";  
        $email_message .= "File 1: ".clean_string($_FILES['file1'])."\n"; 
        $email_message .= "File 2: ".clean_string($_FILES['file2'])."\n";
        $email_message .= "File 3: ".clean_string($_FILES['file3'])."\n"; 
            
         
    // create email headers
    $headers = 'From: '.$_POST['email']."\r\n".
    'Reply-To: '.$_POST['email']."\r\n" .
    'X-Mailer: PHP/' . phpversion();
    @mail($email_to, $email_subject, $email_message, $headers); 
    header('location: /index.php'); 
    die();
    ?>
     
    <!-- include your own success html here -->
    
    Thank you for contacting us. We will be in touch with you very soon.
     
    <?php
    }
    ?>
    
    
    
  3. In Topic: email.php script is not sending.

    Posted 18 Jan 2014

    @Atli,

    Great pointers. I rewrote it a bit and concantanated the issets as well, but I am still a little unclear on the conditional statement you suggested here

    
    if (mail(...)) {
        // Success. Relocate or include a success message.
    
    }
    
    else {
    
        // Failure. Show an error message or something, and
    
        // log the error somewhere.
    
    }
    
    
    
    


    This is what I did now. Can you help me further? I am very interested in your comment

    
    <?php
    if(isset($_POST['email'])) {
        
        // EDIT THE 2 LINES BELOW AS REQUIRED
        $email_to = "an email.com";
        $email_subject = "Your email subject line";
    
         
        function died($error) {
            // your error code can go here
            echo "We are very sorry, but there were error(s) found with the form you submitted. ";
            echo "These errors appear below.<br /><br />";
            echo $error."<br /><br />";
            echo "Please go back and fix these errors.<br /><br />";
            die();
        }
    
        // validation expected data exists
        if(!isset($_POST['full_name'],$_POST['email'],$_POST['telephone'],$_POST['company'],$_POST['industry'],$_POST['website'] ) ||
            !isset($_POST['web-design'],$_POST['web_marketing'],$_POST['graphic_design']) || 
    	  !isset($_POST['purpose'],$_POST['domain'],$_POST['inspiration']) ||
    	  !isset($_POST['date'],$_POST['file1'],$_POST['file2'],$_POST['file3'])) {
    		  		  
            died('We are sorry, but there appears to be a problem with the form you submitted.');       
        }
              
        $error_message = "";
        $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
      	if(!preg_match($email_exp,$_POST['email'])) {
        		$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
      	} 
        	$string_exp = "/^[A-Za-z .'-]+$/";
      	if(!preg_match($string_exp,$_POST['full_name'],$_POST['telephone'],$_POST['company'],$_POST['industry'],$_POST['website'])) {
       		$error_message .= 'Invalid Entry. Try Again Please.<br />';
      	}
      	if(strlen($_POST['purpose'],$_POST['inspiration'],$_POST['domain']) < 2) {
        		$error_message .= 'The Comments you entered do not appear to be valid.<br />';
      	}
      	if(strlen($error_message) > 0) {
        		died($error_message);
      	}
        $email_message = "Form details below.\n\n";
        
        function clean_string($string) {
          $bad = array("content-type","bcc:","to:","cc:","href");
          return str_replace($bad,"",$string);
        }
           
        $email_message .= "Full Name: ".clean_string($full_name)."\n";
        $email_message .= "Email: ".clean_string($email_from)."\n";
        $email_message .= "Telephone: ".clean_string($telephone)."\n";
        $email_message .= "Company: ".clean_string($company)."\n"; 
        $email_message .= "Industry: ".clean_string($industry)."\n";
        $email_message .= "Website: ".clean_string($website)."\n";
        $email_message .= "Web design project requested: ".clean_string($web_design)."\n";
        $email_message .= "Web marketing project requested: ".clean_string($web_marketing)."\n";
        $email_message .= "Graphic design project requested: ".clean_string($graphic_design)."\n";
        $email_message .= "Purpose for Project: ".clean_string($purpose)."\n"; 
        $email_message .= "Domains desired: ".clean_string($domain)."\n"; 
        $email_message .= "Websites of Inspiration: ".clean_string($inspiration)."\n";  
        $email_message .= "Due by: ".clean_string($date)."\n";  
        $email_message .= "File 1: ".clean_string($file1)."\n"; 
        $email_message .= "File 2: ".clean_string($file2)."\n";
        $email_message .= "File 3: ".clean_string($file3)."\n"; 
            
         
    // create email headers
    $headers = 'From: '.$email_from."\r\n".
    'Reply-To: '.$email_from."\r\n" .
    'X-Mailer: PHP/' . phpversion();
    @mail($email_to, $email_subject, $email_message, $headers); 
    header('location: /index.php'); 
    die();
    ?>
     
    <!-- include your own success html here -->
    
    Thank you for contacting us. We will be in touch with you very soon.
     
    <?php
    }
    ?>
    
    
    
  4. In Topic: url is generating a /#!/splash-page

    Posted 9 Nov 2013

    View PostMartyr2, on 09 November 2013 - 06:03 PM, said:

    It is being added from your john smith ajax portfolio theme. One instance you can find the use of the shebangs is in the switcher.js file that goes with this theme. At the top you will see it refer to the #!/splash-page


    I removed that line and it fixed the landing page. Which it's good but not great. When I go to other pages such as an about page the shebang comes back. Even with the switcher.js deleted. Apparently, it has some SEO benefits but it is being discussed in other forums as a bad practice. I personally do not like that a user can't simply type domain.com/about.html and the about page will show up. He has to add the shebang for it to work and let's be honest, how many people know about this or would remember adding it even if they knew about it.

    What do you suggest?
  5. In Topic: url is generating a /#!/splash-page

    Posted 9 Nov 2013

    Oh wow, I'm baffled! So you are telling me that the use of shebang is actually beneficial for SEO purposes?

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Location:
Sao Paulo, Brazil

Contact Information

E-mail:
Click here to e-mail me

Friends

teamsilvamma hasn't added any friends yet.

Comments

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