Jump to content

teamatomic

Members
  • Posts

    1,202
  • Joined

  • Last visited

Everything posted by teamatomic

  1. Depending on where in your entry/login sequence you want to set the id. $_SESSION['sessid']= md5("$username".rand()); or $ip=$_SERVER['REMOTE_ADDR']; $_SESSION['sessid']= md5("$ip".rand()); HTH Teamatomic
  2. The first thing you need to do is to sort the dates array so the dates(months) are in order and grouped. array_multisort would work fine for that. Once the array is in ascending groups it should not be too hard to get them under the proper month. HTH Teamatomic
  3. look at PHPmailer http://phpmailer.worxware.com/ its easy to use and has some real good example scripts with it. HTH Teamatomic
  4. Using an API is usually going to be slow. Its better to get the files and use them locally. http://www.phpfreaks.com/forums/index.php/topic,291710.msg1382042.html#msg1382042 HTH Teamatomic
  5. http://www.phpfreaks.com/forums/index.php/topic,291710.msg1382042.html#msg1382042 HTH Teamatomic
  6. array_merge, array_unique HTH Teamatomic
  7. http://curl.haxx.se/mail/curlphp-2007-12/0051.html Just use the curl stuff as an example, skip the cookie parts. It should take you 5 minutes to get it working. HTH Teamatomic
  8. postfields is used with a query string, such as: username=joe_bananas&password=godfather99&folder=bonanno_family then you want to do something like: $page_contents=curl_exec ($c); echo $page_contents; HTH Teamatomic
  9. array_multisort is the function for sorting multidimensional arrays foreach ($myarray as $key => $row) { $count[$key] = $row['count']; array_multisort($count, SORT_ASC, $myarray); print_r($myarray); } just replace$row['count'] with whatever you want sorted, in your case it would be $row['order']. HTH Teamatomic
  10. str_replace("'","",$str) HTH Teamatomic
  11. http://code.google.com/p/xmpphp/ HTH Teamatomic
  12. Thats the start of unix time, well actually t-1 as it is seconds passed since 1-1-1970. So you are fudging it up somewhere. You say its WAMP, what does the date in your taskbar say and what does date("U") give you? HTH Teamatomic
  13. http://www.devshed.com/c/a/PHP/TAR-File-Management-With-PHP-Archive-Tar/ this is a good tutorial on using pear to manage tar files. As for Zlib, just think of the open/read/write/close functions the same manner as you would use fopen and its parts. In fact just think of any Zlib function as its comparable, by name, file function ie. gzseek == fseek. fopen fread/fwrite fclose ... gzopen gzread/gzwrite gzclose You might also want to consider gzfile(), which you would use the same way as file(), it puts the contents of a gz file into an array just like file() does. HTH Teamatomic
  14. Just make sure you have one for your php version and thread type. You can get one here maybe, http://downloads.php.net/pierre/ if you cant find the matching module then you can contact Pierre Joye on the PHP windows mailing list. HTH Teamatomic
  15. $age=321; if($age>50) { $multiplyer=floor($age/50);/number of times 50 was detected $remainder=$age%50//the remainder } You dont need to send 50 to your site multiple times.You only need send the age then do the calculations to know the multiplyer so you can do whatever $multiplyer times then work with the $remainder. HTH Teamatomic
  16. parse the access log. Apache does a good job of logging. see the above answer HTH Teamatomic
  17. Something like this: <div align="right"><script language="JavaScript"> random_num = (Math.round((Math.random()*96120152)+90.83187)) document.write('<input name="sn" type="text" id="sn" size="14" value="'+random_num+'"/>); </script> HTH Teamatomic
  18. @Hamza Whats the matter with looking for an answer on your own? It shows a bit of initiative and its a lot quicker to google than to wait for someone here to answer. Next issue: It is better to remain silent rather than to reply with a smart ass remark. You will only end up plonked. HTH Teamatomic
  19. As you can see there are many ways to do what you wish. list($domain,$tld) = explode('.',$url); if the results of explode could be varying, as if you really dont know how many dots the url would have then an array is good as you can work through it figuring out what you have. If, as you state, the url is a known and constant then it is easier to explode and assign the parts to variables all in one step. HTH Teamatomic
  20. Here is a simple example to get you started. As you can see this one uses prototype. <html> <head> <title>Weather Widget></title> <script type="text/javascript" src="prototype.js"></script> <script> function sendRequest() { new Ajax.Request("parse.php", { method: 'post', postBody: 'state='+ $F('state'), onComplete: showResponse }); } function showResponse(req){ $('show').innerHTML= req.responseText; } function sendCityRequest() { new Ajax.Request("parse.php", { method: 'post', postBody: 'city='+ $F('city'), onComplete: showCityResponse }); } function showCityResponse(req){ $('show').innerHTML= req.responseText; } </script> </head> <body> <div style="width:750px;"> <form id="widget" onsubmit="return false;"> <?php include("./states_select.txt"); ?> </form> <div id="show" style="margin-top:0px;"></div> </div> The parse.php file would be the same as if you had manually submitted a form. The include"states_select.txt" file is a simple drop down of the US States. The div id=show is the div that prototype uses to display the results from the parse.php file. In the js the first function handles the request to the parse.php file for the city drop down from the selected state. The second function is the response from the parse.php file back to the page to display the city drop. The third function mimics the first except it is for the city drop down response from the parse.php file. The fourth function is for the response from the parse.php file to display the proper weather data for the selected city. As you can see by the js and the explanation you kinda work one step ahead of yourself and everything is a set of request/response. I suggest you use the example to get your first drop down displayed with the include then use the first request/response set to display your second drop down. From there it should be easy sailing. Note: what the browser displays in the "show" div will not be visible in the source. HTH Teamatomic
  21. 1. Take it as a given that a bot wil read the robots.txt file first. 2. grab the IP of anything that reads the robots.txt file. 3. dont count anything with the IP of the robot. #1 makes an asumption that does not, and may not always be true but its probably the closest you can come. You may also want to read this thread http://www.phpfreaks.com/forums/index.php/topic,291102.msg1378430.html#msg1378430 HTH Teamatomic
  22. Yes, they come and read the file, so there should be a log entry for their access to the robots.txt file. But just because they read the file does not mean they have to honor its rules. Does your logfile show eveidence that the bot in question accessed any other file but the robots.txt? HTH Teamatomic
  23. Go get a RAM checker and run it for an hour or two, its possible you have bad chip. HTH Teamatomic
  24. Try: date_default_timezone_set('Europe/London'); if that does not work, needs php>=5.1 do it with the offset $offset =+1; $date = gmdate('h:i:s', time()+$offset*60*60); HTH Teamatomic
  25. Not without the use of ajax. You'd be best to do as suggested above. HTH Teamatomic
×
×
  • 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.