PHP Contact Form


hello,

 

i'm confused. i've spent hours watching lynda.com tutorial on setting contact form , using zend framework manage emails. i'm lost , don't understand how doing protects security of email password tutorial shows need input email password code. protects password if view source code?

 

in event, i've abandoned lynda.com tutorial , followed appears far simpler approach in community feed. have contactus.php page , sendresults.php.

 

the contact page has following code:

 

<div class="contactform">

<form>

 

 

<form action="www.laropin.com/sendresults.php" method="post" name="contactform" id="contactform">

  <span id="spryfirstname">

  <input name="firstname" type="text" class="input" value="first name" maxlength="40">

  <span class="textfieldrequiredmsg">a value required.</span><span class="textfieldmaxcharsmsg">exceeded maximum number of characters.</span></span><br>

  <span id="sprylastname">

  <input name="lastname" type="text" class="input" value="last name" >

  <span class="textfieldrequiredmsg">a value required.</span><span class="textfieldmaxcharsmsg">exceeded maximum number of characters.</span></span><br>

  <span id="spryorganisation">

  <input name="organisation" type="text" class="input" value="organisation, college or university" maxlength="100">

  <span class="textfieldrequiredmsg">a value required.</span><span class="textfieldmaxcharsmsg">exceeded maximum number of characters.</span></span><br>

  <span id="spryemail">

  <input name="email" type="text" class="input" value="email">

  <span class="textfieldrequiredmsg">a value required.</span><span class="textfieldinvalidformatmsg">we expecting email address. please try again.</span><span class="textfieldmaxcharsmsg">exceeded maximum number of characters.</span></span><br>

  <span id="sprymessage">

  <textarea name="message" cols="" rows="17" class="input">we welcome thoughts , feedback , we'd delighted find collaborative research project. how can today?</textarea>

  <span id="countsprymessage"> </span><span class="textarearequiredmsg">a value required.</span><span class="textareamaxcharsmsg">we keep these messages short. talk detailed proposal? let know , we'll in touch.</span></span><br>

<input name="submit" type="button" class="buttons" value="submit">

 

 

</form></div>

 

 

the sendresults.php has following code:

 

<?php

//--------------------------set these paramaters--------------------------

 

 

// subject of email sent you.

$subject = 'results contact form';

 

 

// email address. form information sent.

$emailadd = 'hello@laropin.com';

 

 

// redirect after form processed.

$url = 'http://www.laropin.com';

 

 

// makes fields required. if set '1' no field can not empty. if set '0' or fields can empty.

$req = '1';

 

 

// --------------------------do not edit below line--------------------------

$text = "results form:\n\n";

$space = ' ';

$line = '

';

foreach ($_post $key => $value)

{

if ($req == '1')

{

if ($value == '')

{echo "$key empty";die;}

}

$j = strlen($key);

if ($j >= 60)

{echo "name of form element $key cannot longer 60 characters";die;}

$j = 60 - $j;

for ($i = 1; $i <= $j; $i++)

{$space .= ' ';}

$value = str_replace('\n', "$line", $value);

$conc = "{$key}:$space{$value}$line";

$text .= $conc;

$space = ' ';

}

mail($emailadd, $subject, $text, 'from: '.$emailadd.'');

echo '<meta http-equiv=refresh content="0; url='.$url.'">';

?>

 

 

?>

 

when view contact page in browser, don't emails through. also, want add captcha form.

 

please can me following:

 

1. need put email password somewhere in code? if so, how protect password might viewing source code?

 

2. error in code preventing me collecting emails submitted via form? have tried test in local browser nothing happens when press submit.

 

3. how add captcha form?

 

thank much.

also, there can make text appears inside text box disappear once user clicks in box? example, 'first name' box has value 'first name' appearing inside of it. @ moment, user has press delete on , replace own name. how can have automatically disappear when user has clicked in box? thank you.



More discussions in Dreamweaver support forum


adobe

Comments

Popular posts from this blog

Warning, the Safe Path is not accessible vm3 - Joomla! Forum - community, help and support

2.5.28 to 3.4.1---Download of update package failed - Joomla! Forum - community, help and support

Your host needs to use PHP 5.3.10 or higher to run this vers - Joomla! Forum - community, help and support