PDA

View Full Version : PING: HTML/XML Experts


vtbub
12-08-2005, 04:37 PM
I have a question about adding an anonymous tip box. How would I do that.

Draft Dodger
12-08-2005, 04:39 PM
you mean like a paypal donation thingy?

Draft Dodger
12-08-2005, 04:40 PM
or a don't bet on horses thingy?

vtbub
12-08-2005, 04:42 PM
A box that people can leave rumour type tips and they get emailed to me for a second look.

News tips.

vtbub
12-08-2005, 04:43 PM
dola,

like this: hxxp://mediabistro.com/tvnewser/

Antmeister
12-08-2005, 05:46 PM
Here's a link to an input form and you can modify it for your needs.
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_mail

Maybe something like this:
<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>



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 >

vtbub
12-08-2005, 05:59 PM
thx guy, that be it.

Draft Dodger
12-08-2005, 06:14 PM
can't WAIT to start using that...

*whistles innocently*

sterlingice
12-08-2005, 06:17 PM
Hehe ;)

SI

Easy Mac
12-08-2005, 06:24 PM
tip: foz is gay.......

Antmeister
12-08-2005, 07:04 PM
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 "<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.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
}

? >

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.

vtbub
12-09-2005, 12:52 AM
self bump

vtbub
12-09-2005, 04:51 PM
ok, cut and pasted, but it is telling me when I test that an input file has not been selected.

Antmeister
12-09-2005, 05:07 PM
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

Antmeister
12-09-2005, 05:09 PM
Ugh...oh and on that last step, you should create an ok.htm and error.htm page, not html.

vtbub
12-09-2005, 05:15 PM
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.

vtbub
12-09-2005, 05:18 PM
ok, ty.

seamonkey, lol

Antmeister
12-09-2005, 05:18 PM
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.

Antmeister
12-09-2005, 05:22 PM
< ?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.

Antmeister
12-09-2005, 05:26 PM
Also remember that whatever you named your .php file should be the same name referenced in your html file.

Antmeister
12-09-2005, 05:28 PM
In other words, this section of the .html file:
< form method="POST" action="atip.php" >

vtbub
12-09-2005, 05:37 PM
In other words, this section of the .html file:
< form method="POST" action="atip.php" >
OK, made sure of that part. Since it is a "php" file on a template that this is on, does that make any difference as supposed to html?

Also, is there some basic syntax I'm missing that may be partof the problem? I deleted the extra spaces

Antmeister
12-09-2005, 05:42 PM
OK, made sure of that part. Since it is a "php" file on a template that this is on, does that make any difference as supposed to html?

Also, is there some basic syntax I'm missing that may be partof the problem? I deleted the extra spaces

Awwww.....yes it makes a difference. I thought you were putting this on an html page.

vtbub
12-09-2005, 05:45 PM
Ant, u have been PMs'ed

Front Office Football Central Database Error
Database Error Database error
The Front Office Football Central database has encountered a problem.

Please try the following:
The forumsold.operationsports.com forum technical staff have been notified of the error, though you may contact them if the problem persists.
 
We apologise for any inconvenience.