|
| Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more. |
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Join Date: Nov 2004
Location: Texas
Posts: 24
Reputation: 5
|
Help Adding a Required Text Field
I am trying to add a text field to the customers database and I have accomplished that. I want it to be a required field but it is not seeing it as such. It is also not updating in the database. I am not 100% sure what I am doing and need some specific help.
-- aviscat AKA Maria |
|
|
|
|
#2 |
|
XPW
Join Date: Jun 2002
Location: New Hampshire, USA
Posts: 9,464
Reputation: 265
|
Well, what have you done so far?
The general steps needed are: 1. Add the field to the customers record in the database using phpMyAdmin 2. Ask for the data in an appropriate form. If you're unsure how to do this, find another field that already exists that has the same general properties and duplicate it, changing the field name as appropriate. 3. Be sure to call tep_db_prepare_input on the customer-entered data to prevent a security hole. For example, create_account.php does: PHP Code:
Again, the easiest way to add something new in osCommerce is to find something already there that is similar and copy it.
__________________
Steve |
|
|
|
|
#3 | |
|
Join Date: Nov 2004
Location: Texas
Posts: 24
Reputation: 5
|
Quote:
That's what I have been doing. Will also need to see this field in the admin section but I am thinking that if it updates on entry it will be there in admin. I have already coded the text box and it does appear but of course it is empty. Thanks, -- aviscat Maria |
|
|
|
|
|
#4 |
|
XPW
Join Date: Jun 2002
Location: New Hampshire, USA
Posts: 9,464
Reputation: 265
|
In the code for admin, you will also have to add the new field to queries that display the customer record and then add code to display the new field. Do be aware that the customer record is not shown for orders - you would perhaps need to copy information to the order record (customer details for a specific order are in the order record - the customer record is changeable by the customer at any time.)
__________________
Steve |
|
|
|
|
#5 | |
|
Join Date: Nov 2004
Location: Texas
Posts: 24
Reputation: 5
|
still not updating
Quote:
I have added all the above to my code on the admin side and yes the box shows up on the admin side - empty. The site is http://felinepharmacy.com//catsafratsrx/catalog/ if you want to take a look at it. -- aviscat still AKA Maria |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|