Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. can you provide a directory structor otherwise i am going to be guessing alot
  2. 10 second google reveals http://www.labnol.org/internet/tutorial-create-bot-for-gtalk-yahoo-messenger/4354/
  3. auth.php is in the directory "pages/teacherresources" so you need to update the paths try this switch($xid) { case 'default': include('loginfailed.php'); break; case 'Lnvb773c2y': include('index.php'); break; case 'spage1': include('../../pagespage1.php'); break; }
  4. OKay check the flush settings in php.ini (turn implicit_flush off and increase output_buffering to a higher amount ie 8192 ) as for the Nagle Algorithm wouldn't be directly related to the PHP itself but more to do with the apache!.. Sending smaller packets from PHP should "trick" apache into not wait for clients to respond (basically when apaches output buffer is it requires aqk from the client before it continues..) By increasing this your apache kernal will consume more memory but also require less aknoledgments You could also try mod_bw v0.8 (designed for bandwidth control BUT it has some nice options another option maybe to pass some of the memory load to the clients by enabling the compression of HTML ie: output_handler = ob_gzhandler Sorry for the almost random info (was thinking and typing at the some time!)
  5. if short tags are turned off this is a problem <? php and i assume this is wrong $result2 = mysql_result($query2)
  6. you are only fetching once thus getting one results! its showing twice because your using fetch_array that has numeric and assocated try a loop ie <?php $result = mysql_query("SELECT * FROM weatherdata ORDER BY id DESC LIMIT 10"); while($row = mysql_fetch_array($result)) { echo $row['ID']." - ".$row['Wind ']."<br />"; //etc } ?>
  7. Well as the PHP is server side it won't affect the broswer.. so this doesn't belong in the php section.. its probably a javascript problem but you havn't really said "what the problem is"
  8. Then your going to get a ton of connections.. upgrade your server!
  9. Check your logs to see where they are being called from you may want to update your .htaccess file to stop leaching!. if you havn't already!
  10. I agree with Daniel0, theirs no such thing and unlimited, even if you bring it right down do the resources of the universe! but in anycase, the problem sounds like you need to think about the site design.. do you even have cacheing ?
  11. example $data = "bac abc cab"; $data = preg_replace('/(?<!b)a(?!c)/sm', 'X', $data ); echo $data; //bac Xbc cXb
  12. I you want the OS the server is running on then you can probably use if(getenv('OS') == "Windows_NT") etc
  13. For a tutorial No.. this is for HELP with php not a tutorial request section! However! it should be pretty simple if you alreay know the MySQL setup! <?php // Connect to MSSQL $link=mssql_connect("server","user","pass"); $d=mssql_select_db("NorthWind", $db); // Do a simple query, select the version of // MSSQL and print it. $query = mssql_query('SELECT * FROM table'); $row = mssql_fetch_array($query); echo $row[0]; // Clean up mssql_free_result($version); ?>
  14. you could use a delimitor or even serialize it, but personally i would store it in different fields
  15. you should be able to add the subtitle text with a simple if statment ie $cYear = ""; while($rows=mysql_fetch_array($result)){ if($cYear != $rows['year']) //if year changed { $cYear = $rows['year'];//store new year echo "class of $cYear<br>";//display subtitle (this is the next year data) } //..continue with code Hope that helps
  16. You can't auto/pre complete a file element, its classed as a security risk.. it you could then using a few exploits could be you grab any file off of a clients pc.. Options:~ (goo but not easy) Create an activeX or BHO that gets installed onto the clients browser, Create a Java Applet that allows user to select files, Or (simple option) add simply add X number of file elements so they can upload more files at once. ie echo"<input type=file name='images[]' class='bginput' size='30'></td></tr>"; echo"<input type=file name='images[]' class='bginput' size='30'></td></tr>"; echo"<input type=file name='images[]' class='bginput' size='30'></td></tr>"; ..
  17. I guess the easy option is to save a copy of the file(s) to your server and then add a simple replace $data = file_get_contents($sourceFile); $data = str_replace("otherdomain.com/largeflash.swf","mycache/largeflash.swf",$data);//add
  18. did you uninstall and remove/backup the files/folders? i use WAMP server 2 on my dev PC so this is mainly guess work but try this #1 quit xamp (from the system try) #2 run (stop services) \xampp\xampp_stop.exe \xampp\apache_stop.bat \xampp\mysql_stop.bat \xampp\filezilla_stop.bat #3 run (remove services) \xampp\apache\apache_uninstallservice.bat \xampp\mysql\mysql_uninstallservice.bat \xampp\filezilla_setup.bat (will probably prompt you) #4 Remove files (well for this we're rename) rename \xampp to \xampp.old if you get a error here try rebooting then try renaming again once thats done.. try a reinstall Hope that helps Heres some useful info http://www.apachefriends.org/en/xampp-windows.html#524
  19. gemmerz, if you want the page to display and don't mind the delay for the last part, may i suggest using flush() ie <?php echo "Start of the page..<br>"; flush(); sleep(2); //delays echo "Rest of the page"; ?> as for your mysql connection, i assume your using localhost! you say you figure it because of the sql.. but is this a guess or have you tried removing it to see if it speeds up ?
  20. WOW.. i don't belive i missed that!
  21. try something like this <?php $cachetime = 20*60*60; $cacheFile = "path/to/writeable_dir/ipcache.cache"; $sourceFile="http://ipboard.com/index.php"; if(file_exists($cacheFile) && (filectime($cacheFile) < time()+$cachetime)) { readfile($sourceFile); exit; } $data = file_get_contents($sourceFile); file_put_cotents($cacheFile,$data); echo $data; ?> basically gets the page, saves to file, next run checks if the file was updated in the last 20 minutes if not re-gets the data, if so read from the file
  22. I think the best advice i can give is to suggest you post in the correct section! when you say stopped working.. what do you mean.. the service fails to load?, you can loggin? any errors ? try resetting your MySQL password.. http://www.mydigitallife.info/2006/04/23/reset-the-root-password-of-mysql-server/
  23. Heres some options #1 <input type="checkbox" name="checkbox1" id="checkbox1" /> ifisset($_POST['checkbox1']) { echo "checkbox1 was checked"; } #2 <input type="checkbox" name="checkbox1" id="checkbox1" value="test" /> $data = $_POST['checkbox1']; //=test #3 <input type="checkbox" name="checkbox[1]" id="checkbox1" value="123"/> <input type="checkbox" name="checkbox[2]" id="checkbox2" value="456"/> <input type="checkbox" name="checkbox[3]" id="checkbox3" value="789"/> <input type="checkbox" name="checkbox[4]" id="checkbox4" value="abc"/> <input type="checkbox" name="checkbox[5]" id="checkbox5" value="def"/> foreach($_POST['checkbox'] as $K => $CB) { echo "checkbox $K was checked with the value '$CB'<br>"; }
  24. You can check the file mime and/or extension, to search inside you need to parse the file (really depends what your looking for, inside)
  25. Hope this help (background won't be affect by timeouts)
×
×
  • 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.