-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
can you provide a directory structor otherwise i am going to be guessing alot
-
10 second google reveals http://www.labnol.org/internet/tutorial-create-bot-for-gtalk-yahoo-messenger/4354/
-
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; }
-
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!)
-
if short tags are turned off this is a problem <? php and i assume this is wrong $result2 = mysql_result($query2)
-
How do I turn a SQL query into variables?
MadTechie replied to yuckysocks's topic in PHP Coding Help
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 } ?> -
Help, 1000's lines of php and theres an error!
MadTechie replied to CodeWriter's topic in PHP Coding Help
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" -
Then your going to get a ton of connections.. upgrade your server!
-
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!
-
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 ?
-
example $data = "bac abc cab"; $data = preg_replace('/(?<!b)a(?!c)/sm', 'X', $data ); echo $data; //bac Xbc cXb
-
I you want the OS the server is running on then you can probably use if(getenv('OS') == "Windows_NT") etc
-
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); ?>
-
[SOLVED] Save multiple textareas to one database record
MadTechie replied to AdRock's topic in PHP Coding Help
you could use a delimitor or even serialize it, but personally i would store it in different fields -
[SOLVED] Display information broken down by field
MadTechie replied to outchy's topic in PHP Coding Help
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 -
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>"; ..
-
XAMPP MySQL not working
MadTechie replied to scrubbicus's topic in PHP Installation and Configuration
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 -
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 ?
-
WOW.. i don't belive i missed that!
-
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
-
XAMPP MySQL not working
MadTechie replied to scrubbicus's topic in PHP Installation and Configuration
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/ -
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>"; }
-
Need help working with PDF, DOC and image files
MadTechie replied to rfeio's topic in PHP Coding Help
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) -
Hope this help (background won't be affect by timeouts)