Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. it shouldnt matter which page your removing the cookie from... as long as you have access to the function... or just use the bare essentials from it... setcookie('created', "", time()-3600); that works just as well... basically your just setting a blank cookie overtop of the old one, that expired an hour ago(immediatly)...
  2. <? function get_url(){ if(!empty($_SERVER['QUERY_STRING'])) return 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']; else return 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; } $_SESSION[address]=get_url(); echo $_SESSION[address]; ?>
  3. no... servers first store the cookie on the browser, then relate to it every time... you can do a simple test first...? setcookie("test","test",time()+3600); if(empty($_COOKIE[test])){ echo 'Please enable cookies!'; }
  4. <? function destroycookie($name){ setcookie("$name", "", time()-3600); } destroycookie('created'); ?>
  5. you cannot disable the back/forward buttons, however if you turn off your cache, and verify if the user is logged in on all of your "secured" spots... if they press back, it'd redirect them to a different page...
  6. use str_pad()... prolly your best choice... http://us.php.net/manual/en/function.str-pad.php
  7. on the pages that are secured by user, just put the if_empty($_SESSION[yoursessvar]) header(direct me away); or whatnot...
  8. no prob... that example updates daily... as long as the file is there, if there, it removes it automatically... just thinking outside of the box here
  9. ya... i'm sure theres a way of doing it... i'm assuming asp has something similar to (un)seralize(); and date(z); just instructions... if you want code, ask... lol just put a backup field on a sitewide field in your database somewhere... and set asp if(date(z)!=$sitewide[backup]){ update backup field get all information from database, put them into array, serialize() it drop that into a text file } then php if(date(z)!=$sitewide[backup]){ if(file_exists('backup.txt')){ update backup field get info from backup.txt unserialize(); it update product fields unlink('backup.txt'); } }
  10. forgive me, javascript is not my first language... some of this probably will be wrong... lol and just to make things php consistant... <s cript> function implode(seperator,array){ return array.join(seperator); } function explode(seperator,array){ return array.split(seperator); } var string=implode('|',array); </s cript> then you just need to set the string, to the cookie ... i included the explode there too if you want to go backwards :-)
  11. $user = "huh"; $loginmins = 100; echo "Welcome $user, logged in for $loginmins"; does that not work?
  12. on your select box, name it like "name[]"... php will then make it an array... so you... $box=implode("|",$_POST[name]); and store that value into the database :-)
  13. i didnt say cookies couldnt be arrays... i said they couldnt hold arrays... $array=array("asfd","1"); setcookie("array",$array); only gives errors... now... for javascript... you can turn arrays into strings like so... function implode(array,seperator){ return array.join(seperator); } personally... i havent found a way of exploding yet...
  14. yup! mysql_query("select * from players where jail !='21' order by level desc limit 100,200");
  15. no... cookies cannot hold arrays... now if one were to serialize/implode the array, sure it'd work... but its not an array then... its a string.
  16. a) thats javascript... not php... b) no, cookie cannot hold arrays...
  17. AAAAH!!! VILE CLASSES! *runs away* ohya... lol... it means one or more of your username/password/host are wrong... lol
  18. sorry... nocando... try posting in the freelancing forum...
  19. theoretically... yes... $query = mysql_query("SELECT col FROM tbl_name"); while ($row = mysql_fetch_assoc($query)){ $array[]=$row; } print_r($array); now you got a HUGE array of every row from your database...
  20. a) not without seeing your code b) did you add the autoincreasing row to your mysql table yet?
  21. nonono... they didnt destroy anything... they failed miserably... LOL... but its people like that, that give people like us, bad names
  22. no prob... just needed to change this... insertar($IBE, $tipo) so you could access the variables through the function
  23. as far as i'm aware, the GD librarys cannot work with video files... potentially animated gifs, but no movies
  24. <?php function insertar($IBE, $tipo){ $con = mysql_connect ('','','') or die ("no conn"); @mysql_select_db ('aerosim') or die ("hey somth wrong"); $sql = "INSERT INTO vuelos (`vuelo`,`tipo`) VALUES ('$IBE','$tipo')"; mysql_query ($sql) or die (mysql_error ($con)); } if($vuelo = ""){ $vuelo=rand(1000,4000); }else{ $vuelo = ($vuelo + rand(1000,5000)); } echo "IBE".$vuelo; $IBE="IBE".$vuelo; $tipo = "A330"; insertar($IBE, $tipo); ?>
×
×
  • 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.