![]() |
|
|
#1 | ||
|
College Starter
Join Date: Jan 2001
Location: Burlington, VT USA
|
PING: HTML/XML Experts
I have a question about adding an anonymous tip box. How would I do that.
|
||
|
|
|
|
|
#2 |
|
Coordinator
Join Date: Jan 2001
Location: Keene, NH
|
you mean like a paypal donation thingy?
__________________
Mile High Hockey |
|
|
|
|
|
#3 |
|
Coordinator
Join Date: Jan 2001
Location: Keene, NH
|
or a don't bet on horses thingy?
__________________
Mile High Hockey |
|
|
|
|
|
#4 |
|
College Starter
Join Date: Jan 2001
Location: Burlington, VT USA
|
A box that people can leave rumour type tips and they get emailed to me for a second look.
News tips. |
|
|
|
|
|
#5 |
|
College Starter
Join Date: Jan 2001
Location: Burlington, VT USA
|
dola,
like this: hxxp://mediabistro.com/tvnewser/ |
|
|
|
|
|
#6 |
|
Pro Starter
Join Date: Dec 2003
Location: At the corner of Beat Street and Electric Avenue
|
Here's a link to an input form and you can modify it for your needs.
http://www.w3schools.com/html/tryit....html_form_mail Maybe something like this: And here is the code for it: Just replace your email address and the text for the submit button to your liking. Also get rid of the spaces. < form action="MAILTO:[email protected]" method="post" enctype="text/plain" > < h4 >Anonymous Tips< /h4 > < textarea name="tip" rows="10" class="xsmalltext" style="width:135px;" >< /textarea > < br > < input type="submit" title="While vtbub respects the confidentially of all email tips, you can use this form to send entirely anonymous information." value="SEND TIP" alt="While vtbub respects the confidentially of all email tips, you can use this form to send entirely anonymous information." style="font-size:9px;background-color:#fff;" > < /form > |
|
|
|
|
|
#7 |
|
College Starter
Join Date: Jan 2001
Location: Burlington, VT USA
|
thx guy, that be it.
|
|
|
|
|
|
#8 |
|
Coordinator
Join Date: Jan 2001
Location: Keene, NH
|
can't WAIT to start using that...
*whistles innocently*
__________________
Mile High Hockey |
|
|
|
|
|
#9 |
|
Hall Of Famer
Join Date: Apr 2002
Location: Back in Houston!
|
Hehe
![]() SI
__________________
Houston Hippopotami, III.3: 20th Anniversary Thread - All former HT players are encouraged to check it out! Janos: "Only America could produce an imbecile of your caliber!" Freakazoid: "That's because we make lots of things better than other people!" |
|
|
|
|
|
#10 |
|
Registered User
Join Date: Nov 2001
Location: Here
|
tip: foz is gay.......
|
|
|
|
|
|
#11 |
|
Pro Starter
Join Date: Dec 2003
Location: At the corner of Beat Street and Electric Avenue
|
By the way, that is not the most efficient way to do it. I just realized that this will open up the email program on the tipster's computer before they send it. Here is one that makes it a lot easier for them, but it will require more steps.
First enter this code into your html page where you want it to appear: < form method="POST" action="atip.php" > < h4 >Anonymous Tip< /h4 > < textarea name="Tips" rows="10" style="width:135px;" >< /textarea > < /br > < input type="submit" name="submit" value="Submit" style="font-size:9px;background-color:#fff;" > < /form > Now create a php page and call it atip.php. Enter the code below into the page: < ?php $EmailFrom = "[email protected]"; <------You could change this to something more to your liking but you don't have to. $EmailTo = "[email protected]"; <-----Replace with your email address. $Subject = "Someone has an anonymous tip"; $Tip = Trim(stripslashes($_POST['Tips'])); // validation $validationOK=true; if (!$validationOK) { print ""; exit; } // prepare email body text $Body = ""; $Body .= "Tip: "; $Body .= $Tip; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print ""; } else{ print ""; } ? > Now you have one last step: All you have to do is create an ok.html page and an error.html page. This just alerts the tipster that is went through or it didn't. |
|
|
|
|
|
#12 |
|
College Starter
Join Date: Jan 2001
Location: Burlington, VT USA
|
self bump
|
|
|
|
|
|
#13 |
|
College Starter
Join Date: Jan 2001
Location: Burlington, VT USA
|
ok, cut and pasted, but it is telling me when I test that an input file has not been selected.
|
|
|
|
|
|
#14 |
|
Pro Starter
Join Date: Dec 2003
Location: At the corner of Beat Street and Electric Avenue
|
I hope you deleted the spaces in the tags. I only put them there so that you can view the code. On the php section, I only put spaces at the beginning and ending lines of code.
It should work fine. I have tested it out on my site. http://www.almarks.com/atip.html |
|
|
|
|
|
#15 |
|
Pro Starter
Join Date: Dec 2003
Location: At the corner of Beat Street and Electric Avenue
|
Ugh...oh and on that last step, you should create an ok.htm and error.htm page, not html.
|
|
|
|
|
|
#16 |
|
College Starter
Join Date: Jan 2001
Location: Burlington, VT USA
|
OK, the box shows up. I deleted the spaces in the .php file, but it still says no input file selected.
Where do the ok and error pages go? I put them in the same folder as the template. |
|
|
|
|
|
#17 |
|
College Starter
Join Date: Jan 2001
Location: Burlington, VT USA
|
ok, ty.
seamonkey, lol |
|
|
|
|
|
#18 |
|
Pro Starter
Join Date: Dec 2003
Location: At the corner of Beat Street and Electric Avenue
|
Son of a seamonkey.....hold on....I just realized some code doesn't show in the php section. I will probably have to add spaces in certain parts.
|
|
|
|
|
|
#19 |
|
Pro Starter
Join Date: Dec 2003
Location: At the corner of Beat Street and Electric Avenue
|
< ?php
$EmailFrom = "[email protected]"; $EmailTo = "[email protected]"; $Subject = "Someone has an anonymous tip"; $Tip = Trim(stripslashes($_POST['Tips'])); // validation $validationOK=true; if (!$validationOK) { print "< meta http-equiv=\"refresh\" content=\"0;URL=error.htm\" >"; exit; } // prepare email body text $Body = ""; $Body .= "Tip: "; $Body .= $Tip; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: < $EmailFrom >"); // redirect to success page if ($success){ print "< meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\" >"; } else{ print "< meta http-equiv=\"refresh\" content=\"0;URL=error.htm\" >"; } ? > Wherever you see these symbols < >, delete the spaces. Sorry about that. I forget that it still treats those as tags and it won't show up in a post. Last edited by Antmeister : 12-09-2005 at 05:23 PM. |
|
|
|
|
|
#20 |
|
Pro Starter
Join Date: Dec 2003
Location: At the corner of Beat Street and Electric Avenue
|
Also remember that whatever you named your .php file should be the same name referenced in your html file.
|
|
|
|
|
|
#21 |
|
Pro Starter
Join Date: Dec 2003
Location: At the corner of Beat Street and Electric Avenue
|
In other words, this section of the .html file:
< form method="POST" action="atip.php" > |
|
|
|
|
|
#22 | |
|
College Starter
Join Date: Jan 2001
Location: Burlington, VT USA
|
Quote:
Also, is there some basic syntax I'm missing that may be partof the problem? I deleted the extra spaces |
|
|
|
|
|
|
#23 | |
|
Pro Starter
Join Date: Dec 2003
Location: At the corner of Beat Street and Electric Avenue
|
Quote:
Awwww.....yes it makes a difference. I thought you were putting this on an html page. |
|
|
|
|
|
|
#24 |
|
College Starter
Join Date: Jan 2001
Location: Burlington, VT USA
|
Ant, u have been PMs'ed
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|