开发者

Thanking visitor by name after contact form submision

开发者 https://www.devze.com 2023-04-10 12:59 出处:网络
I\'m a web development student and I\'m trying to find a way to thank a visitor who submits a contact form from my website.I want to thank them by name on a thank you page. Below is the code of my for

I'm a web development student and I'm trying to find a way to thank a visitor who submits a contact form from my website. I want to thank them by name on a thank you page. Below is the code of my form. please help a student learn.

<form action="http://www.MySiteUrl/cgi-sys/formmail.pl" method="post" enctype="plain/text" id="Contact">  
            <input name="Name" type="text" class="quoteboxes" id="Name" />

        <span class="textfieldRequiredMsg">Name is required.</span></span></div>
    <!-- End InputFavSite -->
     <div id="inputneed">
         <label>Email </label><span id="sprytextfield6">
         <input name="Email" type="text" class="quoteboxes" id="Email" />
         <span class="textfieldRequiredMsg">E-mail is required.</span><span class="textfieldInvalidFormatMsg">Opse! your E-mail is wrong.</span></span></div>
     <!-- End InputNeed -->
      <div id="inputbudjet"> <label>Phone </label><span id="sprytextfield7">
      <input name="Phone" type="text" class="quoteboxes" id="Phone" />
      <span class="textfieldRequiredMsg">Phone is required.</span><span class="textfieldInvalidFormatMsg">Opse! your number is wrong..</span></span></div>
      <!-- End InputBudget -->
       <div id="inputtime">
           <label>Subject </label>      <span id="sprytextfield8">

               <input name="Subject" type="text" class="quoteboxes" id="Subject" />

           <span class="textfieldRequiredMsg">Subject is required.</span></span></div>
       <!-- End InputTime -->
     <div id="ccontact"><span id="sprytextarea">
         <textarea name="Message" class="quotemessase" id="Message"></textarea>
         <span class="texta开发者_Python百科reaRequiredMsg">Message is required.</span></span></div><!-- End QuoteButtRight -->
         <div id="contactbttn">
           <input name="sender" type="submit" value="click to send your message" />
         </div><!-- End ContactBttn -->

    </div><!-- End QuoteTopRight-->


    </div><!-- End QuoteTop -->

           <input type="hidden" name="recipient" value="info@siteripe.com" />
    <input type="hidden" name="redirect" value="yourURL/Thankspage" />

    </form>


you can save the name value into a cookie before form is submitted (using javascript), and then fetch it from the cookie using javascript.

http://www.quirksmode.org/js/cookies.html

or use a server side language (php etc)


If you want a cheap javascript version (no server-side code), you can do something like the following:

  1. On submit of the form, append ?name={name here} to redirect variable.
  2. On thanks.html, read the querystring variable and put on screen to user.


As adviced I used a PHP Form mailer, killed the line of Code that re-directs and then used

<?php echo $_POST["name"]; ?>,

to collect and display the name of the visitor on the thank you page

0

精彩评论

暂无评论...
验证码 换一张
取 消