Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jul 2011
    Posts
    37
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question php script help needed.

    hi! friends,

    I am working on a php script and this is below

    send.php
    PHP Code:
    <?php
    require_once('inc/header.inc.php');
    require_once(
    'design.inc.php');
    require_once(
    'profiles.inc.php');
    require_once(
    'utils.inc.php');
    require_once(
    'EmailTemplates.php' );

    $oEmailTemplates = new EmailTemplates();
    $aTemplate $oEmailTemplates->getTemplate('t_UserConfirmed');

    sendMail($site['email_notify'], 'test mail'$aTemplate['Body']);
    ?>
    so when i visit example.com/send.php this script send a mail and that is okay but i am trying this
    PHP Code:
    function sendAdminMail() {
           
    $oEmailTemplates = new EmailTemplates();
           
    $aTemplate $oEmailTemplates->getTemplate('t_UserConfirmed');
           
    sendMail($site['email_notify'], 'test mail'$aTemplate['Body']);
        } 
    this is the function but i want this to execute from another file something like this.
    visit.php
    PHP Code:
    return $this -> oModule -> sendAdminMail(); 
    so, when i visit example.com/visit.php the same thing should happened and a mail should be sent.
    but nothing happeneds i am not an advance coder of php so i am making some mistake can you all tell me what is the mistake and what to do?

    any help will be very appreciated.
    Thanks.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    What are you returning from in that last block?

    As for sendAdminMail, is this function a procedural definition, or has it been added to the class represented under $this->oModule?

  • #3
    New Coder
    Join Date
    Jul 2011
    Posts
    37
    Thanks
    3
    Thanked 0 Times in 0 Posts
    PHP Code:
    if( false != bx_get('survey') && false != bx_get('page_uid') ) {
                            return 
    $this -> oModule 
                                
    -> sendAdminMail();
                        }
                        else {
                            return 
    $this -> oModule -> getSurveyDecorationForm($this -> aSurveyInfo);
                        } 
    this is the nearby code and it in a class its a method.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Nearby code does not help.
    How is this function being called? Any errors generated by the run (check your error logs).

  • #5
    New Coder
    Join Date
    Jul 2011
    Posts
    37
    Thanks
    3
    Thanked 0 Times in 0 Posts
    here i have attached the two files which is unmodified and i want these function in it and its error free just not work .
    basically i want to call that function from the other file.
    Last edited by Prashank; 01-16-2012 at 03:52 PM.

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Neither of these files contains the relevant code you are talking about.

  • #7
    New Coder
    Join Date
    Jul 2011
    Posts
    37
    Thanks
    3
    Thanked 0 Times in 0 Posts
    yes i have modified it and added the code i posted before. The thing i want is
    a mail send where this "//-- process recived answers --//" is in the file SasSurveyView.php at line 128 replacing
    PHP Code:
    return $this -> oModule 
                                
    -> processAnswers$this -> aSurveyInfobx_get('survey'), bx_get('page_uid') ); 
    with the correct code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •