1792 Posts in 588 Topics by 560 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1128 Views |
-
Modifying the the attachment process for a User defined form

19 September 2009 at 5:33pm Last edited: 19 September 2009 5:36pm
Hi
When I call a user defined form I pass a variable in the URL www.blah.com/contactform?mfid=4I want to use this variable within the UserDefinedForm.php to enable me to change what attachment gets sent with the response to the submitter i.e. want to add this (at about line 400)
$fn = DataObject::get_by_id("MonkeysFist", $_GET['mfid']);
if(!$fn) return false;
$filepath = "assets/Uploads/mf_attachments/$fn->MFFileName";
$emailToSubmiter->attachFile($filepath, $fn->MFFileName);At the moment $_GET['mfid'] returns no value and I am wondering how I can pass it into this script?
I know I should not be necessarily adding it to this file as it would become an upgrade issue but I am no worrying about that at the moment. I just want to see if I can get it to work.
How do I go about this?
Thanks
MM -
Re: Modifying the the attachment process for a User defined form

22 September 2009 at 9:39pm
Any thoughts on this. I still can't see a way to do it?
Thanks
MM
-
Re: Modifying the the attachment process for a User defined form

1 October 2009 at 4:08pm
Have you tried using
Director::urlParams[’mfid’] or $_REQUEST['mfid']
instead of $_GET ?
-
Re: Modifying the the attachment process for a User defined form

8 November 2009 at 12:52pm
Thanks for this suggestion.
I am having problem implementing it though. I am trying to use
$mfid= (int)Director::urlParams['ID'];
$fn = DataObject::get_by_id("MonkeysFist", $mfid);I get Parse error: syntax error, unexpected '[' in ... for the first line
Can anyone tell me why I can't use [ ?
Thanks
MM
| 1128 Views | ||
|
Page:
1
|
Go to Top |

