Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 05-15-2004, 12:30 PM   #1 (permalink)
 
Junior Techie

Join Date: May 2004

Posts: 88

josuem

Default Email Forms

Does anyone know of an easy way to make an email registration form? Its a signup for a newsletter. Right now I don't have access to any programs like DW or MS FP, so keep in mind that I have to code all HTML and any other languages by hand. Actually, I really don't know alot beyond HTML and a little Java. Thanks
josuem is offline  
Old 05-15-2004, 07:22 PM   #2 (permalink)
 
Monster Techie

Join Date: Jul 2003

Posts: 1,179

Emily is on a distinguished road

Send a message via AIM to Emily
Default

What do you mean by email registration? Like a mailing list or something? If so, it's pretty easy to do in PHP.
__________________
<a href=\"http://www.upstark.com\">www.upstark.com</a>
Emily is offline  
Old 05-15-2004, 07:26 PM   #3 (permalink)
 
Junior Techie

Join Date: May 2004

Posts: 88

josuem

Default Email Form

Well, something along the lines of an email field, name field, and location field. Right now, we just have people emailing us with their info. So, considering i don't know php, would it be easier to leave it at that?
josuem is offline  
Old 05-16-2004, 12:45 AM   #4 (permalink)
 
Monster Techie

Join Date: Jul 2003

Posts: 1,179

Emily is on a distinguished road

Send a message via AIM to Emily
Default

So... you want a user to fill out a form and have the fields emailed to you? The easiest way would be PHP. If you know any PHP at all, try here. If not, you might want to try Googling for free form handlers. There are some promising matches here.
__________________
<a href=\"http://www.upstark.com\">www.upstark.com</a>
Emily is offline  
Old 05-16-2004, 12:50 AM   #5 (permalink)
 
Junior Techie

Join Date: May 2004

Posts: 88

josuem

Default

Thanx alot. Yeah, for now, I'll probably stick to pre-made until i can get enough time to learn PHP. thanx
josuem is offline  
Old 05-16-2004, 12:56 AM   #6 (permalink)
 
Monster Techie

Join Date: Jul 2003

Posts: 1,179

Emily is on a distinguished road

Send a message via AIM to Emily
Default

No problem. Good luck.
__________________
<a href=\"http://www.upstark.com\">www.upstark.com</a>
Emily is offline  
Old 06-10-2004, 04:18 PM   #7 (permalink)
 
Newb Techie

Join Date: Jun 2004

Posts: 23

prezz0

Default

dude, the e mail function in php is the easiest thing ever

just select from database then put it in a while loop till it's e mailed them all

EMILY SAYS: Use the Edit button instead of posting twice in a row. And this post is totally useless too.
prezz0 is offline  
Old 06-10-2004, 07:01 PM   #8 (permalink)
 
Super Techie

Join Date: Apr 2004

Posts: 316

BlazingWolf

Default

He needs to put the names in the database prezz, and learning SQL and PHP will take a bit of time.
__________________
BlazingWolf
<font color=\'red\'>
<b>
<a href=\'http://www.gaming-forums.org\'>
Gaming-Forums.org
<a/>
</b>
</font>
BlazingWolf is offline  
Old 06-11-2004, 11:20 AM   #9 (permalink)
 
Newb Techie

Join Date: Jun 2004

Posts: 23

prezz0

Default

2 days? :/
prezz0 is offline  
Old 06-12-2004, 04:57 AM   #10 (permalink)
 
Newb Techie

Join Date: Jun 2004

Posts: 23

prezz0

Default

PHP Code:
<?
    
require_once('connect.php');
    
$query "SELECT user_emails FROM tbl_users ORDER BY users_date desc";
    
$result = @mysql_query ($query) or die ("failed : ".mysql_error());
    
$num mysql_num_rows ($result) or die ("failed : ".mysql_error());
    if (
$num 0) {
        echo 
"

There are currently $num user(s) to email to.</p>"
;    
            if(isset(
$_POST['mail_form'])) {
        while (
$row mysql_fetch_array($resultMYSQL_NUM)) {
    if(
$row['0'] && $subject && $message) {
    
mail($row['0'], $subject$message);
}
        }
    }
}
    
mysql_free_result ($result);
        } else { 
    echo 
'

There are no people to send news to, your site sucks.</p>'
;
        }

    
mysql_close();
    
?>

<form name="mail" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <input type="text" name="subject" />
    <input type="text" name="message" />
    <input type="submit" name="mail_form" value="Mail that news!" />
</form>
I just wrote this out and don't have time or the effort to test it, so ifyou find a few minor bugs just change them, only common sense is needed, just remember to set your classes and include your header and footer tags.

and to register them something like this might work:
PHP Code:
<?php
if(isset($_POST['register'])) {
if (
$usr_mail) {
require_once(
'connect.php');
$query "INSERT INTO tbl_users (user_emails) VALUES ('$usr_mail')";
$result = @mysql_query ($query);
if (
$result) {
$message '

You are now on our mailing list, mate.</p>'
;
} else {
$message '

You could not be registered for one reason or another, try again later.</p>'
;
}
}
?>
<form name="register" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="text" name="usr_mail" />
<input type="submit" name="register" value="Sign up!">
</form>
once again there may be a few minor bugs, but you don't needmasses of knowledge to edit them out

There is also a very easy way with PEAR, but if you wanna know how to use that you'll have to goto PEAR's Website
prezz0 is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On