/    Sign up×
Community /Pin to ProfileBookmark

Need help for PHP and CLASSIPRESS THEME WORDPRESS

Hello

I use wordpress and classipress 3.1.5 but i want change the contact form in my ads, i m searching i can edit that line to include my email adresss (ADMIN) in it
But how?

I want all emails go to me

But i try to replace cp_contact_ad_owner_email($post->ID);

with $mailto = ‘[email protected]‘;

NO WORK !

I RECEIVE NOTHING!

Please help me

HERE THE CODE:

<?php

/**
* This is the sidebar contact form used on the single ad page
*

*/

$msg = ”;

// if contact form has been submitted, send the email
if (isset($_POST[‘submit’]) && $_POST[‘send_email’] == ‘yes’) {

// get the submitted math answer
$rand_post_total = (int)$_POST[‘rand_total’];

// compare the submitted answer to the real answer
$rand_total = (int)$_POST[‘rand_num’] + (int)$_POST[‘rand_num2’];

// if it’s a match then send the email
if ($rand_total == $rand_post_total) {
cp_contact_ad_owner_email($post->ID);
$msg = ‘<p class=”green center”><strong>’ . __(‘Your message has been sent!’, ‘appthemes’) . ‘</strong></p>’;
} else {
$msg = ‘<p class=”red center”><strong>’ . __(‘ERROR: Incorrect captcha answer’, ‘appthemes’) . ‘</strong></p>’;
}

}

?>

<form name=”mainform” id=”mainform” class=”form_contact” action=”#priceblock2″ method=”post” enctype=”multipart/form-data”>

<?php echo $msg; ?>

<p class=”contact_msg”><?php _e(‘To inquire about this ad listing, complete the form below to send a message to the ad poster.’, ‘appthemes’) ?></p>

<ol>
<li>
<label><?php _e(‘Name:’, ‘appthemes’) ?></label>
<input name=”from_name” id=”from_name” type=”text” minlength=”2″ value=”<?php if(isset($_POST[‘from_name’])) echo esc_attr( stripslashes($_POST[‘from_name’]) ); ?>” class=”text required” />
<div class=”clr”></div>
</li>

<li>
<label><?php _e(‘Email:’, ‘appthemes’) ?></label>
<input name=”from_email” id=”from_email” type=”text” minlength=”5″ value=”<?php if(isset($_POST[‘from_email’])) echo esc_attr( stripslashes($_POST[‘from_email’]) ); ?>” class=”text required email” />
<div class=”clr”></div>
</li>

<li>
<label><?php _e(‘Subject:’, ‘appthemes’) ?></label>
<input name=”subject” id=”subject” type=”text” minlength=”2″ value=”<?php _e(‘Re:’, ‘appthemes’) ?> <?php the_title();?>” class=”text required” />
<div class=”clr”></div>
</li>

<li>
<label><?php _e(‘Message:’, ‘appthemes’) ?></label>
<textarea name=”message” id=”message” rows=”” cols=”” class=”text required”><?php if(isset($_POST[‘message’])) echo esc_attr( stripslashes($_POST[‘message’]) ); ?></textarea>
<div class=”clr”></div>
</li>

<li>
<?php
// create a random set of numbers for spam prevention
$randomNum = ”;
$randomNum2 = ”;
$randomNumTotal = ”;

$rand_num = rand(0,9);
$rand_num2 = rand(0,9);
$randomNumTotal = $randomNum + $randomNum2;
?>
<label><?php _e(‘Sum of’, ‘appthemes’) ?> <?php echo $rand_num; ?> + <?php echo $rand_num2; ?> =</label>
<input name=”rand_total” id=”rand_total” type=”text” minlength=”1″ value=”” class=”text required number” />
<div class=”clr”></div>
</li>

<li>
<input name=”submit” type=”submit” id=”submit_inquiry” class=”btn_orange” value=”<?php _e(‘Send Inquiry’,’appthemes’); ?>” />
</li>

</ol>

<input type=”hidden” name=”rand_num” value=”<?php echo $rand_num; ?>” />
<input type=”hidden” name=”rand_num2″ value=”<?php echo $rand_num2; ?>” />
<input type=”hidden” name=”send_email” value=”yes”/>

</form>[/COLOR]

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @PHILIO spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...