FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


I am having alot of trouble with forms! Urgent help please!





polly-gone
I am making a website for my Halo Clan and I need to know how to make my forms go straight to me. Can anyone help please. Thank you. I will thank you in advance because I probably will not have time to reply to your post. So thanks in advance.
ncwdavid
I am assuming you have a form already created and a register.php file create?If not I have two very simple ones made out below which you can build on:

registerform.html:
Code:

<html>
<head>
<title>Registration Form</title>
</head>
<body>
<h2 align="center">Please fill in the form below to register</h2>
<form action="register.php" method="post">
<p>First Name<input type="text" name="first_name"></input></p>
<p>Last Name<input type="text" name="last_name"></input></p>
<p>Email Address<input type="text" name="email_address"></input></p>
<input type="submit" value="Send"></input>
</form>
</body>
</html>

Feel free to change the form around or add to it as i am only using this one I created a minute ago for an example. The only thing you might have to change is the action="register.php" if you want to use a different file.

Here is the php script:

register.php
Code:

<head>
<title>Registration Complete</title>
</head>
<body>
<?php
//define post fields into simple variables//
$first_name = $_POST['first_name'] ;
$last_name = $_POST['last_name'] ;
$email_address = $_POST['email_address'] ;
$my_email = "the email address you want the info to be sent to" ;

//sending the info to your email address//
$subject = "Registration Details Of Your Sites Newest Member $first_name $lastname" ;
$message = "You have a new member at your site,
Here are his registration details:

First Name : $first_name
Last Name : $last_name
Email Address : $email_address" ;

mail($my_email, $subject, $message,
        "From: Your Name<admin@yourdomain.frih.net>\n
        X-Mailer: PHP/" . phpversion());
      echo "Your account have been created. You may now login" ;
      ?>
</body>
</html>

Change the "the email address you want the info to be sent to" to your own email.
and "From: Your Name<admin@yourdomain.frih.net".

Is that all you wanted? If you have any trouble with anything please post a reply. Do you want to save the info into a database aswell?

Please tell me how you got on with it.
polly-gone
Thanks, this worked well. It was actually pretty simple.
Sunny
Problem is solved and therefore i'm locking the thread.Pm me/any Mod. if you need this thread to be reopened.
mathiaus
Sunny wrote:
Problem is solved and therefore i'm locking the thread

Did you forget to lock it? Razz
-close-
Related topics
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.