Results 1 to 3 of 3
Apr 2, 2001, 14:23 #1
Okay simple question here, but since I've just started with PHP, mySQL, am not too sure how I should tackle this.
We have a database with a USER table in it. The USER table, amongst other things, has a field called NEWS which is one character long and holds either a 'Y' or 'N' depending on the user's preference to receive mail.
I want to provide the user the option to change this setting at will when they login to our site. So for instance, if I am registered, and receive a newsletter, all I have to do to unsubscribe is login, and select 'N' (in a drop down list? - or whatever...) to change the setting.
Now my question is how should I tackle this...
How will the PHP part (to connect and change the field for the user) fir in with the HTML portion of the website?
Any ideas/help/references would be appreciated.
Apr 3, 2001, 05:54 #2
- Join Date
- Mar 2001
- 0 Post(s)
- 0 Thread(s)
Something like this???
I'm a beginner, so I dont know how much help this will be.
Write the html file with php script in it. Since user has already logged in you can identify user in database with the help of id and password field. Now with that select the value of the news field.
If = Y then (end php) small html subit button named unsubscribe. (start php ie <?php)
if value = subscribe change database entry
else (end php)html button named subscribe.
(start php) If clicked the database entry is changed accordingly.
You may use echo($PHP_SELF) command to reload same page on button being clicked.
Apr 3, 2001, 06:21 #3
Hmm that does make sense...
I'll try it and will post here if it does (or does not!) work.