| View previous topic :: View next topic |
| Author |
Message |
Ash 1000+ Club

Joined: 03 Aug 2005 Posts: 1017 Location: England
|
Posted: Wed Sep 21, 2005 3:41 pm Post subject: Contact problem |
|
|
I borrowed this code from Phate's website I hope you don't mind if you doi'll just delete it. But How do I make it so I get the email instead of him?
| Code: |
<form method="post">
Your Email: <br><input type="text" name="email" size="20" /><br /> <P>
Subject: <br><input type="text" name="subject" size="20" /><br /> <P>
Message: <br><textarea rows=5 cols=30 name="message"></textarea><br />
<input type="submit" name="submit" value="Contact Me!" /> |
|
|
| Back to top |
|
 |
|
|
Protege 50+ Club
Joined: 19 Sep 2005 Posts: 68 Location: Scotland
|
Posted: Wed Sep 21, 2005 5:23 pm Post subject: Re: Contact problem |
|
|
| Ash wrote: |
I borrowed this code from Phate's website I hope you don't mind if you doi'll just delete it. But How do I make it so I get the email instead of him?
|
You made me laugh with that. Thanks.
Have a read of this - obviously you'll have to change a few things, but you get the idea.. I hope. |
|
| Back to top |
|
 |
Ash 1000+ Club

Joined: 03 Aug 2005 Posts: 1017 Location: England
|
Posted: Wed Sep 21, 2005 9:01 pm Post subject: Re: Contact problem |
|
|
Ok I don't have a clue about php where do I edit?
PHP: <?php
if(isset($_POST['submit'])) {
$to = "your@email.com";
$subject = "Registration to newsletter";
$message = $_POST['email'];
mail($to, $subject, $message);
echo "You are now registered to the newsletter!";
} else { ?>
<form method="post">
Your e-mail address: <input type="text" name="email" />
<input type="submit" name="submit" value="send the mail" />
<?php } ?>
|
|
| Back to top |
|
 |
webmaster Site Admin

Joined: 17 Aug 2004 Posts: 3642 Location: Sweden
|
Posted: Wed Sep 21, 2005 9:52 pm Post subject: Re: Contact problem |
|
|
Change: your@email.com to your own e-mail
Change:
| Code: |
| <input type="text" name="email" /> |
To:
| Code: |
| <textarea name="email"></textarea> |
And it should work fine. |
|
| Back to top |
|
 |
Protege 50+ Club
Joined: 19 Sep 2005 Posts: 68 Location: Scotland
|
Posted: Wed Sep 21, 2005 10:17 pm Post subject: Re: Contact problem |
|
|
or you could use this:
| Code: |
<form action="<?=$PHP_SELF?>" method="post">
Your Email: <input type="text" name="email" size="20" /><br />
Subject: <input type="text" name="subject" size="20" /><br />
Message: <textarea rows=5 cols=30 name="message"></textarea><br />
<input type="submit" name="submit" value="Contact Me!" />
<?
if(isset($_POST['submit']))
{
$email = $_POST['email'];
$to = "your@email.com";
$subject = $_POST['subject'];
$message = str_replace(array("\\","Content-Type:","bcc:","cc:","MIME-Version:",
"Content-Transfer-Encoding:","%"),"",$_POST['message']);
mail($to, $subject, $message, "From: $email\n");
echo "Thanks";
}
?>
|
Save that in the same php page or rename the forms action to a page with the php on it. Wallah! |
|
| Back to top |
|
 |
Ash 1000+ Club

Joined: 03 Aug 2005 Posts: 1017 Location: England
|
Posted: Wed Sep 21, 2005 10:20 pm Post subject: Re: Contact problem |
|
|
That never worked It's just for emailing links to me so I can upload renders onto a website should I just use a mailto: ? |
|
| Back to top |
|
 |
Protege 50+ Club
Joined: 19 Sep 2005 Posts: 68 Location: Scotland
|
Posted: Wed Sep 21, 2005 10:30 pm Post subject: Re: Contact problem |
|
|
| which one didn't work? The both of them should... |
|
| Back to top |
|
 |
Ash 1000+ Club

