Jump to content

Recommended Posts

Hi,

 

I am very new to PHP but stuck with an issue which is far too complex as confirmed by now.

 

I have two questions:

 

1. I have a database with all the registration details for an user registered to my website. I have icons on my home page which are linked to other website's home page. Is this possible that when a user clicks on an icon (of say expedia.com), user first gets programmatically registered to Expedia and then home page appears after logging in the user. I don't want user intervention anywhere between clicking on the link and getting logged-in to Expedia.

 

I understand that I need to have some kind of agreement with Expedia as well. I can get their agreement, no issues. But want to know, if this is possible or not. If yes, how should I proceed such that Expedia's code is least affected?

 

2. Second question is also similar but this time I have a google custom search embedded in my website whose search result displays result from Expedia. Now, I want when user clicks on this link (expedia from search result), similar thing should happen as explained in 1 above.

 

Hoping to get a positive response.

 

Rahul

Link to comment
https://forums.phpfreaks.com/topic/266760-best-way-to-register-programmatically/
Share on other sites

1. Yes, it is possible. If you're going to make an agreement with Expedia, find out if they have an API available - that would make things easy. Otherwise, you'll probably need to use cURL.

 

2. I'm a little fuzzy on this one, can you elaborate? What do you want to happen when you click a result?

Thanks for your reply.

 

1. Actually, I don't want to gia via API. Can't I send an xml containing registration data  or a SQL insert script containg registration data to expedia and they can insert these data into their registration table? I can include a separate file into Expedia's codebase which does this work of inserting data from registration xml or insert file. Do you think, this is feasible and easier too.

 

2. I want same thing to happen with google search result links. Say a user searches for a flight ticket availability in google custom search which is present in home page of my website and the first search result is that for Expedia. Now, when a user clicks on Expedia link, he must be logged in to Expedia after getting registered automatically. Can this happen?

 

Rahul

Sorry to overlook your second option of using cURL. If I don't want to go into any agreement with Expedia, is cURL capable of solving my problem? Using cURL, is it possible to send data from my database to the database of Expedia's?

 

Rahul

1. Actually, I don't want to gia via API. Can't I send an xml containing registration data  or a SQL insert script containg registration data to expedia and they can insert these data into their registration table? I can include a separate file into Expedia's codebase which does this work of inserting data from registration xml or insert file. Do you think, this is feasible and easier too.

 

So, you want to execute your own code on Expedia's servers? I don't think that's going to happen. And no, you can't just send them XML or SQL, then they have to parse it/execute it.

 

2. I want same thing to happen with google search result links. Say a user searches for a flight ticket availability in google custom search which is present in home page of my website and the first search result is that for Expedia. Now, when a user clicks on Expedia link, he must be logged in to Expedia after getting registered automatically. Can this happen?

 

Probably, but the answer is basically the same as #1 - use an API (if Expedia has one), or cURL.

Using cURL, is it possible to send data from my database to the database of Expedia's?

 

No. cURL is a library that is used to connect to different protocols, like HTTP(S), FTP, etc. In this case, you would use cURL to send the POST data to Expedia's registration form. Expedia's own code would then process the request. It would be like if you manually entered all the data into the form and pressed submit.

Unless their forms are csrf protected. Then you will also have to retrieve the token first.

 

@op you can register them but not log them in not even with curl. Login involves a cookie send back to tbe browser in this case curl is your browser so  the user will never get this cookie. You need an api like oauth to do that.

Unless their forms are csrf protected.

 

@op you can register them but not log them in not even with curl. Login involves a cookie send back to tbe browser in this case curl is your browser so  the user will never get this cookie. You need an api like oauth to do that.

 

CSRF protection shouldn't be a big deal, it will just be created for the cURL request - just like a normal browser request.

 

Also, cURL can work with cookies. The user won't actually be logged in to the site, but an action that requires the user to be logged in should still work from cURL.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.