...

View Full Version : php script help needed.



Prashank
01-15-2012, 01:01 PM
hi! friends,

I am working on a php script and this is below

send.php

<?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


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


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.

Fou-Lu
01-15-2012, 01:07 PM
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?

Prashank
01-15-2012, 01:16 PM
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.

Fou-Lu
01-15-2012, 01:32 PM
Nearby code does not help.
How is this function being called? Any errors generated by the run (check your error logs).

Prashank
01-15-2012, 01:38 PM
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.

Fou-Lu
01-15-2012, 01:46 PM
Neither of these files contains the relevant code you are talking about.

Prashank
01-15-2012, 01:54 PM
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
return $this -> oModule
-> processAnswers( $this -> aSurveyInfo, bx_get('survey'), bx_get('page_uid') );
with the correct code.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum