Post Reply 
PHP Problem
Author Message
MaDc0w
need...steak....sauce.....

Posts: 255.3702
Threads: 22
Joined: 15th Apr 2007
Reputation: -6.35773
E-Pigs: 10.1397
Offline
Post: #2
RE: PHP Problem
I fixed the problem myself. :P

Since I could not fix that bug/problem, I decided to take a different route.

I trimmed the file while creating file.txt.

Old code:

Code:
1
2
3
4
5
6
7
while($info = mysql_fetch_array( $data ))
{
$add = "". $info['image']. " ". $info['find']."\n";
$f = fopen("E:\USERS\pcminusmulti7\www\undergroundz\file.txt", "a");
fwrite($f, $add);
fclose($f); 
}



New code:

Code:
1
2
3
4
5
6
7
8
while($info = mysql_fetch_array( $data ))
{
$add = "". $info['image']. " ". $info['find']."\n";
$outputs = str_replace("images/smilies/", " ", $add); // replace messy paths in array before we write it to file 
$f = fopen("E:\USERS\pcminusmulti7\www\undergroundz\file.txt", "a");
fwrite($f, $outputs);
fclose($f); 
}



This of course is cleaner and the whole block of code in the
first post becomes unnecessary.

Still makes me wonder why it doesn't work, on my test server it runs fine!
Mythos tested it on his server and it also ran fine!
So? Anyone got a clue?
I figure it has to do with it running on an IIS server with
some bad/wrong/my badly configured php.ini..

You win some, you lose some..
Thanks for reading my rambling!


http://www.pac-rom.com

    (__)
  <@ 0>    m0o
     \_/
06/08/2008 10:28 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
PHP Problem - MaDc0w - 06/08/2008, 07:22 AM
RE: PHP Problem - MaDc0w - 06/08/2008 10:28 AM
RE: PHP Problem - ZiNgA BuRgA - 06/08/2008, 05:39 PM
RE: PHP Problem - MaDc0w - 06/08/2008, 10:49 PM
RE: PHP Problem - ZiNgA BuRgA - 06/08/2008, 10:53 PM
RE: PHP Problem - MaDc0w - 08/08/2008, 04:10 AM
RE: PHP Problem - ZiNgA BuRgA - 09/08/2008, 11:26 PM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)

 Quick Theme: