hi I have following problem. Standard actions on components are in Joomla called like this index.php?option=com_name&action=MYACTION
. Then I can use Joomla framework in my component e.g for database access.
I am developing component for 3dsecure gate开发者_运维知识库way. In one step of the payment i need validate data sent from bank. So I need something like this index.php?option=com_name&action=validate
. But the bank adds after this URL another ?
and more parameters, so I think it can't be working..So I want to access my Joomla component for example from 3dsecure.mysite.com/validate.php
?Is it possible?
I simply want to use JFactory::getDB
and then e.g redirect to any view. I know I can use mysql_connect and create own connection to DB, but it is very ugly:)
Can I somehow redirect the request on my side (create valid url with parameters sent from bank) ?header(Location:)
??
Thank you for your help
You can't use Joomla!'s apis outside the framework, unless you provide there al the need dependencies (thus recreating the framework elsewhere), which is pretty nonsense.
Moreover, you can have has many parameters as you want in a component url, it's up to the component router to know what to do about that... So, in you router class of the component, you'll place handlers for every $_GET paramater you need, like those returned from the bank.
If you just don't want to get dirty with mysql_* stuff, use PDO (which is, btw, a better approach in general).
Consider using a rewrite rule on the server.
For example, rewrite
3dsecure.mysite.com/validate.php(...)
into
index.php?option=com_name&action=MYACTION(...)
If you are using Apache, you can use mod_rewrite for this purpose.
精彩评论