Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. yes, php would be what you would want to use for both the seperate logins, and the calendar...
  2. sending automatically from one page to another? best to use $_SESSION's...
  3. depends on your form... $_REQUEST holds both $_GET's data and $_POST's data so you can always access form data through $_REQUEST... now... on your <form method="post/get"> that determines how the form is sending the data to the next page... i use post, nearly always... now... after form is submited... you can access it through $_POST[fieldname];
  4. trust me... you wouldnt want to refresh the page all the time... you'd want to use ajax&php for that...
  5. HAPPY 3000!!!! sorry... i'm done...
  6. obviousally this will always return 0 minutes... but its only sleeping for 10 seconds...just pull time1 from the database... <? $time1=time(); sleep(10); $time2=time(); $dif=$time2-$time1; $min=0; while($div>=0){ $min++; $dif-=60; } echo "$min minutes ago" ?>
  7. yup! you could have it as text or whatever you want, and it wont affect php atall... as long as its integers, its all good
  8. change it from decimal, to text/varchar...
  9. i've often wondered that... on the one i made, i used ajax, and told it to only grab the bottom 10~ posts, then have history...
  10. if ya say so... might cause you some more problems in the long run... but... your choice :-) $allpictures=array(); function get_picture($title){ global $allpictures; if(!empty($allpictures[$title])) return $allpictures[$title]; $query=mysql_query("SELECT * FROM `pictures`"); while($row=mysql_fetch_assoc($query)){ $allpictures[$row[title]]=$row[url]; } return $allpictures[$title]; }
  11. theres your problem... $vars are CaSe SpEcIfIc... you are $_GET['id']'ing in lowercase, and you link's ?ID='s are uppercase...
  12. only idea i could think of, on login, have it add a row to a table with id, email, ip, timestamp... if its a different ip address(so you only get 1 for each ip&email)... that way theres no mistakes, and it doesnt require anybody to click on anything...
  13. yup! get a less agressive antispam program
  14. here... just activate this function... it'll change your servers default timezone :-) <?php function set_timezone($timezone="0"){ switch($timezone){ case "-12": date_default_timezone_set('Etc/GMT+12'); break; case "-11": date_default_timezone_set('Etc/GMT+11'); break; case "-10": date_default_timezone_set('Etc/GMT+10'); break; case "-9": date_default_timezone_set('Etc/GMT+9'); break; case "-8": date_default_timezone_set('Etc/GMT+8'); break; case "-7": date_default_timezone_set('Etc/GMT+7'); break; case "-6": date_default_timezone_set('Etc/GMT+6'); break; case "-6": date_default_timezone_set('Etc/GMT+5'); break; case "-4": date_default_timezone_set('Etc/GMT+4'); break; case "-3": date_default_timezone_set('Etc/GMT+3'); break; case "-2": date_default_timezone_set('Etc/GMT+2'); break; case "-1": date_default_timezone_set('Etc/GMT+1'); break; case "0": date_default_timezone_set('GMT'); break; case "1": date_default_timezone_set('Etc/GMT-1'); break; case "2": date_default_timezone_set('Etc/GMT-2'); break; case "3": date_default_timezone_set('Etc/GMT-3'); break; case "4": date_default_timezone_set('Etc/GMT-4'); break; case "5": date_default_timezone_set('Etc/GMT-5'); break; case "6": date_default_timezone_set('Etc/GMT-6'); break; case "7": date_default_timezone_set('Etc/GMT-7'); break; case "8": date_default_timezone_set('Etc/GMT-8'); break; case "9": date_default_timezone_set('Etc/GMT-9'); break; case "10": date_default_timezone_set('Etc/GMT-10'); break; case "11": date_default_timezone_set('Etc/GMT-11'); break; case "12": date_default_timezone_set('Etc/GMT-12'); break; } } set_timezone('-5'); ?>
  15. you can do it that way... but i always prefer using id's for my indexes... doing them by name can be VERY tempermental... an example of one of my superfunctions... indexing pictures by `id`... first time its run, grabs all the information, puts it into the array, every next time, it just pulls from the array, only accesses database once $allpictures=array(); funcion get_pictures($id){ global $allpictures; if(!is_numeric($id)) return; if(!empty($allpictures[$id])) return $allpictures[id]; $query=mysql_query("SELECT * FROM `pictures`"); while($row=mysql_fetch_assoc($query)){ $allpictures[$row[id]]=$row[url]; } return $allpictures[$id]; }
  16. <? include "connectdb.php"; if(is_numeric($_GET[id])){ $S2=mysql_query("SELECT * from movies where id='$_GET[id]' LIMIT 1"); $S3=mysql_fetch_array($S2); print "$S3[name]"; print "$S3[plot]"; }else{ $D2=mysql_query("SELECT * from movies"); while($D3=mysql_fetch_array($D2)){ print "<A href='index.php?ID=$D3[id]'>$D3[name]</a><br>"; } } ?>
  17. then its not a matter of escaping the .'s... something else would be going on there...
  18. those are just comments... they dont affect anything... so if you really want/need to comment your files... for a changelog or whatallelse... go right ahead...
  19. header("Cache-Control: no-store, no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); there goes any/all forms of cache
  20. well... it really depends on how much you know, and how much time you have... my first newsletter program was ROUGH! but 2-3 versions later, and some idea pointers from my designer... and thats quite a different story...
  21. in the table, store the id of whoever made it, then on login, set $_SESSION[userid]=$row[id]; thats prolly the easiest way to verify, while not compromizing security that much...
  22. no prob :-) that one also saves $_GET[] querys... if you didnt catch that
×
×
  • 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.