shadiadiph Posted July 18, 2009 Share Posted July 18, 2009 can any one explain why the first one works and the second one doesn't?? // Create email account $f = fopen ("http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/doaddpop.html?email=$euser&domain=$cpdomain&password=$epass"a=$equota", "r"); // Check result while (!feof ($f)) { $line = fgets ($f, 1024); if (ereg ("already exists", $line, $out)) { $msg = "<h2>Email account {$euser}@{$edomain} already exists.</h2>"; break; } } @fclose($f); // Create email account $f = fopen ("http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/doaddpop.html?email=$euser&domain=$cpdomain&password=$epass"a=$equota", "r"); @fclose($f); Quote Link to comment Share on other sites More sharing options...
trq Posted July 18, 2009 Share Posted July 18, 2009 No. Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted July 18, 2009 Author Share Posted July 18, 2009 mm i don't get it either i only took out the check while loop as i don't need it to check doesn't look like it does anything except return an error but works if i change the while loop to just // check result while (!feof ($f)) { $line = fgets ($f, 1024); } Quote Link to comment Share on other sites More sharing options...
trq Posted July 18, 2009 Share Posted July 18, 2009 I actually meant, no, we can't explain it because you haven't given us enough details to do so. Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted July 18, 2009 Author Share Posted July 18, 2009 mm don't know what you want me to explain this is to add an email user to the cpanel on my domain was just wondering why the first one worked and why the second one didn't why does fopen require // check result while (!feof ($f)) { $line = fgets ($f, 1024); } at minimum to work didn;t seem like the above does anything? Quote Link to comment Share on other sites More sharing options...
trq Posted July 18, 2009 Share Posted July 18, 2009 The looped one read in 1024 bytes at a time until it gets to the end of the file. Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted July 28, 2009 Author Share Posted July 28, 2009 thank you for the explanation Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.