Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. just a quick part of it... $q=mysql_query("SELECT * FROM `accounts` WHERE `online`='1'"); $r=mysql_fetch_assoc($q); $numberofitems=200;#pull number from the db $itemsperuser=round($numberofitems/mysql_num_rows($q)); that'd show you how many items each user can see... you'd have to set a self updating "auto_increasing" number on the accounts table, of the order of login... to get where they stand in the list... $order=$r[2];#pulled from db $start=($itemsperuser*$order)-$itemsperuser;# $start=(100*2)-100; starts at 100, if 4 online, start would be 50, etc... $q=mysql_query("SELECT * FROM `` LIMIT $start, $itemsperuser"); something to that effect... sorta like pagination... but the "page" number comes from the order # set in the database, not in the url...
  2. yes, you'd want to set a cron job to run a script every hour...
  3. i would guess yes... if your exit;ing before the connection is closed... i could only assume that the pconnect would stay connected... just a guess... logical but still could be wrong...
  4. javascript... parent.window.location=''; if i'm not mistaken
  5. print_r($_SERVER); that'll show you for sure wether your variable is being set(typo maybe then?)... or not...
  6. another way... $q=mysql_query("SELECT * FROM `yourtable`"); $i=array(); while($r=mysql_fetch_assoc($q)) $i[$r[itemid]]+=$r[quantity]; there you then have an array with all the itemids and their respective quantitys... sort it and yer ready to go... take yer pick...
  7. pretty much sums it up... when you get right down to it... everything is accessable to a SA... if they wanted to break a site... they could just delete the config file... simple enough...
  8. thats saying that your not logged in as visitor... hence it wont say that you are logged in as visitor, since you arnt
  9. the only things that php has access too... are what is sent to the server via the headers... and the windows login id is FAR from being sent... if this is for an internal server... i'd suggest sorting by ip address... but other then that..............
  10. seeing as php runs solely on the server end, and javascript is mostly sandboxed away from file level functions on the client computer... no you cant...
  11. that'd be my first suggestion... he just wanted the header/footer to be of the same number... which has to be a touch more complicated...
  12. as far as clean code... thats completly subjective... i would say, having it directly into the html means that the php parser doesnt have to touch it... as far as your prior setup... i'd say... $h=glob('scripts/photos/header-*.jpg'); $f=glob('scripts/photos/footer-*.jpg'); $i=rand(1,count($h)); echo '<img src="'.$h[$i].'">'; echo '<img src="'.$f[$i].'">'; that may be simpler in fashion, yet more complex in function...(more chance of variables being overwritten between parsing, and outputting)
  13. well... firstly you want a / at the end of your glob() $f = glob('photos/*/'); that way it will ONLY grab folders... (errors cause me headaches... best to think ahead of them ) secondly... you dont need </img> tags... and thirdly... what tags are being output?
  14. move your refresh into php if(!isset($firstload)){ echo '<meta http-equiv="refresh" content="5">'; $firstload=true; }
  15. and as far as a delayed page refresh... you'd wanna look into meta refresh...
  16. yer gunna want to use cURL for this... php.net/curl ob_start(); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.google.com/search?q=cache:www.yoursite.com'); curl_exec($ch); curl_close($ch); $o=ob_get_contents(); ob_end_clean(); that would set the entire page specified into the $o variable... in which you just need a simple eregi() to check for the 'This is Google's cache of' string...
  17. ok... you can simply $c=count($f); which will give you the number of files in the specified folder... and with the glob... it can search for specific content if that helps too... $f=glob('images/header-*.jpg'); the * is just a wildcard... it'd grab header-1.jpg, header-2.jpg while leaving out header1.jpg... for example...
  18. <? $f=glob('images/*');#grabs all the filepaths in the images folder, sets into an array $i=$f[array_rand($f)]; #sets a random imagepath from the prior array into $i ?> <img src="<?=$i?>"> #shows the image prior set and presto! random image from the images/ on each load...
  19. secondly, then i would guess, you have some complications in the file name that is being entered dynamically into the <img> tag... you may want to check for spaces, and whatnot and urlencode/urldecode to avoid that
  20. change the 's around the variable to "s... the ' is a literal output... meaning exactly what you put in, is what you get out... while "s is a relative output, meaning it'll substitute out the variables $this->Cell(100,10,"Proposal {$proposalid}",1,0,'C'); {}s arnt technically necessary, but a good precaution
  21. i would say firstly, $top_image = imagecreatefrompng('$flag'); you need quotes on that, not 's... 's kill variables... it is looking for the file by the name of '$flag' not for the one specified in $_GET[flag]...
  22. $ourFileName = "directory/testFile.txt"; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file"); fclose($ourFileHandle);
  23. personally... i would create a global boolian variable var pause=false; then in your rotating function if(pause==true) return; then you simply put an onmouseover/out pause=true/false; this way it will start rotating onload(when you set that part of the program up) and when you mouseover it, it'll pause, and mouseout it'll resume where it left off... this code may be rather raw... but i made something like this a LONG time ago... http://www.evergreengolfcentre.ca/ picture strip loads on default, scrolls when its done loading, pauses on mouseover, resumes on mouseout... seems like a comparable idea to yours...
  24. echo "<SCRIPT LANGUAGE='javascript'>window.onload=function(popupMsg('message here'));</SCRIPT>";
×
×
  • 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.