Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> How To Store The Text Typed In A Form?, sort of newsletter subsciption form
gotcha41
post Jul 14 2005, 11:26 AM
Post #1


Advanced Member
*******

Group: Members
Posts: 142
Joined: 24-September 04
From: Belgium
Member No.: 1,260



i would like to add a form on my site, that let's you fill in your e-mail address in order to subscribe to a newsletter. Actually, i just need to see their addresses somewhere (in a textfile, database, forward to my e-mailaddress,..). How can this be done? I mean, which script do i have to use?

There is a database available.
Php is enabled.
I have no acces to cgi-bin, if that's needed.


I hope someone can help me with this.

The alternative would be that there is a link on my site so that they can mail it to me, but prefer a script smile.gif Any ideas? thanks in advance! cool.gif
Go to the top of the page
 
+Quote Post
gotcha41
post Jul 14 2005, 11:28 AM
Post #2


Advanced Member
*******

Group: Members
Posts: 142
Joined: 24-September 04
From: Belgium
Member No.: 1,260



Maybe the Coppermine Photo Gallery scripts are useful? The site is based on Coppermine's Photo Gallery system.
Go to the top of the page
 
+Quote Post
palladin
post Jul 14 2005, 12:31 PM
Post #3


Member [Level 3]
******

Group: Members
Posts: 92
Joined: 28-June 05
Member No.: 8,782



Try this:

FORM
CODE

<form name="newsletter" method="post" action="newsletter.php">
 <p>
   <input type="text" name="nl_email">
</p>
 <p>
   <input type="submit" name="Submit" value="Submit">
</p>
</form>


TABLE in sql
CODE

ID: int autoincrasing index
NL_EMAIL: string


newsletter.php file

CODE

<?php
if ( isset($HTTP_POST_VARS['nl_email']))
{
 $nl_email = $HTTP_POST_VARS['nl_email'];
 $dbh=mysql_connect (HOST, USER, PASSWORD) or die ('DB is OFF');
 mysql_select_db (TABLE NAME);
 $query = "INSERT INTO TABLE NAME (`NL_EMAIL`) VALUES ('".$nl_email."')";
 $result = mysql_query($query);
 print "Your email is add. Nice day";
}
else
{
 print "Don't see email adress.";
}
?>


Dont forget to change HOST, USER, PASSWORD, TABLE NAME to right values.

With this you get a list of emails putting by users on in form, if you need a script for sending this news letter just ask :]
Go to the top of the page
 
+Quote Post
gotcha41
post Jul 14 2005, 01:03 PM
Post #4


Advanced Member
*******

Group: Members
Posts: 142
Joined: 24-September 04
From: Belgium
Member No.: 1,260



ok, thanks a lot, this is what i was looking for, but one question:

can you be more specific on what to do with the database? (in phpmyadmin) i'm not that familiar with mysql. But i do can run a query on my database.

can you give me something like:
CODE
CREATE TABLE cpg_online (
 user_id int(11) NOT NULL default '0',
 user_ip tinytext NOT NULL,
 last_action datetime default NULL,
 PRIMARY KEY  (user_id,user_ip(15))
) TYPE=MyISAM;


thanks a lot cool.gif
Go to the top of the page
 
+Quote Post
palladin
post Jul 15 2005, 01:00 AM
Post #5


Member [Level 3]
******

Group: Members
Posts: 92
Joined: 28-June 05
Member No.: 8,782



sql

CODE

SQL-query:
CREATE TABLE `nl_table` (
`ID` INT NOT NULL AUTO_INCREMENT ,
`NL_EMAIL` TEXT NOT NULL ,
INDEX ( `ID` )
);


php
CODE

$sql = 'CREATE TABLE `nl_table` ('
       . ' `ID` INT NOT NULL AUTO_INCREMENT, '
       . ' `NL_EMAIL` TEXT NOT NULL,'
       . ' INDEX (`ID`)'
       . ' )';


But first you need create database in CPANEL, next create user to this database add to this user full acces, then you can create tables in this new database.

MySQL Database button in CPANEL.

--------------------

Practice is when evrything is work but no one know why.
Theory is when work nothing but evry one know why.
Programmers join Practice with Theory - nothing work and no one know why cool.gif
Go to the top of the page
 
+Quote Post
gotcha41
post Jul 15 2005, 09:35 AM
Post #6


Advanced Member
*******

Group: Members
Posts: 142
Joined: 24-September 04
From: Belgium
Member No.: 1,260



or just run the query in phpmyadmin wink.gif

thanks a lot cool.gif . You are very helpful! tongue.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Free Windowsxp Sp2 Cd From Microsoft(13)
  2. Is There Something Else Than Our Material World?(10)
  3. Word Wrap Text In Div.(16)
  4. Have Diferences Of Performance Form Ps2 Full Console To Mini-ps2?(8)
  5. What Is A Computer Form Factor(1)
  6. Adding Shine To Text(4)
  7. What Program Do You Use To Design Your Web?(95)
  8. Php Ftp Upload Form(1)
  9. Text Based Game(6)
  10. Text Editors Vs Word Processors(6)
  11. New Text Based Tactic Online Game(0)
  12. How To Make Php Newsletter Script(3)
  13. Using Unknown Fonts For Text In Webpage(5)
  14. Perl For Automated Web Form Search(1)
  15. Problem Getting Text To Align With Different Resolutions(4)
  1. An Ode To Gmail.(5)
  2. Text Visualizer(1)
  3. Ad Text(2)
  4. Modifying The Topic Titles: To Be Or Not To Be?(3)
  5. Design A Contact Form In Flex Part 1(0)
  6. Text Size In "fill-in" Form Blanks(2)
  7. About Posting Form(2)
  8. How To Use A Database For Chess Results?(0)
  9. Design A Contact Form In Flex Part 2(0)
  10. Design A Contact Form In Flex Part 3(2)
  11. Best Text-based (mmo)rpg's(5)
  12. Submitting A Form In Flex (follow Up Of Sm's Tut)(2)
  13. Need Help With Flex Rich Text Editor Please!(0)


 



- Lo-Fi Version Time is now: 6th October 2008 - 02:29 PM