/    Sign up×
Community /Pin to ProfileBookmark

really stupid question

how do I use PHP to create a form,sort of a request form so that people can go to my site and request for some things?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@VasilliJul 21.2003 — If you give me a little more info i will try to help

If you are just looking for a form processor that send you the info once filled out, that is easy.

Reply with more info
Copy linkTweet thisAlerts:
@JickJul 21.2003 — Try this. Insert this in between your <body> tags:
[CODE]<form method="post" name="feedback" action="feedback.php">
Name:<br>
<input type="text" class="text" name="Name" maxlength="50" width="30" size="20"><br>
E-mail:<br>
<input type="text" class="text" name="Email" maxlength="50" width="30" size="20"><br>
Comments:<br>
<textarea cols="30" rows="6" class="text" name="Comments"></textarea><br><br>
<input class="submit" type="submit" value="Submit">
</form>[/CODE]

And make a new file called "feedback.php" and make sure its in the same dir as your form:
[code=php]<?PHP

$subject = "Feedback";
$headers = "From: Form Mailer";
$forward = 1;
$location = "yourfeedbackthankyoupage.html";
$addresses = array("[email protected]");

$date = date ("l, F jS, Y");
$time = date ("h:i A");

$msg = "This form was submitted on $date at $time.nn";

foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "n";
}

foreach ($addresses as $email) {
mail($email, $subject, $msg, $headers);
}
if ($forward == 1) {
header ("Location:$location");
}
else {
echo ("Thank you for submitting our form.");
}

?>[/code]

Hope that helps you. ? [B](Credit for this script goes to Pyro!)[/B]
Copy linkTweet thisAlerts:
@pyroJul 21.2003 — If it is only going to one address, I'd use this version instead: http://forums.webdeveloper.com/showthread.php?s=&threadid=9543#post48748
Copy linkTweet thisAlerts:
@zero_hunterauthorJul 22.2003 — thnx a lot,I need one that include the users e-mail address,name,when does he/she want the item requested and the name of the item they want.I also need it to be posted on my site so other users can see. thxn a lot!:p
×

Success!

Help @zero_hunter spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.9,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...