
|
|||||||
| Website Development HTML, traffic, hosting, and more... this is the forum for every webmaster. |
Register Now for FREE! |
|||||
| |

![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Hey,
So I'm making this site atm, and on one page, I have an Email form. At the moment, it just emails me, and uses a CAPATCHA (sp?). I want to include a part where people can upload photos only. (.jpg, .gif, .png) I have looked on the net, but I can't find what I'm looking for. I would greatly appreciate it if someone could help me out! Here is my code so far: HTML: Code:
<form method="post" action="scripts/captcha.php"> Your Email: *<br><input name="email" type="text" size="40"/><br><br> Message:<br> <textarea name="message" rows="8" cols="35">Write Comment Here</textarea><br> <img src="scripts/captcha_image.php" /><br /> <input type="text" name="captcha_input" size="15"><br /> <input type="submit" value="Send To Jam"/> </form> Code:
<?
session_start();
if ($_SERVER["REQUEST_METHOD"] <> "POST")
die("You can only reach this page by posting from the html form");
if ($_POST["captcha_input"] == $_SESSION["pass"])
{
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
mail( "XXX@hotmail.com", "POACHER 2008 - www.theworldofjam.com",
$message, "From: $email" );
header( "Location:../thankyou.html" );
} else {
echo "Sorry, The CAPTCHA You Entered Was Incorrect.";
echo "<br/>";
echo "Please Go Back And Try Again.";
}
?>
...And I would gladly link to your site if you could help me ![]()
__________________
![]() Become a Premium Member today!
- Advert Free - Increased PM Storage - 1,000,000 C$ - Increased Avatar Size - Access To Premium Members Forum - Colored Username - _______________________________________ Excellent day for putting Slinkies on an escalator. JamsUbuntu.blogspot.com |
| Sponsored Links | ||
|
|
|
||||
|
Thanks for the reply justin..
And no, I haven't even looked at perl before. With this script, is there anyway of still using my capatcha thing with it? And just wondering, how do I test that code out? Like hat format do I save it in? Thanks
__________________
![]() Become a Premium Member today!
- Advert Free - Increased PM Storage - 1,000,000 C$ - Increased Avatar Size - Access To Premium Members Forum - Colored Username - _______________________________________ Excellent day for putting Slinkies on an escalator. JamsUbuntu.blogspot.com |
|
||||
|
.pl or .cgi should work fine - you would have to have some kind of Perl / CGI loaded on your development box for it to wor.
__________________
Thanks, Ash CF Founder Great Webhosting. Shared starting at $2 per month. VPSes starting at $6 per month. www.Centicero.com Want to get in touch? Send me a PM | Do you want to continue receiving free help? Or do you want this site to close? Become a premium member. |
|
|||
|
Just one important question, jam: Are you using a free host for your site? If so, bear in mind that if they ever decide to disable PHP, the form will become unusable and you would have no recourse but to switch hosts.
There have been a couple of times where I've spent many hours building elaborate websites, including forms, that required PHP to function correctly, only to have the (free) host yank PHP because users started abusing the system and hogging resources. By the way, PERL is said to be much more difficult to master than PHP but it's also said to be better by those "in the know". So, if you think you're up to it, more power to you! ;-) |
|
||||
|
The thing of course with Perl is that it does indeed use plenty of server resources, as opposed to PHP - if you can get something written in PHP rather than Perl, then you should do so.
__________________
Thanks, Ash CF Founder Great Webhosting. Shared starting at $2 per month. VPSes starting at $6 per month. www.Centicero.com Want to get in touch? Send me a PM | Do you want to continue receiving free help? Or do you want this site to close? Become a premium member. |
|
||||
|
Yes, I have my own hosting space that I'm using.
And I had a go with the perl script, but I think I may of done something wrong, as it wasn't working :S But anyways, I've decided not to use this idea anymore.. Thanks for the reply though! Jam
__________________
![]() Become a Premium Member today!
- Advert Free - Increased PM Storage - 1,000,000 C$ - Increased Avatar Size - Access To Premium Members Forum - Colored Username - _______________________________________ Excellent day for putting Slinkies on an escalator. JamsUbuntu.blogspot.com |
|
||||
|
PHP mail scripts work fine on the server, and so should Perl, unless your reseller has disabled it.
__________________
Thanks, Ash CF Founder Great Webhosting. Shared starting at $2 per month. VPSes starting at $6 per month. www.Centicero.com Want to get in touch? Send me a PM | Do you want to continue receiving free help? Or do you want this site to close? Become a premium member. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|