|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi Scripters,
I need with a form to save only one field...that is, an e-mail address to a database for a mailing list. I can do the form, I just do not know how to make it save to a database. Then I need extracting that data from the database to add to my contact list, or to notepad. Thanx Anonymous Chief |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Anonymous Chief wrote:
> Hi Scripters, > > I need with a form to save only one field...that is, an e-mail address > to a database for a mailing list. I can do the form, I just do not know how > to make it save to a database. Then I need extracting that data from > the database to add to my contact list, or to notepad. > > Thanx > > Anonymous Chief > > Read about PHP Post Methods! Read about mysql functions (assuming you will be using MySQL to store the Email). Create the Table in MySQL. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Thanx Armand
"Armand Brahaj" <a_brahaj@yahoo.com> wrote in message news:f49ucf$slh$1@news.BelWue.DE... > Anonymous Chief wrote: >> Hi Scripters, >> >> I need with a form to save only one field...that is, an e-mail >> address to a database for a mailing list. I can do the form, I just do >> not know how to make it save to a database. Then I need extracting >> that data from the database to add to my contact list, or to notepad. >> >> Thanx >> >> Anonymous Chief > > Read about PHP Post Methods! > Read about mysql functions (assuming you will be using MySQL to store the > Email). > Create the Table in MySQL. > |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
"Anonymous Chief" <anonySMACKmouschief@gmail.com> wrote in message news:n2_9i.5051$1i1.2811@pd7urf3no... > Hi Scripters, > > I need with a form to save only one field...that is, an e-mail address > to a database for a mailing list. I can do the form, I just do not know how > to make it save to a database. Then I need extracting that data from > the database to add to my contact list, or to notepad. > > Thanx > > Anonymous Chief > > With PHP you would likely getting the form data using a $_POST variable, and should probably validate the information or make sure it is in a usable format before saving it. Depending how your PH is configured, you probably have MySQL setup. If you check the http:///www.php.net site there's lots of useful information and can get more detail on the mysql_* functions there for connecting, updating and retrieving information for the database. Tom -- Newsguy.com 90+ Days Retention Free SSL Connections Create Your Own NZB Files |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Tom wrote:
> With PHP you would likely getting the form data using a $_POST variable, and Even better: use $_REQUEST instead of $_POST or $_GET and $_... Trust me, it's for your own sake. S. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
> Even better: use $_REQUEST instead of $_POST or $_GET and $_...
> > Trust me, it's for your own sake. > The convention is to actually use $_POST or $_GET and $_ and not $_REQUEST as you SHOULD know from where the data has come. You as the programmer should ALWAYS know which method data has come to your script. |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
peter wrote:
> The convention is to actually use $_POST or $_GET and $_ and not > $_REQUEST as you SHOULD know from where the data has come. That's just crap. > You as the programmer should ALWAYS know which method data has come to your > script. BS, and you know it. "I'm sure it came in through POST" So what ? Faulty security: "I check that the data DID come in through POST (also works for GET/) Rule: It is completely futile to check if data did come in through POST rather that using GET (or the other way around) or from a . Why: It's a piece of cake to send you data. You want GET ? To use get, just telnet www.target.tld 80 or even easier, just type the variables into the URL bar of a browser. You want POST ? To use POST, you just need to save the form to your hard drive, change it open the file, and hit "Submit". Want a ? A is merely a text file written in the right place on your hard drive. You could even use wget or cURL to send the same data 10 or 50 times per second for an hour... Thus: It's the content of the data that is important, the means of transmission is completely irrelevant. Using PHP, just use REQUEST instead of over-complexing your code, using $_GET here and $_POST there... (courtesy of JG) Remember, you do not need to know if it was typed in the URL, or came in regularly from your form, the only thing you need to know, is if the data in trustworthy. As it comes from a client; it never is ! S. |
|
![]() |
| Outils de la discussion | |
|
|