Zubrag.com :: Forum

zubrag.com => cPanel Scripts => Topic started by: stevenmedleycom on November 23, 2007, 07:32:43 AM



Title: cpemail, success page instead of $msg??
Post by: stevenmedleycom on November 23, 2007, 07:32:43 AM
i tried toying around and tried to force it to go to another page if signup was successful but instead it just didnt load completely when it tried to, on failure (username taken) however it reloaded fine. the success $msg i replaced with
               header ("Location: http://mydesignatedurl.com");
end;

then i removed the end portion and it reloaded the page but did not go to designated page. just curious if there is a way i could send successful attemps to my "success" page instead it reloading the current page.


Title: Re: cpemail, success page instead of $msg??
Post by: zubrag on November 23, 2007, 08:00:47 AM
try adding die();  after header(...);   does it help?


Title: Re: cpemail, success page instead of $msg??
Post by: stevenmedleycom on November 23, 2007, 02:55:52 PM
actually no it doesnt, its giving me this, Warning: Cannot modify header information - headers already sent by (output started at /path/to/file/cpemail.php:2 in /path/to/file/cpemail on line ##


Title: Re: cpemail, success page instead of $msg??
Post by: stevenmedleycom on November 23, 2007, 03:11:10 PM
i found another post on this matter i am going to try the suggestion on there, sorry for not looking thoroughly before posting, i hope this will help in my situation.


Title: Re: cpemail, success page instead of $msg??
Post by: stevenmedleycom on November 23, 2007, 06:24:54 PM
i tried the other idea, upon doing so i got an error, here is the sample code i tried. 

Code:
// 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);
   if(strpos($msg,'created)) header('Location: http://www.example.com/redirect/path/here/')';
  }

again that resulted in an error "Parse error: syntax error, unexpected T_STRING in /server/path/to/file/cpemail.php on line 69", i am not sure if there is more to be modified than just that or not, as i cannot be sure because nothing else was mentioned. any help would be great.


Title: Re: cpemail, success page instead of $msg??
Post by: stevenmedleycom on November 24, 2007, 04:49:30 AM
i am a newbie to php but i did manage to solve this one on my own, the error is all in the code i got from another post on here, dont remember who contributed it but THIS
Code:
    fclose($f);
   if(strpos($msg,'created)) header('Location: http://www.example.com/redirect/path/here/')';
  }
should be :
Code:
    fclose($f);
   if(strpos($msg,'created')) header('Location: http://www.example.com/redirect/path/here/');
  }


Title: Re: cpemail, success page instead of $msg??
Post by: zubrag on November 26, 2007, 05:54:20 AM
Great.