Re: [PHP-DB] PLEASE HELP !!!
when you say an error - do you mean any error? or specific errors? ie., you're not getting it stuck in an infinite loop? (cpu time flips up to that when you stick in a loop) or is it all errors? PHPFAN [EMAIL PROTECTED] wrote in message 9eetk0$92d$[EMAIL PROTECTED]">news:9eetk0$92d$[EMAIL PROTECTED]... I am running PHP 4.0.5 on Windows 2000 with SQL server databases. If there is an error with my PHP code, my computer becomes very very slow and nothing works. The PHP process is using 99 % of the CPU. So I have to restart the computer. This happens everytime there is an error in my PHP code. For the work I am doing, I have to use PHP with backend SQL Server on Windows Platform. Any suggestions will be greatly appreciated. Thank you PHPFAN -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Find - n - replace
try looking at the fseek function, i think that does what you want: http://uk.php.net/manual/en/function.fseek.php John Starkey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello all. I'm trying to set up a quick find and replace script. It's finding, and it's pasting what I want, but on the following line, I can't get it to replace. Can anyone help? #!/usr/local/bin/php -q ?php $fp = fopen( ./somefile.html,r+); while ( !feof( $fp ) ) { $line = fgets( $fp, 4096 ); if ( eregi( td, $line ) ) { if ( eregi( 4[0-9]{2}, $line ) ) { $liner = eregi_replace( 4[0-9]{2}, 470, $line ); fputs( $fp, $liner, strlen( $liner ) ); } } } fclose( $fp ); ? Can anyone tell me how I can back the fput up one line so it overwrites the result of the search? Thanks, John -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] image upload - mime types??
i've created an application where users can upload images through the form upload, and to ensure that they are sending me an image, i take a look at the type of the file (ie. $uploadedfile_type), which usually returns something like image/x-png however.. not always.. so secondly, i check for a file extension using $uploadedfile_name, but if they've loaded it from a mac.. i can't be sure there will be a filename.. so, those things both failing in some cases.. is there any other way of checking the filetype of a file? i'm concerned that some could upload malicious content and run it (although the execute flag is turned off, AND the filename is difficult to get.. ) and would like to reduce the possiblity.. any suggestions? -- matthew knight - online developer [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]