Jump to content

adding a category to this php page...


louroberto

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.