/    Sign up×
Community /Pin to ProfileBookmark

mail form question?

are there any mail form that lets you preview what you are submitting?
for example; if someone if putting there address, and Tel number and name can they preview it and make a final submission?

thx

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@SheldonOct 27.2005 — You could make one using sessions. would be easy enough.

Post data to session, then link to send mail script that would pull the data from the session, send the mail, then destry the session or use unset to destroy individual session varibles.
Copy linkTweet thisAlerts:
@ellicitauthorOct 27.2005 — new to Php, how can i do this sessions thing?

thx
Copy linkTweet thisAlerts:
@bokehOct 27.2005 — You don't need sessions for that! Here is a VERY basic example:[code=php]<?php

$self = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];


$form = '<form action="'.$self.'" method="post">'."n".
'first name: <input type="text" name="first_name" value="'.$_POST['first_name'].'"><br><br>'."n".
'last name: <input type="text" name="last_name" value="'.$_POST['last_name'].'"><br><br>'."n".
'<input type="submit" name="submit" value="submit">'."n".
'<input type="submit" name="preview" value="preview">'."n".
'</form>';

if(isset($_POST['submit'])){
// Process form
print 'The form has been submitted';
}elseif(isset($_POST['preview'])){
print '<table>'."n".
'<tr><th>first name: </th><td>'.$_POST['first_name'].'</td></tr>'."n".
'<tr><th>last name: </th><td>'.$_POST['last_name'].'</td></tr>'."n".
'</table>'."n".
'<br><br>'."n".
$form;
}else{
print $form;
}


?>[/code]
×

Success!

Help @ellicit 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.6,
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,
)...