• Resolved Leonardo T. Oliveira

    (@olivleonardo)


    Hi.

    I’m having trouble with a form contact page in my site. Here it is: http://manhattanmassage.com.br/contato.

    It was filled with PHP code by the original designer, and curiously I think I’m not getting to use formcontact plugin because this code imposes itself:

    <?php get_header(); ?>
    <div id="whitebox">
    
    <div class="whiteleft">
    		<h2>Contato</h2>
    <?php $mensagem = $_GET['msg'];
    		if ($mensagem == "ok") {
    		echo '<span style="display:block; padding:5px; border:1px solid green; margin:15px 0; font-weight:bold;">Mensagem enviada com sucesso! Aguarde nosso retorno.</span>';
    		}
    		elseif ($mensagem == "doh") {
    		echo '<span style="display:block; padding:5px; border:1px solid red; margin:15px 0; font-weight:bold;">Ocorreu um erro ao enviar sua mensagem. Verifique se seu e-mail está escrito corretamente e se todos os campos estão preenchidos e tente novamente.</span>';
    		}
    	$randomum = rand(1,5);
    	$randdois = rand(1,5);
    	$randres = $randomum + $randdois;
    		 ?>
    		<form id='xc_contato' action='<?php bloginfo('template_url'); ?>/send.php' method='post' class='wpcf7-form'>
    		<input type="hidden" name="rrandres" id="rrandres" value="<?php echo $randres; ?>" />
    		<label for="nome">Seu nome</label><br />
    			<input type="text" name="nome" id="nome" /><br /><br />
    			<label for="email">Seu e-mail para contato</label><br />
    			<input type="text" name="email" id="email" /><br /><br />
    			<label for="mensagem">Mensagem</label><br />
    			<textarea name="mensagem" id="mensagem"></textarea><br /><br />
    			<label for="rrand">Quanto é <?php echo $randomum." mais ".$randdois; ?>?</label><br />
    			<input type="text" name="rrand" id="rrand" /><br /><br />
    			<input type="submit" id="enviar" value="enviar" />
    		</form><!-- form -->
    		<p>Atenção: Seu endereço de IP será usado para identificar sua mensagem.</p>
    	</div><!-- white left -->
    (...)
    	</div><!-- white right -->
    	<hr />
    
    </div><!-- whitebox -->
    <?php get_footer(); ?>

    When somebody tries to fill the form and send a message, it leads to a non-existing /send.php page and nothing is sent.

    Does anybody have any idea about what is going on?

    Thank you very much!

    Leonardo Oliveira

Viewing 1 replies (of 1 total)
  • Thread Starter Leonardo T. Oliveira

    (@olivleonardo)

    Ok, it needed a

    <?php endwhile; ?>
    <?php endif; ?>	

    at the end. And now I got to use “form contact 7” plugin putting

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    at the header and using the page I had with the plugin code.

    \o/

Viewing 1 replies (of 1 total)

The topic ‘“send.php” error’ is closed to new replies.