Login form with drop down select box to select the database to connect

Dear all,

I need to insert in the login form , in addition to language choice, also the selection of Database to connect to .
For istance
LIVE
TESTING
QUALITY

Each database has the same structure but the data within are different.

How can you suggest to implement this feature ?
Have you got a sample ?
Many thanks
Giovannino

Make three deployments and forget about the dropdown box if you want the easy way. So for example to http://mysite/live http://mysite/testing and http://mysite/quality that would be the easy way. Specially since I suspect that you would not want everyone to be able to choose TETSING for example.
You can then also run all three together if you change the .htaccess files a bit (see my post somewhere else on the forum).
Alternatively if you insist in the dropdown box you could of course alter the generated php code a bit. Your starting point would then be to find the prod.config.php file in the _lib dir and alter the php files that use this one.
Specific connections are made via nmConnection.class.php so you’d have to hack in there…
If there is another solution I’d love to hear that as well…

The post regarding the .htaccess (which is for apache only) is also in our faq. More easy to be found :wink: I agree with rr that you should deploy three times. Otherwise you would share the same codebase for test, acc and prod which doesn’t make sence. It’s not a problem as you have to set the connectionname for each environment. But do deploy with full libs. If you do not want to work with .htaccess you must clear cookies before you make the switch to another environment.

Hi guys,

many thanks for the moment…
The main purpose was to deliver a parallel environment giving to user the possibility to see a yet populated system in addition to the clean live they are using.
So for istance if you want make a try you can use the testing connection and see result.
After that you can come back to live env. and make the entry or something else.

One other idea could be to use a different table prefix i.e live_members and test_members but I thing it would be a bloodbath to manage
Would it possible to use a global var to put every time in front of every table you gonna to use the glovar in order to have a different pointing to table?
For istance I use the language en_US and it_IT to select within same tables different translation to show up in form depending the language selected initially on login form.
Bye

seen what you want I would definitely opt for two seperate deployments. Having different table names would become messy and a table prefix is not really a solution. You’d almost have to develop your application twice then. The fastest way (to my opinion) is simply two deployments. You can also set apache to use 2 ports say 80 for production and 8080 for test and limit access to one of those ports for certain deployment dirs. But then in my view that gets more complicated then it needs to be.

Hi rr,
OK I will follow your hints.

A le voile…
I’m doing a bulk mailing app. It works quite good.
The problem I have is adding an attachment field --> document (File name).

$email_attach = {email_attachment};

I added then $attachment at the end.

sc_mail_send($mail_smtp_server, $mail_smtp_user, $mail_smtp_pass,$mail_from , $email_to, {subject}, $message, “H”,’’, ‘’, ‘465’,‘S’,$attachment);

When I try to run it , the application goes blocked and running with no time.
Have you ever try something like that ?
Have you got idea why it goes in neverending connection ?
Thanks
Giovannino