I develop in chrome, and i finally got this to work...
this morning i go to show it off and POOF, it dosen't work anymore!
This is on a wordpress install, so it had to be a little jury rigged.
Live Version: http://www.itsakstaging.com/wordpress/
Javascript:
$('#mail').submit(function(){
var emails = $("#email").val();
var phones = $("#phone").val();
var namels = $("#namel").val();
var namefs = $("#namef").val();
var messages = $("#message").val();
var actions = 'mailz';
var datas = {
action : actions,
email : emails,
phone : phones,
namel : namels,
namef : namefs,
message : messages
};
$.post(
'',
datas,
function( response ) {
$('#ajax').empty();
$('#ajax').hide();
$('#ajax').append(response);
$('#ajax').fadeIn(1500, function(){});
}
);
return false;
});
PHP Handler:
//wp_localize_script( 'mailz-ajax-request', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
if($_POST['action'] == 'mailz')mail_submit_koo();
function mail_submit_koo() {
$headers = 'From: '.$_POST['email']. "\r\n" .
'X-Mailer: PHP/' . phpversion();
if(mail(get_bloginfo('admin_email'), "Email from ".$_POST['namef']." ".$_POST['namel'], "Phone number: ".$_POST['phone']."\n\n ".$_POST['message'], $headers)) echo "Message Sent";
else echo "Message Send Failed";
die();
}
The handler is on the same page as the form that submits it
The form:
<?php $theme_options = get_option('ncubed'); ?>
<?php get_header(); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post();?>
<div id='main'>
<div id="content" class="full">
<h1><div><?php the_title(); ?></div></h1>
<?php the_content(__('Continue Reading...')); ?>
<div id="sidebar-contact">
<form class="anket-form" id="mail">
<fieldset>
<input type="hidden" name="submitMail" id="submitMail" value="y" />
<input class="text" type="text" name='namef' id="namef" value="first name" />
<input class="text" type="text" name='namel' id="namel" value="last name" />
<input class="text" type="text" name='email' id="email" value="email address" />
<input class="text" type="text" name='phone' id="phone" value="contact number" />
<textarea class="text-type" type="text" id="message" name='message' cols="" rows="">Message</textarea>
<div class="row">
<input class="submit" type="image" src="<?php bloginfo('template_directory');?>/images/btn-submit.gif" alt="sign up"/>
</div>
<div id='ajax'></div>
</fieldset>
</form>
</div>
<div id="content-contact">
<a href="http://www.twitter.com/<?php echo $theme_options['twitter'];?>"><img src="<?php bloginfo('template_directory');?>/images/twitter-facebook.png" alt="Twitter" /></a>
<a href="http://www.facebook.com/<?php echo $theme_options['facebook'];?>"><img src="<?php bloginfo('template_directory');?>/images/twitter-facebook2.png" alt="Facebook" /></a>
</div>
</div>
</div>
<?php endwhile; endif; ?>
<?php get_footer(); ?>

New Topic/Question
Reply



MultiQuote





|