View previous topic :: View next topic |
Author |
Message |
Geek4Ever Master Cheater
Reputation: 1
Joined: 31 Oct 2008 Posts: 353 Location: Milano,Texas
|
Posted: Thu Mar 12, 2009 4:55 pm Post subject: PhP Contact Page |
|
|
i have know idea how to use php but i have been reading a ebook and i just dont get it i need to .php page that allows the client to send an email to me
Forrest_walker54@yahoo.com and it will have subject then the then there email and name plz make it secure so and i will +Rep.
|
|
Back to top |
|
 |
Wintermoot Expert Cheater
Reputation: 0
Joined: 08 Nov 2007 Posts: 198
|
Posted: Thu Mar 12, 2009 5:32 pm Post subject: |
|
|
Search google for PHP's mail function. You will find some good sites that tell you how to use it. Combine that with some common sense and you ahve a contact page.
|
|
Back to top |
|
 |
SXGuy I post too much
Reputation: 0
Joined: 19 Sep 2006 Posts: 3551
|
Posted: Fri Mar 13, 2009 3:55 am Post subject: |
|
|
er, you need to point out that if your using a free host server, they may disable the mail() command.
Alot of free web hosts disabled php commands to force you to upgrade to a paid subscription.
Anyway its quite easy to make a contact page that emails you the message.
just create a table for your contact page, then when the submit button is clicked it will email you the details.
About 3 months ago i didnt know how to write anything in php, i read a little about its functions and now id say im pretty good at it, it really isnt that hard to understand how to use it.
|
|
Back to top |
|
 |
Localhost I post too much
Reputation: 0
Joined: 28 Apr 2007 Posts: 3402
|
Posted: Fri Mar 13, 2009 6:05 pm Post subject: |
|
|
The function:
mail(to,subject,message,headers,parameters)
Is used
Code: | <?php
if(isset($_POST['email']))
{
echo "email sent!";
$your_email = "blank@blank.com";
mail($your_email, "Contact Page!", $_POST['message'], "From: $_POST['email']");
}
else
{
echo '<form action="" method="post">
Your Email: <input type="text" name="email" />
Your Message: <input type="text" name="message" />
<input type="submit" />
</form>';
}
?> |
I just wrote that on the spot... So it may or may not work... Trouble shoot it yourself though.
_________________
|
|
Back to top |
|
 |
SXGuy I post too much
Reputation: 0
Joined: 19 Sep 2006 Posts: 3551
|
Posted: Fri Mar 13, 2009 6:13 pm Post subject: |
|
|
looks good to me, only reason why it may fail is if his host disabled mail() unless hes runing it on a local host of course.
|
|
Back to top |
|
 |
Geek4Ever Master Cheater
Reputation: 1
Joined: 31 Oct 2008 Posts: 353 Location: Milano,Texas
|
Posted: Fri Mar 13, 2009 6:24 pm Post subject: |
|
|
no i host with hostmonster i like it and they have the mail() thing i guess.
|
|
Back to top |
|
 |
Localhost I post too much
Reputation: 0
Joined: 28 Apr 2007 Posts: 3402
|
Posted: Fri Mar 13, 2009 11:59 pm Post subject: |
|
|
They do, but they only allow 400 emails to be sent/received per hour... If you go over the limit your account is frozen for an hour.
I suggest adding captcha. I cannot be bothered to write a script for that though.
_________________
|
|
Back to top |
|
 |
`unknown Grandmaster Cheater
Reputation: 0
Joined: 20 Nov 2006 Posts: 658 Location: You lost the game.
|
Posted: Sat Mar 14, 2009 12:04 pm Post subject: |
|
|
Do as localhost said, and escape your data too.
|
|
Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Sun Mar 15, 2009 4:40 am Post subject: |
|
|
The inbuilt mail function needs a working smtp server. So if your host dosen't allow it, you could simply use the mail function do connect to an external smtp server and send the mail. In many cases tho mail server's need authentication.
_________________
Intel over amd yes. |
|
Back to top |
|
 |
SXGuy I post too much
Reputation: 0
Joined: 19 Sep 2006 Posts: 3551
|
Posted: Sun Mar 15, 2009 11:24 am Post subject: |
|
|
its unlikely he will find an external smtp mail server that allows him to use it without authtentication, maybe gmail.
if his webhost has webmail then the mail() function will work fine as it will use the already prebuilt smtp server.
|
|
Back to top |
|
 |
Localhost I post too much
Reputation: 0
Joined: 28 Apr 2007 Posts: 3402
|
Posted: Sun Mar 15, 2009 11:28 am Post subject: |
|
|
I already stated that his hosts allow it.
_________________
|
|
Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
|
Back to top |
|
 |
AlbanainRetard Master Cheater
Reputation: 0
Joined: 02 Nov 2008 Posts: 494 Location: Canada eh?
|
|
Back to top |
|
 |
|