HEX
Server: Apache/2.4.49 (FreeBSD) OpenSSL/1.0.2s-freebsd PHP/5.6.36
System: FreeBSD hosting.icon.bg 11.3-RELEASE-p13 FreeBSD 11.3-RELEASE-p13 #0: Tue Sep 1 06:56:51 UTC 2020 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
User: ftpuser (1002)
PHP: 5.6.36
Disabled: NONE
Upload Files
File: /hosting/kak.bg/web/wp-content/themes/Primero/contact-full-page.php
<?php
//If the form is submitted
if(isset($_POST['submit'])) {
	
	$to = get_progression('contact_email');
	$comments = $_POST['message'];

	//Check to make sure that the name field is not empty
	if(trim($_POST['contactname']) == '') {
		$hasError = true;
	} else {
		$name = trim($_POST['contactname']);
	}


	//Check to make sure sure that a valid email address is submitted
	if(trim($_POST['email']) == '')  {
		$hasError = true;
	} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) {
		$hasError = true;
	} else {
		$email = trim($_POST['email']);
	}

	//If there is no error, send the email
	if(!isset($hasError)) {
		$emailTo = $to; //Put your own email address here
		$body = "Name: {$name} \n\nEmail: {$email} \n\nComments:\n {$comments}";
		$headers = 'From: My Site <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email;

		mail($emailTo, 'Your Website Subject', $body, $headers);
		$emailSent = true;
	}
}
?>
<?php
// Template Name: Contact Page Full Width
get_header(); ?>
	<script type="text/javascript">
		jQuery(document).ready(function($){
			$("#contactform").validate();
		});
	</script>
<?php
			
		if(have_posts()) 
			while(have_posts()): 
				the_post();
?>
		
		
		<?php if (function_exists('progression_breadcrumbs')) progression_breadcrumbs(); ?>
		
		
		<div class="content-container">
			
			
				
			<div class="page-content">
				
				
				<?php
				if($post->post_parent) {
					$children = wp_list_pages('sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&depth=1&echo=0');
				}
				else {
					$children = wp_list_pages('sort_column=menu_order&title_li=&child_of=' . $post->ID . '&depth=1&echo=0');
				}

				if ($children) { ?>
				
				<ul class="sub-pagination">
					<?php if($post->post_parent): ?>
					<li><a href='<?php echo get_permalink($post->post_parent); ?>'><?php echo get_the_title($post->post_parent); ?></a></li>
					<?php else: ?>
					<li class="current_page_item"><a href='<?php echo get_permalink($post->ID); ?>'><?php echo get_the_title($post->ID); ?></a></li>
					<?php endif; ?>

					<?php echo $children; ?>
				</ul>
				<?php } else { ?>

				<?php } ?>
				
				

					<h1 class="page-title"><?php the_title(); ?></h1>
					
					
					<?php the_content(); ?>
					
					<div id="contact-wrapper">


						<?php if(isset($hasError)) { //If errors are found ?>
							<p class="error">Please check if you've filled all the fields with valid information. Thank you.</p>
						<?php } ?>

						<?php if(isset($emailSent) && $emailSent == true) { //If email is sent ?>
							<p class="success">Email Successfully Sent!</p>
							<p class="success2">Thank you <strong><?php echo $name;?></strong> for using my contact form! I will be in touch with you soon.</p>
						<?php } ?>

						<form method="post" action="<?php echo get_permalink(); ?>" id="contactform">
							<div>
							    <label for="name"><?php _e('Name','progressionstudios'); ?>:<span class="required">*</span></label>
								<input type="text" size="28" name="contactname" id="contactname" value="" class="required" />
							</div>

							<div>
								<label for="email"><?php _e('E-mail','progressionstudios'); ?>:<span class="required">*</span></label>
								<input type="text" size="28" name="email" id="email" value="" class="required email" />
							</div>

							<div>
								<label for="message"><?php _e('Message','progressionstudios'); ?>:</label>
								<textarea rows="10" cols="38" name="message" id="message"></textarea>
							</div>
						    <input type="submit" value="<?php _e('Send Message ','progressionstudios'); ?>" name="submit" class="button" />
						</form>
						</div><!-- close #contact-wrapper -->
					
					
					
					<div class="clearfix"></div>
					
					

				
				
				
				

				
				
				
				
			
			</div><!-- close .page-content -->
			
			
			</div><!-- close .sidebar-container -->
			
			
		</div><!-- close .content-container -->
		<div class="content-container-base">
		</div><!-- close .content-container-base or .content-container-base-pagination -->
		
		
	<?php
				endwhile;
			?>
	
<?php get_footer(); ?>