help shim
6 posts
Page 1 of 1
hello guys
i have a contact form created in html the markup is below
i have a contact form created in html the markup is below
Code: Select all
how can i make it work ?
<p class="contact-form-sender"> <action="send.php"> <method="post">
<input id="sender" type="text" placeholder="Name" name="sender" />
</p>
<p class="contact-form-email">
<input id="email" type="text" placeholder="Email" name="email" />
</p>
<p class="contact-form-subject">
<input id="subject" type="text" placeholder="Subject" name="subject" />
</p>
<p class="contact-form-content">
<textarea id="contact-content" placeholder="Your enquiries" name="content"></textarea>
</p>
<p class="contact-form-checkbox">
<input id="agreement" type="checkbox" value="true" />
<label for="agreement">I have read and agree to the <a href="#">terms and conditions</a>.</label>
</p>
<span class="button-met dark"><input id="consubmit" type="submit" name="consubmit" value="Send" /></span>
Find my programs on Softpedia
mshimranpro wrote:hello guys
i have a contact form created in html the markup is below
Code: Select allhow can i make it work ?<p class="contact-form-sender"> <action="send.php"> <method="post"> <input id="sender" type="text" placeholder="Name" name="sender" /> </p> <p class="contact-form-email"> <input id="email" type="text" placeholder="Email" name="email" /> </p> <p class="contact-form-subject"> <input id="subject" type="text" placeholder="Subject" name="subject" /> </p> <p class="contact-form-content"> <textarea id="contact-content" placeholder="Your enquiries" name="content"></textarea> </p> <p class="contact-form-checkbox"> <input id="agreement" type="checkbox" value="true" /> <label for="agreement">I have read and agree to the <a href="#">terms and conditions</a>.</label> </p> <span class="button-met dark"><input id="consubmit" type="submit" name="consubmit" value="Send" /></span>
Above is HTML for ASP pages.
for plan HTML page you have to format the FORM using the <form/> tag and correct inputs.
Code: Select all
Tizag.com is a great place to learn basic HTML....check it out. <p class="contact-form-sender">
<form method="POST" action="send.php">
<p class="contact-form-sender">
<input id="sender" type="text" value="Name" name="sender" /></p>
<p class="contact-form-email">
<input id="email" type="text" value="Email" name="email" /></p>
<p class="contact-form-subject">
<input id="subject" type="text" value="Subject" name="subject" /></p>
<p class="contact-form-content">
<textarea id="contact-content" value="Your enquiries" name="content"></textarea></p>
<p class="contact-form-checkbox">
<input id="agreement" type="checkbox" value="true" />
<font>I have read and agree to the terms and conditions</font></p>
<span class="button-met dark"><input id="consubmit" type="submit" name="consubmit" value="Send" /></span>
</form>
</p>
Code: Select all
I have done this code in php i wasn't able to get the checkbox to work but i can keep trying if you want me to =D<?php
$to = 'Youremail@email.com';
//enter Your Email
$email = $_POST['from'];
$subject = $_POST['subject'];
$body = $_POST['body'];
$header = 'From: '.$email;
if(isset($_POST['subject'])&&isset($_POST['body'])&&isset($_POST['from']))
{
if (!empty($subject)&&!empty($body)&&!empty($header))
{
Echo 'Message Sen\'t Your Should Here from us soon';
mail($to,$subject, $body, $header);
}
else
{
echo 'Please Enter All Fields';
}
}
?>
<form action="index.php" method="POST">
Subject:<br>
<input type="text" name="subject"><br>
Message:<br>
<textarea rows="4" cols="30" name="body">
</textarea><br>
Your Email:<br>
<input type="text" name="from"><br>
<input type="submit" value="Send">
</form>
Where Youremail@email.com is put the email to your contact us email or your email
benji_19994 wrote:changeCode: Select allI have done this code in php i wasn't able to get the checkbox to work but i can keep trying if you want me to =D<?php $to = 'Youremail@email.com'; //enter Your Email $email = $_POST['from']; $subject = $_POST['subject']; $body = $_POST['body']; $header = 'From: '.$email; if(isset($_POST['subject'])&&isset($_POST['body'])&&isset($_POST['from'])) { if (!empty($subject)&&!empty($body)&&!empty($header)) { Echo 'Message Sen\'t Your Should Here from us soon'; mail($to,$subject, $body, $header); } else { echo 'Please Enter All Fields'; } } ?> <form action="index.php" method="POST"> Subject:<br> <input type="text" name="subject"><br> Message:<br> <textarea rows="4" cols="30" name="body"> </textarea><br> Your Email:<br> <input type="text" name="from"><br> <input type="submit" value="Send"> </form>
Where Youremail@email.com is put the email to your contact us email or your email
Code: Select all
to
<form action="index.php" method="POST">
Code: Select all
if the form is embedded in a PHP Script!<form action="<? $SERVER['PHP_SELF']; ?> method="POST">
visualtech wrote:It Would bebenji_19994 wrote:changeCode: Select allI have done this code in php i wasn't able to get the checkbox to work but i can keep trying if you want me to =D<?php $to = 'Youremail@email.com'; //enter Your Email $email = $_POST['from']; $subject = $_POST['subject']; $body = $_POST['body']; $header = 'From: '.$email; if(isset($_POST['subject'])&&isset($_POST['body'])&&isset($_POST['from'])) { if (!empty($subject)&&!empty($body)&&!empty($header)) { Echo 'Message Sen\'t Your Should Here from us soon'; mail($to,$subject, $body, $header); } else { echo 'Please Enter All Fields'; } } ?> <form action="index.php" method="POST"> Subject:<br> <input type="text" name="subject"><br> Message:<br> <textarea rows="4" cols="30" name="body"> </textarea><br> Your Email:<br> <input type="text" name="from"><br> <input type="submit" value="Send"> </form>
Where Youremail@email.com is put the email to your contact us email or your emailCode: Select allto<form action="index.php" method="POST">
Code: Select allif the form is embedded in a PHP Script!<form action="<? $SERVER['PHP_SELF']; ?> method="POST">
Code: Select all
<form action="<? $_SERVER['PHP_SELF']; ?> method="POST">
benji_19994 wrote:it should be
It Would beCode: Select all<form action="<? $_SERVER['PHP_SELF']; ?> method="POST">
Code: Select all
for 1) the server may not have SHORT_TAGS enabled ei: "<?"<form action="<?php $_SERVER['PHP_SELF']; ?>" method="POST">
for 2) you forgot the closing ["] double quote in the action="" tag.
and also. if he is unable to make a simple HTML Form, do you think he could do it is a self submitting php script?
6 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023