Access User Profile Data In Another Php Web Application

I’m using two Yii application. In the first application users can register and add profile data. The profile data viewed in a preview mode in 1st application. In the 2nd application uses the same users from 1st application, in this case i would like to show the profile view in 2nd application without database access of 1st app. With this requirement which method is best? How can access the preview mode in 2nd app? Any conversion/formatting required?

you can do that in one way by create API , Yii have so simple method to create web service built under SOAP :

Check it here :

And idea will be like this:

1- your first app will be like server

2- your second app will be client

3- client send user_id as parameter and return data from first app as (Json,xml, text …etc).

Not webservice i meant. I would like to convert the profile data to html file and display that file in 2nd app. HTML mode publishing. Is it possible?

However , it’s all related to web service if you will work in professional way .

But another solution : you can build profile page in first app with user_id parameter , then you can call it in app 2 via Iframe element , but not recommended .

with this requirement. I see that you need access to the physical directories to app2 from app1.

Then in your saveUser(), after a successful save of the data to the DB, generate a static page, and save it to a location in app2. Take a look at the default ‘About’ page. To generate the page you could use renderPartial() with the 2nd & 3rd options set (I forget which is which to get no header layout and to return the page not display it.) You will need to save it with a unique name.php and figure out how to reference to the specific person->profile.php file.

The other way of doing it would be to set 2 db connections in app2, and just have the ability to display the profile and not do anything else with it.

I need the static page method. After saving the profile data, i would like to generate an html file with profile data. But how the css and other images will load, if the html file access in 2nd app? I used tab menu in the profile view.

As I said, After $model->save(), do a renderPartial() into a variable, save the content of the variable to a file, call from app2 as a static page (like the ‘about’ file is called).