1
mramsey
I need some help please
  • 2005/4/22 6:47

  • mramsey

  • Just popping in

  • Posts: 33

  • Since: 2002/3/8 3


Hi All,

I have a job listing module and I've added an attachment option to the contact form to allow the users to email the CV’s.

Can anyone please help me with this PHP code to allow sending the attachment to Email?

// ----------------------------------------------------------------------- //
// Jobs for XOOPS 2.0x //
// By John Mordo from the myAds 2.04 Module //
// All Original credits left below this //
// //
// //
// //
//
// ------------------------------------------------------------------------- //
// E-Xoops: Content Management for the Masses //
// < http://www.e-xoops.com > //
// ------------------------------------------------------------------------- //
// Original Author: Pascal Le Boustouller
// Author Website : pascal.e-xoops@perso-search.com
// Licence Type : GPL
// ------------------------------------------------------------------------- //

foreach ($HTTP_POST_VARS as $k => $v) {
${$k} = $v;
}

if ($submit) {
include("header.php");
include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
global $xoopsConfig, $xoopsDB, $myts, $meta;

$result = $xoopsDB->query("select email, submitter, title, type, company, description, requirements FROM ".$xoopsDB->prefix("jobs_listing")." WHERE lid = '$id'");

while(list($email, $submitter, $title, $type, $company, $description, $requirements) = $xoopsDB->fetchRow($result)) {
$title = $myts->makeTboxData4Show($title);
$type = $myts->makeTboxData4Show($type);
$company = $myts->makeTboxData4Show($company);
$description = $myts->makeTboxData4Show($description);
$requirements = $myts->makeTboxData4Show($requirements);
$submitter = $myts->makeTboxData4Show($submitter);

if ($tele) {
$teles = ""._CLA_ORAT." $tele";
} else {
$teles = "";
}

$message = ""._CLA_MESSFROM." $namep $post ".$meta['title']."\n\n\n";
$message .= ""._CLA_REMINDANN." $type : $title\n"._CLA_MESSAGETEXT." : $description\n\n";
$message .= " "._CLA_STARTMESS." $namep "._CLA_FROMANNOF."\n";
$message .= "$messtext\n\n";
$message .= "--------------- "._CLA_ENDMESS." -------------------\n\n";
$message .= ""._CLA_CANJOINT." $namep "._CLA_TO." $post $teles \n\n";
$message .= "End of message \n\n";

$subject = ""._CLA_CONTACTAFTERANN."";
$mail =& getMailer();
$mail->useMail();
//$mail->setFromName($meta['title']);
$mail->setFromEmail($post);
$mail->setToEmails($email);
$mail->setSubject($subject);
$mail->setBody($message);
$mail->send();
echo $mail->getErrors();
}
redirect_header("index.php",1,_CLA_MESSEND);
exit();

} else {

$lid = isset( $HTTP_GET_VARS['lid'] ) ? $HTTP_GET_VARS['lid'] : '' ;

include("header.php");
include(XOOPS_ROOT_PATH."/header.php");
OpenTable();

echo "";


echo ""._CLA_CONTACTAUTOR."

";
echo ""._CLA_TEXTAUTO."
";
echo "";
echo "";
echo "";

if($xoopsUser) {
$idd =$xoopsUser->getVar("name", "E");
$idde =$xoopsUser->getVar("email", "E");
}

echo "





















"._CLA_YOURNAME."
"._CLA_YOUREMAIL."
"._CLA_YOURPHONE."
"._CLA_YOURMESSAGE."
"._JOBS_ATTACHMENT."



";

CloseTable();
include(XOOPS_ROOT_PATH."/footer.php");
}

?>

2
mramsey
Re: I need some help please
  • 2005/4/23 7:16

  • mramsey

  • Just popping in

  • Posts: 33

  • Since: 2002/3/8 3


[size=x-large]I need some help please[/size]

3
hervet
Re: I need some help please
  • 2005/4/23 7:21

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Sorry what did you say ?
Excuse me but if you don't get answer that's because people don't konw

4
m0nty
Re: I need some help please
  • 2005/4/23 7:34

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


can't help u with the code as such..

but it would be better coding to use short arrays (as php 5 doesn't use long arrays) and you'll want it for future compatibility

change $HTTP_POST_VARS to $_POST & $HTTP_GET_VARS to $_GET

and is also a necessity these days to use lowercase tags..

ie change to and to
etc etc..

5
m0nty
Re: I need some help please
  • 2005/4/23 7:46

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


also, i think you might be better probably using the liase 1.23 module, it allows you to create your own contact forms which include attachments etc.. it might be worth looking at..

6
Shine
Re: replace & HTTP_POST_VARS to $_POST question.
  • 2005/4/23 11:06

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Quote:
change $HTTP_POST_VARS to $_POST & $HTTP_GET_VARS to $_GET


Although no coder I am able to search and replace pieces of code
That is why I would like to now:

If I take a look at the mylinks and mydownloads modules there still are: $HTTP_POST_VARS and $HTTP_GET_VARS being used.
Can I do a simple search and then replace those pieces of code into &_POST and &_GET ??
Will these modules flawlesly run within php4+ and php5 afterwoods?

Grtz., Shine

7
rowdie
Re: I need some help please
  • 2005/4/23 11:37

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


$_POST and $_GET is supported by default in both php4 and php5. Make sure you change every single one though, because the long version won't have any values anymore and if the module tries to use it in one place it will have problems.

Changing to $_POST/$_GET may not mean that the module will run flawlessly in PHP5, that depends on whether there are other parts of the code needing upgrading too, but it does take a step towards making it php5 compatible.

Login

Who's Online

170 user(s) are online (97 user(s) are browsing Support Forums)


Members: 0


Guests: 170


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits