/    Sign up×
Community /Pin to ProfileBookmark

How can I make this form work using php script?

I would like to take the form below off of a webpage I saw and use it on my own website. Unfortunately, since I can’t see the php script I’m clueless on what the best route is to get this to work.

<form id=”emailform” method=”post” action=”/contact.php”>
<fieldset id=”contact_form”>
<legend>Please fill out the form completely.<br />You will be added to my mailing list unless you indicate otherwise.</legend>
<input type=”hidden” name=”sendnow” id=”sendnow” />
<label for=”fromname”>Name</label>
<div><input name=”fromname” type=”text” id=”fromname” size=”40″ value=”” /></div><br />
<label for=”from”>Email Address</label>
<div><input name=”from” type=”text” id=”from” size=”40″ value=”” /></div><br />
<label for=”what”>Subject</label>
<div><input name=”what” type=”text” id=”what” size=”40″ value=”” /></div><br />
<label for=”message”>Message</label>
<div><textarea name=”message” cols=”50″ rows=”10″ id=”message”></textarea></div>
<a href=”#” onclick=”document.forms[0].sendnow.value=’sent’;document.forms[0].submit();return false;” id=”contact_submit”>Send</a>
</fieldset>
</form>

Any advice or tips would be greatly appreciated.

Best,
G

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@hastxJul 17.2007 — forms are pretty generic. You probably need to state what your end goal is, because the back end processing can do anything you want it to.
Copy linkTweet thisAlerts:
@gb3authorJul 17.2007 — hi hastx,

thanks for replying to my thread. my end goal is to have a contact form that uses the markup i posted for visitors to use to contact me via email on my website.

thanks again,

G

forms are pretty generic. You probably need to state what your end goal is, because the back end processing can do anything you want it to.[/QUOTE]
Copy linkTweet thisAlerts:
@malarzJul 17.2007 — contact.php:
[CODE]
<?
$subject=$_POST['what'];
$name=$_POST['fromname'];
$email=$_POST['from'];
$message=$_POST['message'];
$message.="nnFrom: $email Name: $name";
mail("your_mail_here", $subject, $message);
// here goes adding to maillist I suppose that MySQL is good to handle it, but if You do not have access to it, text file may also be used
?>
[/CODE]

Hope this helps and works ?
Copy linkTweet thisAlerts:
@gb3authorJul 17.2007 — Thanks marlarz!

contact.php:
[CODE]
<?
$subject=$_POST['what'];
$name=$_POST['fromname'];
$email=$_POST['from'];
$message=$_POST['message'];
$message.="nnFrom: $email Name: $name";
mail("your_mail_here", $subject, $message);
// here goes adding to maillist I suppose that MySQL is good to handle it, but if You do not have access to it, text file may also be used
?>
[/CODE]

Hope this helps and works ?[/QUOTE]
×

Success!

Help @gb3 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.28,
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,
)...