Jump to content

laffin

Members
  • Posts

    1,200
  • Joined

  • Last visited

Everything posted by laffin

  1. use a hidden field or use sessions
  2. I see this line } elseif ($detalles == "") but I dun see the beginning if statement. if(expression) { block } elseif(expression) {block}
  3. a lot of linux/unix servers come with wget, if u can shell to wget is another possibility.
  4. This is wut I was talking about a bit earlier. instead of parsing the file, u can include it. <?php function config_load() { if(!file_exists('settings.php')) { $config=array('login_required'=>1,'redirect_enabled'=>1); $temp=serialize($config); $content="<?php\nif(!defined('loader')) die('Unauthorized access');\n\$config=unserialize('{$temp}');\n?>"; file_put_contents('settings.php',$content); } else { define('loader',1); include('settings.php'); } return $config; } $config=config_load(); print_r($config); ?> Kinda some fun code to play with Good luck Note: Because the config array was simple (numerics), I did not need to encode them with special functions, if u do need to do this, u may want to use something like urlencode or similar text based encoders shud work fine
  5. the code for settings is kinda wrong. it shud be more like: <?php die('Unauthorized Access'); ?> login_required:0; redirect_enable:1; cuz if put it into the php code section, depending on the php.ini. u can display or log those errors, so no need doing that. and does settings.php need to be in that format? it looks like u are doing manual editing of the file itself. when u can make it dynamic if u make it dynamic, u can use serialize/unserialize, and a webform to update the file. so u can do an include file instead of parsing the file.
  6. niy ya can use the session id as a unique file name and retrieve the file easily. [code] $sessid = session_id(); shell("ls -ratfl > userfiles/{$sessid}.txt"); [/code] I think is what he is referring to. so u can retrieve eash file that the user requested [code] $sessid = session_id(); $fg = file_get_contents("userfiles/{$sessid}.txt"); [/code] pretty nice idea overall.
  7. did u read up on strpos, it finds strings within a string and returns the position. add in strlen, to get the length of the needle word. and substr to remove things ya dun want <?php $keyword="mike"; $mystring = "hello welcome to my house. my name is mike I live here"; $pos=strpos($mystring,$keyword)+strlen($keyword); $newstring=substr($mystring,$pos); echo "'{$newstring}'"; ?>
  8. mayby something like val=9.3; nval=int((val*+.5) /8; echo nval; I think that shud work. why the * 8 and / 8? (.5 is used for rounding) A trick i picked up here in the forums to round every half, u can get the rounded version of the number doubled (*2) so to get 8ths, u need to double our double and doublt it again *2 = halfs *4 = quarters *8 = Eights *16 = Sixteenths
  9. U can try adding the 'I' Parameter to the date format string u may also wish to look at supported timezones
  10. before calling the date function set the timezone with date_default_timezone_set(); or put it in one of the global includes date_default_timezone_set("GMT"); See how that works
  11. The only way to detect inactivity is really through java(script). I base my opinions on the code presented. Which just destroys a session if a specific amount of time has elapsed. Which is exactly wut the lifetime of a cookie does. A Cookie Lifespan can only last as long as the expiry dictates. session_set_cookie_params U can use this to set the lifespan of the cookie, or you can edit your php.ini in order to shorten the lifespan of the sessions.
  12. Thats wut the session lifetime is for. to log a user out after x seconds by killing the session. Unless you are specifically using the time the user has been on the site, there is no need to manually log them out when you can set the lifetime of the session cookie, which will get updated when they navigate to another page or refreshing thus resetting cookie.
  13. wudnt it just be easier to use session_set_cookie_params(600); session_start(); Unless you are specifically doing something with ActiveTime? also avoid using frames and sessions....
  14. I see no session_start();
  15. Originally TBDev 06 Didnt have compact support TB, TB INST, and XTBDev Do have compact mode support. U can browse the svn on sourceforge TBDev.net Sourforge SVN
  16. Well that may be a problem, as u will have to modify vBulletin in order to add any type of human response interface. About the only other way, is to check if the user is already logged in. if not send em to the login page. otherwise load up the standard index page. This could be accomplished with session checking
  17. U may learn a lot more if u already look at some php tracker projects. As they have to generate those compact codes, it's just a prime learning spot. I started learning php programming from one of them php trackers. The biggest support forum for a php tracker is for TBDev torrent trackers. TBDev Portal Just sign up, look around, and download the code. The code you will be interested in is in announce.php Good luck
  18. Yes, sounds like a fun project. Good luck on it.
  19. Well hard part is design of the database, as u will need some foresight when building and testing the code. but you shud know how ya want things. u should look into MySQL DATETIME formats as will as PHP's time functions. Building the calander is just a question of wut yer needs are. So ask yerself wut you need, and that will help design the db for u. And Remember, you don't need to setup every possible date time combo, you can have flags for the available dates. [sql] id as INTEGER PRIMARY KEY NOT NULL, starttime as DATETIME NOT NULL, endtime as DATETIME NOT NULL, comment as text available as tinyint as a starter sql for an starter
  20. If this is on a local server, and the retrieval is also on the local server. U may opt to use ob_start/ob_end_clean functions. This will buffer the output, until ob_end_clean is called, which returns a string with the buffer contents (output to browser). from there ya can save or do wutever ya like.
  21. As somone else suggested. Use Wamp or Xampp. its an all in one packages, with apache mysql php. Once it installs, its already preconfigured. Just install & Go. Wamp vs Xampp Althought I have seen some configuration probs with Wamp on a few projects. It does have a nicer set of tools for windows, the tray tool is a lot better. But they both get the job done.-
  22. But if u got some good coding skills ya can make it a bit more dynamic. I have built several module loaders, based on my needs. One module loader, which is the root of the site, just processes pages based on the pages db entry. A Simple module loader, I wrote for QuickPHP (Lightweight web server primarily for testing/debugging php). processed modules and the global environment variables, as well as providing a log for. but its all about wut u need, and how u wish to load the modules. As phil said, its all about seperating the different pieces, than either load them manually, or develop a system for loading the pieces.
  23. I think he's saying using the sessions as a cache, as sessions do get destroyed over time. but it shude provide a mechanism to speed up the display process if this is used throughout yer site. The only problem I see is when u get into userlists, as than u have to go through code for each user in the list. Bout the only thing I can suggest, is try compacting the code more. the ifs do there job, but ya may accomplish the same thing with an array (Per user field, i notice you have multiple fields.
  24. $_SESSION['posted']=$_POST; Remember $POST is an array and this just creats a multi-dimensional array. as $_SESSION['posted']['username'] or wut have u....
  25. make it into a function, through it into a global include file....
×
×
  • 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.