PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.comp.lang.php > Form to database
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Form to database

Réponse
 
LinkBack Outils de la discussion
Vieux 07/06/2007, 21h39   #1
Anonymous Chief
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Form to database

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


  Réponse avec citation
Vieux 07/06/2007, 22h46   #2
Armand Brahaj
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Form to database

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.

  Réponse avec citation
Vieux 07/06/2007, 23h10   #3
Anonymous Chief
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Form to database

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.
>



  Réponse avec citation
Vieux 08/06/2007, 18h27   #4
Tom
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Form to database


"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


  Réponse avec citation
Vieux 08/06/2007, 21h33   #5
Sebastiaan 'CrashandDie' Lauwers
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Form to database

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.
  Réponse avec citation
Vieux 08/06/2007, 23h11   #6
peter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Form to database

> 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.


  Réponse avec citation
Vieux 08/06/2007, 23h32   #7
Sebastiaan 'CrashandDie' Lauwers
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Form to database

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.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 16h12.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11872 seconds with 15 queries