I apologize for my bad English. My question is how can the message subject insert ID from mysql. ID must match a line in mysql. How can I do?
Forums
ID in subject
Hi cry_wolf,
You need to run the DB Connection Before Emails, then you can get the cf_id from the DB save (there's been a post on this in the last two days - search for 'MyForm').
The you'll need to use a Dynamic Subject in your Email setup and build the value for the input in the OnSubmit Before Box using PHP to add the cf_id to whatever other text you need.
Bob
You need to run the DB Connection Before Emails, then you can get the cf_id from the DB save (there's been a post on this in the last two days - search for 'MyForm').
The you'll need to use a Dynamic Subject in your Email setup and build the value for the input in the OnSubmit Before Box using PHP to add the cf_id to whatever other text you need.
Bob
Hello Bob!
I wrote the code directly into the dynamic themes he would not even generate a letter ....
Please tell me in detail where and how to write code.
Yours faithfully Oleg!
I wrote the code directly into the dynamic themes he would not even generate a letter ....
Please tell me in detail where and how to write code.
Yours faithfully Oleg!
Hi Oleg,
The Dynamic Subject box will *only* take a variable name from the $_POST array.
In OnSubmit Before Box create your value and add it to the the array.
Bob
The Dynamic Subject box will *only* take a variable name from the $_POST array.
In OnSubmit Before Box create your value and add it to the the array.
<?php
$id = // some code
$subject = 'some text '.$id;
JRequest::setVar('subject', $subject);
?>
Bob
Hello Bob
Send a letter goes through a post. In the subject line write variable subject.
In the On Submit code - before sending email: write code
And Saving Data / Emails order: put the value Before email.
In Extra dataview columns fields names: Posted cf_id.
But there comes a letter with a blank subject line but at the very top of wrote the last number from the database. Where I was not so written?
Send a letter goes through a post. In the subject line write variable subject.
In the On Submit code - before sending email: write code
<? php
/ / Start connections are
$ id = mysql_connect ( "host", "username", "pass");
mysql_select_db ( "select database");
$ r = mysql_query ( 'SELECT * FROM `select table` ORDER BY cf_id DESC LIMIT 1');
while ($ row = mysql_fetch_array ($ r))
echo "Pāsūtījuma № <b> <font size='4'>". $ row [ 'cf_id']."</ b> </ font> <br> Pāsūtījuma laiks: ". $ row [' recordtime '];
/ / End connections are
$ subject = 'some text'. $ id;
JRequest:: setVar ( 'subject', $ subject);
?>
And Saving Data / Emails order: put the value Before email.
In Extra dataview columns fields names: Posted cf_id.
But there comes a letter with a blank subject line but at the very top of wrote the last number from the database. Where I was not so written?
Hello again, Bob
I began to began to show a tighter and information in the subject line "some text Resource id # 147". Skizhite please where can be a mistake. Also found that for some reason, uncomprehending following new 2 lines:
Beforehand many thanks. Yours Oleg!
I began to began to show a tighter and information in the subject line "some text Resource id # 147". Skizhite please where can be a mistake. Also found that for some reason, uncomprehending following new 2 lines:
mysql_select_db ( "select database");
$ R = mysql_query ( 'SELECT * FROM `select table` ORDER BY cf_id DESC LIMIT 1');
Beforehand many thanks. Yours Oleg!
This topic is locked and no more replies can be posted.