Jump to content

[SOLVED] can anyone explain this fopen


shadiadiph

Recommended Posts

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&quota=$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&quota=$equota", "r");

  @fclose($f);

Link to comment
https://forums.phpfreaks.com/topic/166403-solved-can-anyone-explain-this-fopen/
Share on other sites

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);
}

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?

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.