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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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