Editing Registration Function

Discussion in 'PHP' started by heshan86, Jan 29, 2010.

  1. #1
    Im currently trying to redirect a user to a different page if there is an error during the registration process like typing a username or an email already in use. The file im editing is a php file and i have copied the code of that file into a text file, heres the link to it

    http://designstattoono1.com/foreveracesample/components/com_user/controller.txt

    The coding is in here, i think editing the registration function is the answer to this but not sure where to edit.
    cheers
     
    heshan86, Jan 29, 2010 IP
  2. HivelocityDD

    HivelocityDD Peon

    Messages:
    179
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can see some code like

    $mainframe->redirect( $return );


    You can make use of this to redirect to the page you want based on your requirement.

    $return here will be the page to which you need redirection say


    If you are trying to redirect to a page error.php

    code can be like this

    
    $return = "error.php";
    $mainframe->redirect( $return );
    
    Code (markup):
    Alternatively you can make use of php's redirect using header function

    like

    
    
    $return = "error.php";
    header("Location:".$return);
    
    
    PHP:
     
    HivelocityDD, Jan 30, 2010 IP
  3. heshan86

    heshan86 Active Member

    Messages:
    89
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #3
    im i have zero knowledge on php,, so i was wondering where i can ad this piece of coding coding ??:eek::eek:
     
    heshan86, Jan 30, 2010 IP