Joined: 03 Aug 2005 Posts: 1017 Location: England
|
Posted: Wed Sep 21, 2005 10:41 pm Post subject: Re: Contact problem |
|
|
Ok Razz's one never worked as it gave me loads of text I never wanted and when I used yours I ended up with this. I hate freewebs.
http://www.freewebs.com/corrosiongfx/Request.htm
Is there anyother way I could try it out like a different web host? |
|
| Back to top |
|
 |
Protege 50+ Club
Joined: 19 Sep 2005 Posts: 68 Location: Scotland
|
Posted: Wed Sep 21, 2005 10:47 pm Post subject: Re: Contact problem |
|
|
Firstly, when I had a look at your source code, you've forgot the end php tag
| Code: |
<!-- Content --><br><br>
<img src="images/hr_top.gif" width="528" height="58" border="0">
<blockquote><font face="Arial" size="2" color="#000000"><strong>
<H3>This form is inoperational!</H3> <Provisional users can't create forms action="<?=$PHP_SELF?>" method="post">
Your Email: <input type="text" name="email" size="20" /><br />
Subject: <input type="text" name="subject" size="20" /><br />
Message: <textarea rows=5 cols=30 name="message"></textarea><br />
<input type="submit" name="submit" value="Contact Me!" />
<?
if(isset($_POST['submit']))
{
$email = $_POST['email'];
$to = "your@email.com";
$subject = $_POST['subject'];
$message = str_replace(array("\\","Content-Type:","bcc:","cc:","MIME-Version:",
"Content-Transfer-Encoding:","%"),"",$_POST['message']);
mail($to, $subject, $message, "From: $email\n");
echo "Thanks";
} ?> </strong></font></blockquote>
<br><br><br><br><br><br>
<img src="images/hr_bot.gif" width="528" height="44" border="0">
<!-- Content -->
|
..And you can't run PHP on a html page..rename it to request.php  |
|
| Back to top |
|
 |
Ash 1000+ Club

Joined: 03 Aug 2005 Posts: 1017 Location: England
|
Posted: Thu Sep 22, 2005 9:10 am Post subject: Re: Contact problem |
|
|
| You can't do that with freewebs so I just used a normal mailto: I may try it if I .com the website. |
|
| Back to top |
|
 |
dafunkymunky 100+ Club

Joined: 08 Apr 2005 Posts: 180 Location: India
|
Posted: Thu Sep 22, 2005 9:12 am Post subject: Re: Contact problem |
|
|
well even if he does rename it ...does freewebs support php hosting.....???
i think this one site provides free php hosting
www.100webspace.com....
if freewebs does then its well and good..but one prob is that you cannot upload more than 50 files unless you are a premium user. |
|
| Back to top |
|
 |
Protege 50+ Club
Joined: 19 Sep 2005 Posts: 68 Location: Scotland
|
Posted: Thu Sep 22, 2005 10:09 am Post subject: Re: Contact problem |
|
|
You can if you put them in different folders. Noticed that when I uploaded a forum on a site ages ago. I've not used Freewebs in a long time though..
EDIT: Just had a look on freewebs and it looks like free accounts don't get to use PHP. Bah!
| Quote: |
Does FreeWebs support PHP?
Unfortunately at this time FreeWebs does not support PHP and you cannot run these scripts from your FreeWebs site. |
|
|
| Back to top |
|
 |
Ash 1000+ Club

Joined: 03 Aug 2005 Posts: 1017 Location: England
|
Posted: Thu Sep 22, 2005 11:26 am Post subject: Re: Contact problem |
|
|
| dafunkymunky wrote: |
well even if he does rename it ...does freewebs support php hosting.....???
i think this one site provides free php hosting
www.100webspace.com....
if freewebs does then its well and good..but one prob is that you cannot upload more than 50 files unless you are a premium user. |
According to my browser that site does not excist I will search google for php hosts |
|
| Back to top |
|
 |
Protege 50+ Club
Joined: 19 Sep 2005 Posts: 68 Location: Scotland
|
Posted: Thu Sep 22, 2005 3:32 pm Post subject: Re: Contact problem |
|
|
| Click |
|
| Back to top |
|
 |
Phate 500+ Club

Joined: 21 Nov 2004 Posts: 818 Location: 127.0.0.1
|
Posted: Thu Sep 22, 2005 4:44 pm Post subject: Re: Contact problem |
|
|
<laff>
Glad to see that people are actually going to my site... |
|
| Back to top |
|
 |
|