Jump to content

jostclan

New Members
  • Posts

    6
  • Joined

  • Last visited

jostclan's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I can certainly use JQuery, but I do not know the language... do you have some code which would help resolve this?
  2. kicken- These announcements are being created (added to the database) by staff using tinyMCE. They select the insert hyperlink and pate the file file path. They are not skilled enough, nor care enough to add the redirect. I hope this helps answer the why.
  3. I really need some help with this one. I am confident it can be done easily, but i can not figure it out. A very simplified look at my "announcements_current.php" page follows: <div class=”main_nav”> <a href=”about.php”>About</a> <a href=”contact.php”>Contact</a> <a href=”resources.php”>Resources</a> </div> <div class=”announcement”> /* Announcement 1 */ <p>For more information on this subject <a href=”/file_path/file0001.doc”>click here</a>.</p> </div> <div class=”announcement”> /* Announcement 2 */ <p>For more information on this subject <a href=”/file_path/file0002.doc”>click here</a>.</p> </div> As the above page (announcements_current.php) loads it reads the mySQL database for current announcements, loops through each record and displays the page. I would like to have all hyperlinks within the <div class="announcements"> rewritten on load to be <a href="file_open.php?aFile=/file_path/file0001.php"> (of course whatever the file name actually is). My file_open.php updates a database table with the date/time/user_id of when this file was accessed, then opens the file. Of course I do not want to rewrite any other hyperlinks not in the correct class. I am sure this can be done, but i can not fire out how to accomplish this onload. Can you help?
  4. Thanks folks! I appreciate the welcome and I am impressed on the quick responses. Between the responses, a small light bulb went on. Each user can have one or more groups to which they belong. Again, I wanted to show all available groups as checkboxes, and have each checked (one or more) based on the user’s prior choices. I solved this like this: <?php do { $iTabIndexCounter+=5; $isChecked=false; mysql_data_seek($user_groups,0); while($row_user_groups = mysql_fetch_assoc($user_groups)){ if($row_user_groups['pkID'] == $row_groups['pkID']) { $isChecked = true; } } ?> <br /> <label> <input <?php if($isChecked == true) {echo "checked=\"checked\"";} ?> type="checkbox" name="admin_groups[]" value="<?php echo $row_groups['pkID']; ?>" id="admin_groups_<?php echo $row_groups['pkID']; ?>" tabindex="<?php echo $iTabIndexCounter;?>" /> <?php echo $row_groups['group_description']; ?> </label> <?php } while ($row_groups = mysql_fetch_assoc($groups)); ?> I tested this on four users and all are returning the proper values. It may not be the most elegant or tight code, but it is where I am currant at in my skill set. I have not seen the while(list command so this one is new to me and I will look at this. Again I appreciate you being there and giving me ideas.
  5. Hello fellow PHP developers. I have been stuck on a problem I just can not figure out. I am developing a couple forms (insert and update) that users fill out. On this form is general user information (first and last name fields, etc.) as well as a checkbox group based on an available “groups” table. When the user fills out the form and makes their checkbox selections I write the user information to a user table, and write the user’s checkbox choices to a user_group_xref table (unique_id, fk_user_id, fk_group_id) for as many choices as the user selected. The fk_user_id is a foreign key to the user table, and the fk_group_id is a foreign key to the group table. User_table Unique_id, first_name, last_name, address Groups_table Unique_id, group_description, active_flag User_group_xref table Unique_id, fk_user_id, fk_group_id This all works correctly for the insert, and I can make the selections out of the tables no problem. To get the users previous selections, I query the xref table and join it back to the group table for the description. My user_groups query returns g.unique_id, g.group_description for the appropriate user. I generate the checkboxes with the following code: <?php do { ; ?> <br /> <label> <input type="checkbox" name="admin_groups[]" value="<?php echo $row_groups['pkID']; ?>" id="admin_groups_<?php echo $row_groups['pkID']; ?>" tabindex="<?php echo $iTabIndexCounter;?>" /> <?php echo $row_groups['group_description']; ?> </label> <?php } while ($row_groups = mysql_fetch_assoc($groups)); ?> This works fine in generating the checkboxes. How do I at the same time check those checkboxes previously selected? The only thing I can think of is to show only those checkboxes actually selected, but I want all checkboxes displayed, and those previously selected checked. Any suggestions would be greatly appreciated.
×
×
  • 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.