Jump to content

bigjoe11a

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

About bigjoe11a

  • Birthday 05/04/1959

Contact Methods

  • Website URL
    http://www.pro-forums.info
  • Yahoo
    bigjoe11a

Profile Information

  • Gender
    Male
  • Location
    Ohio USA

bigjoe11a's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi! Mark, Kay is right and your error is in the query, How ever I wouldn't try and code it like this. Try using a constant and not variables. define('TABLE_NAME','ost_help_topic'); Then just use the defined constant. Using global in your code is not all ways a good idea.
  2. In my project. I wanted an option that was going to give me more control over what my users can and could not do. I fount a ACL Sample and well the guy that made this must have been drunk. Any way I been working with it and putting it together so that it will work. The problem is that when I view the users current permissions it doesn't seem to display then right. Blow is the code i have in a switch that I use to manage each users permissions. The $_GET['uid'] gets the users id from the URL in the admin section. case "manage": //$userACL = new ACL($_GET['uid']); $userACL = new ACL($_GET['uid']); echo '<h2>Managing '.$userACL->getUsername($_GET['uid']).'</h2>'; echo '... Some form to edit user info ...'; echo '<h5>Roles for user: (<a href="users.php?action=roles&uid='.$_GET['uid'].'">Manage Roles</a>)</h5>'; echo '<ul>'; $roles = $userACL->getUserRoles($_GET['uid']); foreach ($roles as $k => $v) { echo "<li>" . $userACL->getRoleNameFromID($v) . "</li>"; } echo '</ul>'; echo '<h6>Permissions for user: (<a href="users.php?action=perms&uid='.$_GET['uid'].'">Manage Permissions</a>)</h6>'; echo '<ul>'; //$uparms = $userACL->getAllPerms($_GET['uid']); //$uPerms = $userACL->getUserPerms($_GET['uid']); //$aPerms = $userACL->getAllPerms('full'); $aPerms = $userACL->perms; //foreach ($perms as $k => $v) foreach($aPerms as $k => $v) { //echo 'fdfdsfsd :'. $v['value']; //if ($v['value'] == false) { continue; } if($v['value']) { // if (!$v['value']) { continue; } echo "<li>" . $v['Name'] . ' : Allowed </li>'; //if ($v['inheritted']) { echo " (inheritted)"; } } else { echo "<li>" . $v['Name'] . ' : Deny </li>'; } echo "</li>"; } echo '</ul>'; break; If any one needs any extra info. Please let me know.
  3. Thanks any way. I'm just not going to take time out to look threw 100's of pages just to find one sample.
  4. Explain. Why won't it be a good idea. Since there are CMS in PHP that use this option. and can you give me a sample of how to use mysql_real_escape_string().
  5. What I'm trying to do is insert a HTML page into a mysql database and with no luck. Can some one show me how to do this. insert into 'templates'('name','template') values ('header',' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script language="javascript" src="click.js"></script> <link href="styles.css" rel="stylesheet" type="text/css"> <title>{SITE_TITLE}</title> </head> <body> <table width="99%" align="center" height="82" border="0" cellpadding="0" cellspacing="0" class="header"> <tr> <td align="center"><h1>{SITE_NAME}</h1></td> </tr> </table> ');
  6. 1) No I don't expect any one to do any thing 2) This forum section is a joke 3) This forum section is being added to my blacklist 4) Just delete or remove my account. Since no one is wanting to even try and help
  7. Right, and that's a joke. The idea of having a forums section is to help people. Not charge them for what they may or may not need. If that's the case, Your joke is in poor taste.
  8. Thanks Night, Your not getting the idea. I'm looking into adding template system to the project that I'm working on how. See a Template can not be a PHP page. Ok, A template is all nothing but HTML with some CSS. Like using front page. You would use front page to create a form. Or a HTML page. Then you would insert that into a mysql database. and Then you would display that form when you needed it. This option is added in all types of forums Like XMB, SMF and many others too. I'm sorry there is no other way to explain this so you can under stand. If your run a forums section. In the Admin Section. There should be an option to create, edit and delete Templates. Try looking at that if you have that option Joe
  9. This editor is jumping all over the place. I can't even be sure of what I'm typing, Admin need to check on that.
  10. Thanks, Night, How ever untested code never works and well your doesn't work. I don't see any since in making some thing that's unsetted and you should all ways test your code before posting it. I was getting all kinds of errors. I never done any thing like this before so I have no idea on how to fix your code or my code. See the idea is that I have 3 settings in a mysql database. The idea is too turn thoses 3 settings on or off on the setting.php page, With not having to edit the page it self. if($settings['banner'] == 'off') { echo 'This are is closed'; exit; } if($settings['banner'] == 'on') { echo '<a href="banner.php">Banner</a>'; } any way get the idea. and one more question, ehy does this edit jump all over the place. I can't even be sure of what I'm typing Joe
  11. 1) I don't know how to do that At the top of your script, put: <?php error_reporting(-1); ini_set("display_errors", 1); ?> Also, Google and the PHP manual are your friends. If you don't know something, always search there. You seem to be very confused about what your form contains and how to pass that info along to the db. You should probably show us the form itself so we can see exactly what your db query should be. Also, since you're using a DbConnector object, you most likely don't have to write: $db->DbConnector(); An object's constructor is called automatically when one asks for a new object (e.g. $db = new DbConnector(); ). The form your asking for is all ready included with that PHP script above. I added the form to the PHP and then just have the script call the same script. and I'll try and add that error option to the top of my script and see what happens. It's like I said I never done this in PHP before and it all new to me. I been coding PHP for 4 years and I think it's about time I learn how to do more advance PHP.
  12. 1) I don't know how to do that 2) Yes I know that. That's why I'm asking for help. 3) I know, that. The vars come form the form it self. Just above that line I added 3 $temp? = $_POST['name'];
  13. Thanks guys, how ever that doesn't help me to get this to work.
  14. I add that in the code. I psted my new code below, and it passes nothing, Nothing at all <link href="mainframe.css" rel="stylesheet" type="text/css"> <?php require_once '../config.php'; $db = new DbConnector(); $db->DbConnector(); if(isset($_POST['Submit'])) { print_r($_POST); exit; $temp2 = $_POST['name']; $db->query("'UPDATE '".SETTINGS_TABLE."' SET option='".$temp1."', option='".$temp2."', option='".$temp3."''"); echo 'Process complete'; } $result = $db->query('SELECT * FROM '.SETTINGS_TABLE); echo '<table border="2">'; echo '<tr>'; echo '<form action="settings.php" methed="post">'; while($row = $db->fetchArray($result)) { echo '<tr>'; echo '<td>'.$row['setname'].'</td><td><select size="1" name="'.$row['setname'].'">'; if($row['option'] == 'on') { echo '<option value="on" selected>on</option>'; } else { echo '<option value="on">on</option>'; } if($row['option'] == 'off') { echo '<option value="off" selected>off</option>'; } else { echo '<option value="off">off</option>'; } echo '</select>'; echo '</td>'; echo "</tr>"; } echo '<td><input type="submit" value="Submit" name="Submit">'; echo '</td>'; echo "</tr>"; echo "</form>"; echo "</table>"; /* */ ?> <h2>Settings</h2> <a href = "admin.php">Admin Panel</a>
  15. Maybe I should find another forums section, since this one isn't panning out
×
×
  • 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.