louroberto Posted February 10, 2011 Share Posted February 10, 2011 Hello all, I am new to this forum and I am not an avid programmer but do have some experience but very limited. I am trying to add a category at the bottom of this php page. You will see the assign category section. I need to have a radio at the end of that list to say Bushings. I am looking through the code but can not seem to figure it out. Do I need to add the category in the DB first. It seems like this is happening on the fly when the page is called up. Any help would be great. It is a SQL database. I know being a beginner I am out of my league here but I have to try to get this done. Thanks in advance for any tips. Here is the link to the page I am working on: http://www.pennstateind.com/lib-admin.php Quote Link to comment https://forums.phpfreaks.com/topic/227286-adding-a-category-to-this-php-page/ Share on other sites More sharing options...
sunfighter Posted February 11, 2011 Share Posted February 11, 2011 The first and most important thing you should do is Back Everything Up that your working on. If you have a test board either on your server or on a computer you can use, then try things out there before modifying the real site. You need to do three things. Modify the HTML code, Modify the php code for recieving information and modify the php code for writing to the database(Maybe). Adding the category to the html is simple. place this line after the radio buttons: <label><input type="radio" name="category_id" value="11" />The New Category</label><br /> Only one button can be selected at a time so your database probably stores the number (value) of the button selected. So you don't have to change that(hopefully). You need to alter the php, which we can't see, that is probably at the top of your page (lib-admin.php). If you can't figure out how to modify that - post it here and we'll take a look. Good Luck Quote Link to comment https://forums.phpfreaks.com/topic/227286-adding-a-category-to-this-php-page/#findComment-1172811 Share on other sites More sharing options...
gizmola Posted February 11, 2011 Share Posted February 11, 2011 sunfighter has some pretty decent assumptions, however, the code could just as easily be creating the radio button on the fly using a lookup table. If that's the case, the only thing needed would be a new row in that lookup table, and no change of code. Without some code (just remove any database credentials, usernames or passwords) first. Quote Link to comment https://forums.phpfreaks.com/topic/227286-adding-a-category-to-this-php-page/#findComment-1172933 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.