Zubrag.com
November 20, 2019, 10:21:48 PM *
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: cpemail, success page instead of $msg??  (Read 9625 times)
stevenmedleycom
Newbie
*
Posts: 13


« 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.

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


WWW
« Reply #1 on: November 23, 2007, 08:00:47 AM »

try adding die();  after header(...);   does it help?
Logged
stevenmedleycom
Newbie
*
Posts: 13


« Reply #2 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 ##
Logged
stevenmedleycom
Newbie
*
Posts: 13


« Reply #3 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.
Logged
stevenmedleycom
Newbie
*
Posts: 13


« Reply #4 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.
Logged
stevenmedleycom
Newbie
*
Posts: 13


« Reply #5 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/');
  }
Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #6 on: November 26, 2007, 05:54:20 AM »

Great.
Logged
Pages: [1]
  Print  
 
Jump to:  

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