Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Aug 2013
    Posts
    157
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Simple email.php file not working

    Hi,

    Im trying to patch up one of our companies older sites as I am released the new version in a month or two. It is very outdated and the coding is very.. different.

    I had to redo the Quote Request form and instead of sending it through mailchimp since it was causing us so much problems I just did a simple 1 email html form.

    I think part of the problem might be this website is done very weird, and the page with the form on it is actually a "post" on wordpress inside of a post category where the category template has an iframe src that draws upon the form below.

    email.php
    Code:
    <?php
    		$email = "xxx@gmail.com";
    	
    		$to = $email;
    		$subj = "Request a Quote - xxx Website";
    		$firstName = $_POST['firstname'];
    		$lastName = $_POST['lastname'];
    		$jobTitle = $_POST['jobtitle'];
    		$org = $_POST['organization'];
    		$address = $_POST['address'];
    		$city = $_POST['city'];
    		$country = $_POST['scountry'];
    		$state = $_POST['tstate'];
    		$zip = $_POST['code'];
    		$phone = $_POST['phone'];
    		$email = $_POST['femail'];
    		$hear = $_POST['HearAbout'];
    		
    		$license1 = $_POST['license_type_1'];
    		$quant1 = $_POST['quantity_1'];
    		
    		$license2 = $_POST['license_type_2'];
    		$quant2 = $_POST['quantity_2'];
    		
    		$license3 = $_POST['license_type_3'];
    		$quant3 = $_POST['quantity_3'];
    		
    		$license4 = $_POST['license_type_4'];
    		$quant4 = $_POST['quantity_4'];
    		
    		$license5 = $_POST['license_type_5'];
    		$quant5 = $_POST['quantity_5'];
    		
    		$message = $_POST['txtComments'];
    	
    		$msg = "First Name: " . $firstName . "
    		Last Name: " . $lastName . "
    		Job Title: " . $jobTitle . "
    		Organization: " . $org . "
    		Address: " . $address . "
    		City: " . $city . "
    		Country: " . $country . "
    		State/Province: " . $state . "
    		Zip/Postal Code: " . $zip . "
    		Phone Number: " . $phone . "
    		Email Address: " . $email . "
    		How did you hear about us?: " . $hear . "
    		xxx + xxx (Windows XP/Vista/7) License Type: ". $license1 ." Quantity: ".$quant1."
    		xxx(Windows XP/Vista/7) License Type: ". $license2 ." Quantity: ".$quant2."
    		xxx (Max 10.4+) License Type: ". $license3 ." Quantity: ".$quant3."
    		xxx (Windows XP/Vista/7) License Type: ". $license4 ." Quantity: ".$quant4."
    		xxx License Type: ". $license5 ." Quantity: ".$quant5."
    		
    		
    		Message: " . $message;
    	
    	mail($to,$subj,$msg);
    
    ?>

    The Form
    Code:
    	<form id="div_form" action="../email.php" method="post" >
    		
    		<div id="down_table">
    			<div class="section">
    				<label for="firstname">First name*</label>
    				<input id="firstname" class="reg_info" type="text" placeholder="First Name" required><br>
    				
    				<label for="lastname">Last name*</label>
    				<input id="lastname" class="reg_info" type="text" placeholder="Last Name" required><br>
    				
    				<label for="jobtitle">Title</label>
    				<input id="jobtitle" class="reg_info" type="text" placeholder="Job Title"><br>
    				
    				<label for="organization">Org./School/Disctrict*</label>
    				<input id="organization" class="reg_info" type="text" placeholder="Org/School/District" required><br>
    				
    				<label for="address">Address*</label>
    				<input id="address" class="reg_info" type="text" placeholder="Address" required><br>
    				
    				<label for="city">City*</label>
    				<input id="city" class="reg_info" type="text" placeholder="City" required><br>
    				
    				<label for="scountry">Country*</label>
    				<select id="scountry" class="reg_info" required>
    				<option class="select_font" value="">Country</option>
    				<?php ShowCountryList(); ?>
    				</select><br>
    				
    				<label for="tstate">State/Province*</label>
    				<input id="tstate" type="text" class="reg_info" placeholder="State/Province" required><br>
    				
    				<label for="code">Zip/Postal Code</label>
    				<input id="code" class="reg_info" type="text" placeholder="Zip/Postal Code" required><br>
    				
    				<label for="phone">Phone*</label>
    				<input id="phone" class="reg_info" type="text" placeholder="Phone Number" required><br>
    				
    				<label for="femail">Email</label>
    				<input id="femail" class="reg_info" type="text" placeholder="Email Address" required><br>
    				
    				<label for="HearAbout">How did you hear about us?</label>
    				<select id="HearAbout" class="reg_info">
    					<option value="">Select One</option>
    					<?php ShowHearAboutList();?>
    					</select><br>
    			</div>
    		</div>
    
    		<h2>What Product Do You Want?</h2>
    		
    		<div class="section">
    			<p>Please note <b>wordQ+speakQ</b> is for PC users only. Mac users use <b>wordQ</b>.</p>
    			<p><a target="_parent" href="https://www.goqsoftware.com/buy/license-types/license-types/">Learn about license types</a></p>
    			
    			<label class="fullLengthLabel" for="license_type_1">wordQ+speakQ (Windows XP/Vista/7)</label><br />
    			<select id="license_type_1" class="reg_info quote_license">
    			<option value="" selected="selected">License Type</option>
    			<option>Single</option>
    			<option>Network</option>
    			</select>
    			
    			<input id="quantity_1" type="text" placeholder="Quantity" class="quote_quantity"><br /><br />
    			
    			<label class="fullLengthLabel" for="license_type_2">wordQ (Windows XP/Vista/7)</label><br />
    			<select id="license_type_2" class="reg_info quote_license">
    			<option value="" selected="selected">License Type</option>
    			<option>Single</option>
    			<option>Network</option>
    			</select>
    			
    			<input id="quantity_2" type="text" placeholder="Quantity" class="quote_quantity"><br /><br />
    			
    			<label class="fullLengthLabel" for="license_type_3">wordQ (Mac 10.4+)</label><br />
    			<select id="license_type_3" class="reg_info quote_license">
    			<option value="" selected="selected">License Type</option>
    			<option>Single</option>
    			<option>Network</option>
    			</select>
    			
    			<input id="quantity_3" type="text" placeholder="Quantity" class="quote_quantity"><br /><br />
    			
    			<label class="fullLengthLabel" for="license_type_4">speakQ (for current wordQ users only - Windows XP/Vista/7)</label><br />
    			<select id="license_type_4" class="reg_info quote_license">
    			<option value="" selected="selected">License Type</option>
    			<option>Single</option>
    			<option>Network</option>
    			</select>
    			
    			<input id="quantity_4" type="text" placeholder="Quantity" class="quote_quantity"><br /><br />
    			
    			<label class="fullLengthLabel" for="license_type_5">Microphone Model</label><br />
    			<select id="license_type_5" class="reg_info quote_license">
    			<option value="" selected="selected">Model</option>
    							<option value="185">185</option>
    							<option value="250V">250V</option>
    							<option value="185VM USB">185VM USB</option>
    			</select>
    			
    			<input id="quantity_5" type="text" placeholder="Quantity" class="quote_quantity"><br /><br />
    			
    			<label class="fullLengthLabel" for="txtComments">Comments</label>
    			<textarea id="txtComments" cols="40" rows="5" placeholder="Please enter any message up to 300 characters."></textarea>
    			
                <label for="SignUpNews">Sign up for news, updates, special offers and more</label>
    			<p><input type="checkbox" id="SignUpNews" checked="checked" value="Yes">
    
    			<div id="quoteFormButtons">
    			<button type="reset" value="Reset" class="quoteButtons">Reset</button>
    			<button type="submit" value="Submit" class="quoteButtons">Submit</button>
    			</div>
                </div>
    		</form>

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,269
    Thanks
    10
    Thanked 277 Times in 276 Posts
    What's mail() returning, have you checked? Have you tried putting in a "From:" header?

  • #3
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Is the site still a WordPress site?

    If so, see this plugin ...
    WordPress › Contact Form 7 « WordPress Plugins

  • #4
    Regular Coder
    Join Date
    Aug 2013
    Posts
    157
    Thanks
    23
    Thanked 0 Times in 0 Posts
    It is a wordpress site, however the guy who designed this site did it in a very odd way. The pages are not pages, they are posts. Each post has its own category which has its own template. The templates he coded himself and have ALL the code on it. I dont think I can put in a widget right into the template no?

  • #5
    Regular Coder
    Join Date
    Aug 2013
    Posts
    157
    Thanks
    23
    Thanked 0 Times in 0 Posts
    and I echoed the variables inside mail and it has all the information required to send the email.

    Also, I have checked the console and there is no errors relating to the form or email.php file. There is some errors in the console relating to linking of other jquery, and javascript files saying [blocked] the page at 'xxx' was loaded over HTTPS, but ran insecure content from 'xxx' : this content should also be loaded over https.

    but totally unrelated files.
    Last edited by 7daytheory; 05-13-2014 at 03:08 PM.

  • #6
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    With Contact Form 7, you can put "short code" into a post.
    When the post displays, that short code becomes an active form.

    It's free to use. Install the plug-in, follow the instructions.
    If you don't like it, or it doesn't work for you, simply delete the plugin.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •