>>  Site Map >>  Forums >>  Modules

Forum module - topics in forum:



Modules - Get help on installing any module or add-on here



feedback form modified

I'm trying to modify the feedback module into a join us module. (i know that I can find some on other sites but what's the point in learning php then...)

anyway... I have a few drop down boxes but I don't really know how you could save the selected value in a variable and send it by mail... someone got a tip for me?

here's an example of my drop down list:

Quote: :
$form_block .= "<p><b><u>Will you want to particapate in scrims?</u><b><br><br>";
$form_block .= "<select name=\"$bfscrims\">";
$form_block .= "<option name=\"bfscrims\" value=\"yes\">Yes</option>";
$form_block .= "<option name=\"bfscrims\" value=\"no\">No</option>";
$form_block .= "</select></p>";



and I'm regroeping all the variables into "$message" as follows:

Quote: :
$message ="Ingame name: $ingamename \n\n";
$message .="Age: $age \n\n";
$message .="What game do you play? $game \n\n";
$message .="What is your xfire name? $xfirename \n\n";
$message .="Will you be able to make our meeting which is every thursday? $meeting \n\n";
$message .="Will you be able to donate? $donate \n\n";
$message .="Did you read the rules? $rules \n\n";
$message .="Do you agree with our rules? $agreerules \n\n";
$message .="Why do you want to join krt?\n $whyjoin \n\n";
$message .="Will you want to particapate in scrims? $bfscrims \n\n";
$message .="Will you be able to (if you want to participate) attend training which is every Wednesday at 8pm GMT? $training \n\n";


now when I send an e-mail I only get the regular text and the text from input tags. could someone help me?

thanks






Let me start by saying as politely as possible, you are going in the wrong direction. First I do not understand what regrouping the variables would even do. Since there isn't any such a thing.

Problem 1, all your variables have the same name, can't do that
Should be more like:
Code: :
$message1 = name;
$message2 = email;
$message3 = whatever;

Basically each variable has to have it's own name.

Now onto some more hard core stuff. I will assume you are building off the original PHPnuke feedback module.

if you add a drop down list something like the following to the original form: it may look something like the following:
Code: :
$form_block .= "<select name=\"select\" value=\"$select\">";
$form_block .=  "<option value=\"$choice1\">$choice1</option>";
$form_block .=  "<option value=\"$choice2\">$choice2</option>";
$form_block .=  "<option value=\"$choice3\">$choice3</option>";
//to add more options un-comment the lines below or add more line as needed//
//$form_block .=  "<option value=\"$choice4\">$choice4</option>";
//$form_block .=  "<option value=\"$choice5\">$choice5</option>";
$form_block .=  "</select>";

Pay special attention to the first line of this code where it says value="$select" you will need to create a function so this will actually work.
Step 1
find:
Code: :
if (!isset($message)) { $message = ""; }
if (!isset($opi)) { $opi = ""; }
if (!isset($send)) { $send = ""; }

after it add:
Code: :
if (!isset($select)) {$select = "";}

so it looks like this:
Code: :
if (!isset($message)) { $message = ""; }
if (!isset($opi)) { $opi = ""; }
if (!isset($send)) { $send = ""; }
if (!isset($select)) {$select = "";}

Step2, Find:
Code: :
$msg .= ""._SENDERNAME.": $sender_name\n";

and after that add:
Code: :
$msg .= ""._SENDERSELECT.": $select\n";


Now remember these steps must be completed each of your drop down lists in order for them to function. in other words each drop down list must have it's own set of variables and functions. which is why I said at the beginning I do not understand the concept of what you called grouping the (the variables).

I hope this helps you and it's overly confusing, no one will ever accuse me of being a teacher.






about the dropdown thing, thank you very much. I know what to do now.



about the message variable I'm not agree with u, if you look carefully you will see that at each line I add more stuff to the variable $message.

first line it's just "$message =" string...."
second line is "$message .= "second string....."

as you can see in the second line there is a dot before "=", correct me if I'm wrong but I though it was the same as "$message = $message ." other string....."

I though dots were used to attach strings to eachother.
when finished everything will be stored in the variable $message and I put this in the php mail function.

and that allready worked so didn't need a fix for that. but do appreciate your help.

grz krike






I stand corected I missed the "."




Attention! You are currently viewing sitemap page!
We strongly suggest to look at original content

Search from web

Valid HTML 4.01 Valid CSS