Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. no problem... sorry... i dont know crons... cant help ya out with that... lol only problem with sleep()  is that while() functions can time out... it may just cause ya some problems there...
  2. question on the same topic... say i have this function... [code] <? function fatal_error($string=""){ $string = 'You have an Error on line #'.__LINE__.'<br><pre>'.highlight_string($string); if(mysql_errno()!=0) $string.= '<hr>'.mysql_errno().': '.mysql_error().'<hr>'; $string .= '</pre>'; die("Fatal Error: $string"); } fatal_error(); ?> [/code] how can i get that set to 8 instead of 3?
  3. technically... no however... headers are always sent along whenever you click on a link... but cookies and sessions exsist only within the browser/computer... the first thing php does is grabs the headers, then it goes through the code systematically. when php comes to a cookie/session_start, it goes to the browser and grabs the requested information. now if any information has already been sent to the browser, php cant request more information and errors out. hence them errors :-)
  4. $_SESSION[] is technically not a header. however since it is stored within the browser itself... php does grab them from the browser as tho it were a header. it does this before anything is returned to the browser, which is why session_start(); after text has been output dies immediatly. simple fix is putting session_start(); before the ob_start(); that should fix it.
  5. glob() looks in the specified folder, and returns anything alikened to it... *<-- all files *.xml <-- all xml files etc... therefore... [code]$xmlfiles=glob('yourfolder/*.xml'); print_r($xmlfiles);[/code] that makes $xmlfiles an array() of all the files in that folder. [code] output array("0"=>"test.xml", "1"=>"blah.xml") [/code]
  6. on the page itself, set a $_SESSION[time]=time(), then on your exiting page, you just $seconds=time()-$_SESSION[time];
  7. not that i know of... however if you set a blank page to refresh every 5-10 seconds, have your phpcode there, that'd do the job... no?
  8. simplify... [code] $xmlfiles=glob('yourfolder/*.xml'); [/code] and the "if ($file != "." && $file != "..")" removes the two directories from the top... (.==self  ..==parent)
  9. assuming you have a database... [code] <? $result=mysql_query("SELECT * FROM table"); $i=0; echo '<table>'; while($row=mysql_fetch_array($result)){ if($i==0) echo '<tr>'; echo ' <td>'.$row[row1].'</td>'; echo ' <td>'.$row[row2].'</td>'; echo ' <td>'.$row[row3].'</td>'; $i++; if($i==3){   $i=0;   echo '<tr>'; } } echo '</table>'; ?> [/code] something to that effect :-)
  10. whats the exact error? [code] $resultmixed = mysql_query($querymixed) or die(mysql_error()); [/code]
  11. assuming your are variable based, it wouldnt matter where you include() it... if their not... you need to include() it exactly where you want the file to show.
  12. [code] <a href="?file=<?=urlencode($filename)?>">Delete</a> [/code] [code] unlink(urldecode($_GET[file])); [/code]
  13. that doesnt work for some isp's, this will :-) [code]<? function get_host(){ if(!$_SERVER[REMOTE_HOST]) return gethostbyaddr($_SERVER[REMOTE_ADDR]); else return $_SERVER[REMOTE_HOST]; } ?>[/code]
  14. [code] <? session_start(); $password=md5($_POST[password]); $result=mysql_query("SELECT * FROM users WHERE `$username`='$_POST[username]' AND `password`='$password' LIMIT 1"); $row=mysql_fetch_array($result); if(!empty($row)){ $_SESSION[user]=$row; header();#go back to homepage }else{ header();#go back to login } unset($password); ?> [/code]
  15. no prob... trim() removes spaces from either side of a string, my str_replace() above removes all spaces from the string, wether it is at the end or between words...
  16. well ya... once you get past the incompetance of javascript having something that is client side with the power of php... your limits are practically endless...
  17. you'd want to use ajax for something like that...
  18. no prob... just make sure on your "save" page you kill that cookie :-)
  19. set a cookie on one page, and if the other page finds it... die() or whatnot...
  20. no... i dont think so... you'd wanna use $_SERVER[QUERY_STRING]
  21. you uset $_GET[] file.php?op=test [code] echo $_GET[op]; [/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.