Zubrag.com
May 24, 2019, 07:24:21 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Question About cPanel Email Account Creator  (Read 7982 times)
szachary
Newbie
*
Posts: 2


« on: May 05, 2007, 02:49:26 AM »

I have installed this script, and it works great!! But once I add an account, how would I get the script to redirect to another page, instead of just come up on the same page telling me the account was created?

thanks!!

Steve

Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #1 on: May 05, 2007, 02:30:47 PM »

Find this code in the script:

fclose($f);

and add this code after it:

if(strpos($msg,'created)) header('Location: http://www.example.com/redirect/path/here/');
Logged
szachary
Newbie
*
Posts: 2


« Reply #2 on: May 05, 2007, 08:00:33 PM »

Thanks, but I am getting this error when I put that code in,

Parse error: syntax error, unexpected T_STRING in /home/spirit/public_html/cpemail.php on line 69

I get this error just going to the cpemail.php.  Below is the code that I have.

    // 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/')'
  }

Thanks Again!!
Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #3 on: May 06, 2007, 05:06:01 AM »

You missed ending ;
Does it help?
Logged
recoding
Global Moderator
Jr. Member
*****
Posts: 71


WWW
« Reply #4 on: May 08, 2007, 02:00:25 PM »

Hey this is working updated from what Zubrag said if you did not follow Smiley
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/')';
  }
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC