Jump to content

DrDre

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

DrDre's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It all depends on what your intending to do with that include. Is it a form to login? If so, you can use output buffering to make your current file work without errors, but there is a better way to do it than what your doing if that is whats in get_connected.php use this as a last resort to make it work: <?php session_start(); ob_start(); require ('get_connected.php'); $data=ob_get_contents(); ob_end_clean(); if (isset($_POST['user']) && isset($_POST['password'])) { $sql = "SELECT * FROM users"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); if ($user == $row['user'] && $password == $row['password']) { $_SESSION['Approved'] = 1; } else { $_SESSION['Approved'] = 0; } header("Location: admin_canada.php"); } } } if (isset($_GET['logout'])) { session_destroy(); header("Location: canada_login.php"); } echo $data; ?>
  2. Such hostility heh.. Thats all personal preference I guess, As a forum admin I find IPB to be the top and all the security holes get fixed as found. As for the emails, maybe its because your an admin its not restricting you, but if you read my post again you'll understand what I mean.
  3. I am curious why PHPFreaks switched from the top of the line forum software IPB to SMF :x? SMF is really bugging me now, as I had a forum subscribed too and was wondering why I was no longer getting email alerts for the forum and noticed it wont send you any more emails after its sent you one until you visit the forum and read them... This bugs me because alot of times I see a topic title and I know its not interesting to me, and then another email comes with an interesting topic Id read it, well now Im not getting that 2nd email due to SMF's little difference over IPB :( Can that little thing be disabled for subscriptions? its really annoying :(
  4. So your asking how to split the array into 2 columns? You can easily do this by toggling a boolean or something in a for statement like this [code=php:0]<? $array=$thearraydata; $newarray=array();//empty foreach($array as $id => $data) {   $switch=($switch != 0 ? 0 : 1);//If $switch != 0,$switch=0, else $switch=1   $newarray[$switch][$id]=$data; } $leftcol=$newarray[0]; $rightcol=$newarray[1]; ?> Now your arrays will look like $leftcol = Array (     [0] => Array         (             [name] => Caroline             [description] => Description of Caroline             [url] => http://ww.caroline.com             [name] => Caroline.jpg             [path] => /path/to/         )     [2] => Array         (             [name] => Tony             [description] => This is a description             [url] => http://ww.Tony.com             [name] => Tony.jpg             [path] => /path/to/         ) ) $rightcol=Array (     [1] => Array         (             [name] => Eric             [description] => description of Eric             [url] => http://ww.eric.com             [name] => Eric.gif             [path] => /path/to/         )     [3] => Array         (             [name] => Jodi             [description] => description of Jodi             [url] => http://ww.jodi.com/             [name] => Jodi.jpg             [path] => /path/to/         ) ) And you can use the elements as $leftcol[0]['name'], $leftcol[2]['name'] or like [code=php:0] <table><tr><td> <? foreach($leftcol as $data) {   echo '<a href="'.$data['url'] .'" alt="'. $data['description'] . '">' . $data['name'] . "</a><br>\n"; } ?> </td><td> <? foreach($rightcol as $data) {   echo '<a href="'.$data['url'] .'" alt="'. $data['description'] . '">' . $data['name'] . "</a><br>\n"; } ?> </td></tr></table> [/code] Or however you plan to use it. Yes it could be done simpler, I layed it out like this so it would be easier to understand what exactly it is doing.
  5. This is an HTML question, not PHP :/ Im not really a frameset pro, dont recommend even using them, so i cant really help you here.
  6. Unless you leave your browser open 24/7 refreshing every second, theres no way to make it on a php level schedule things to happen. So yeah you got to use cron jobs or at as said above. php works as its called, it doesnt run 24/7. So unless its being run at the time being needed it doesnt know to run
  7. Its more of customizing IPB to match your site. Adding in elements to the theme wrapper to make it match. Look at the Global HTML section of PageHeader PageFooter sections, code your site in accordinglingly, or. in index.php at top include a file to store html to use on forums (ie your sites design html) to set $myheader and $myfooter then you can access it in the theme files by {$GLOBALS['myheader']} and {$GLOBALS['myfooter']} So you can manage the header/footer outside of ipb's skin.
  8. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]you should never really use the @ operator[/quote] I would never say you should not use it, and more of say you should use it in as most places as possible. Say a connection to a database, you will definitly want to use it there and use your own error output messages on runtime enviroments.. Debugging/development.. yeah you should not use it, but on a release of a script what if the connection to db failed and say username is shown in the error string, thats not information id really want to be showing. If theres a possible chance an error may arise on an action, I would recommend supressing it and handle the error with your own output.
  9. DrDre

    CSS bug

    I just went dirty and used a table to setup the div's ;x
  10. DrDre

    CSS bug

    Well after much hacking and testing I finally got my div's layed out correctly on firefox and IE, except IE has this weird bug. [a href=\"http://fanetworks.net\" target=\"_blank\"]http://fanetworks.net[/a] The border is suppose to be this square like border like it is on the nav, except on IE the nav is fine, but the contents left border is not correct. Ive tried many things, nothing wants to work CSS URL: [a href=\"http://fanetworks.net/index.php?css=/fanetworks.css\" target=\"_blank\"]http://fanetworks.net/index.php?css=/fanetworks.css[/a] (Yes this is a copy of a forum style, Site must match the forums you know :)) The blocks the content uses is borderwrap and row1 and cont (and borderwrapright ID) anyone know a way to fix this? edit: adding a red border shows that the left border isnt coming up at all.
  11. [code] function readcalendardata($month,$year){    global $ctuser; [/code] Gotta make it global.
  12. [code]<? //mysql stuff to get $new ob_start(); ?> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="BodyText">         <?php do { ?>           <tr>                 <td class="SmallText"><font color="#999999">RELEASED:</font> <a href="<?php echo $row_new['homepage']; ?>"><?php echo $row_new['name']; ?></a></td>           </tr>           <?php } while ($row_new = mysql_fetch_assoc($new)); ?>       </table> <? $content = ob_get_contents(); ob_end_clean(); $f=fo pen('myfile.txt','a'); fwr ite($f,$content); fcl ose($f); ?> [/code] Save to a php file, then look into Cron Jobs (google it if you need to) And setup a cron job to run php /path/to/file.php (and some other parameter i cant remember) every 20 min Wow... odd.. the staff here has some special code that throws 403 forbidden if you try to type code that accesses files... namely the fw rite code remove the spaces from the file writing functions. testing fputs();
  13. Read reply below... Theres some code in these forums added by phpfreaks which is blocking the code needed :x
  14. [code]if(magic_quotes_gpc()) { $somecontent = stripslashes($somecontent); } if (fwrite($handle, $somecontent) === FALSE) {[/code]
×
×
  • 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.