# Sending a response back to a PHP site from rails application

**URL:** <https://www.ruby-forum.com/t/sending-a-response-back-to-a-php-site-from-rails-application/151609>\
**Category:** Rails\
**Created:** [October 23, 2008, 1:27pm UTC](https://www.ruby-forum.com/t/sending-a-response-back-to-a-php-site-from-rails-application/151609 "2008-10-23T13:27:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [October 23, 2008, 1:27pm UTC](https://www.ruby-forum.com/t/sending-a-response-back-to-a-php-site-from-rails-application/151609/1 "2008-10-23T13:27:35Z")

</div>

Hi  
I have an existing php application running commercially…Now I have a  
new rails application…So I have three fields like user\_name ,password  
and company in the php page .Which when submitting connecting to my  
rails application …To elaborate  
suppose I enter

username= user1  
password = pass1  
company = company1

```
Then when submitting the php page it should goes to my rails

```

application on port 3000 This I could do…Similary if I give a different  
company name then it wii be connected to my rails application on port  
3001

```
   Now my request is if anything error happens for wrong password or

```

wrong company name (for example) I need to redirect from rails  
controller action to the php login page it self…This I dont know how to  
do…I am totally new to this type of interconnecting two  
platforms…Could you please help me to solve this problem

Thanks in advance  
Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [October 23, 2008, 9:01pm UTC](https://www.ruby-forum.com/t/sending-a-response-back-to-a-php-site-from-rails-application/151609/2 "2008-10-23T21:01:46Z")

</div>

you must have some kind of authentication system in Rails app.

so after comparing posted values…

if user exists then redirect\_to “home/index” [home is controller and  
index action for rails app]  
else  
redirect\_to “[http://abc.com/login.php](http://abc.com/login.php)”

let me know

Ajit
