Php <?php echo $_POST["name"]; ?> Usage [duplicate]
Possible Duplicate:
Thanking visitor by name after contact form submision
I have the line of codes below on my "Thank you page"
<?php echo $_POST["name"]; ?> Thanks for contacting us
And I want it to get the name value from the form below but when the form is sent, it only shows "Thanks for contacting us" without the visitors name.
<form action="http://www.siteripe.com/cgi-sys/formmail.pl" method="post" enctype="plain/text" id="Contact">
<div id="inputfavsite">
<label>Name</label> <span id="name">
<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="from" type="text" class="quoteboxes" id="from" />
<span class="textfieldRequiredMsg">E-mail is required.</span><span class="textfieldInvalidFormatMsg">Opse! your E-mail is wrong.</span>&开发者_如何学Golt;/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="textareaRequiredMsg">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="http://www.siteripe.com/thanks.php" />
</form>
Please help me learn.
You have to echo $_POST["Name"]
and not $_POST["name"]
.
$_POST["name"]
and $_POST["Name"]
are different. You have "Name" in your form but "name" in your code.
The problem (or at least one of the problems) is that your code is submitting the form to http://www.siteripe.com/cgi-sys/formmail.pl
. This is a standard perl script and has nothing to do with your PHP code.
Please explain how you are accessing your php page and how you expect the form to connect to it.
One possibility is to change this line:
<form action="http://www.siteripe.com/cgi-sys/formmail.pl" ...>
To this:
<form action="http://www.yourdomain.com/yourscript.php" ...>
But then you also have to update the PHP code to send an email based on the form contents. That is beyond the scope of this answer, but you can see complete docs and examples for how to send email in php here: http://php.net/manual/en/function.mail.php
精彩评论