jortega2 Posted April 6, 2012 Share Posted April 6, 2012 Hello Everyone! I'm new to the forum and new to PHP. I'm curious about the limitations of PHP. I'm working a project that I'm not even sure is possible in PHP. The project is simple: I need a page that can track business reviews on external sites and report that activity to a database. Below is a simple mockup of the html. <html> <head> <title>Boomerang Project</title> </head> <body> <h1>Like Our Work?</h1> <h2>Help Spread The Word.</h2> <p>Click on the links below to start writing a review about the service that we have provided you.</p> <h3>Complete 5 reviews recieve a gift certificate.</h3> <ul> <li><a href="" target="_blank">Yahoo</a></a></li> <li><a href="" target="_blank">Google</a></li> <li><a href="" target="_blank">Yelp</a></li> <li><a href="" target="_blank">Manta</a></li> <p>You have completed <!--Number-of-Reviews-Completed-->. <br /> <br /> <!--The form below doesn't appear until at least 5 reviews are confirmed to have been posted. At which point a script will reconfirm the postings and send 2 emails, one to business with client info and another email to client confirming the completion of the postings.--> <form> <fieldset> <label for="name">Name</label><input type="text" name="full-name" /><br /> <label for="address">Address</label><input type="text" name="address" /><br /> <label for="city">City</label><input type="text" name="city" /><br /> <label for="state">State</label><input type="text" name="state" /><br /> <label for="zipcode">Zip Code</label><input type="text" name="zipcode" /><br /> <label for="telephone">Telephone</label><input type="text" name="telephone" /><br /> <label for="email">Email</label><input type="text" name="emaile" /><br /> <input type="submit" /> </fieldset> </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/260428-php-sessions-across-external-domains/ Share on other sites More sharing options...
Muddy_Funster Posted April 6, 2012 Share Posted April 6, 2012 Nothing about anything you said explains why you would need to carry a session accross domains. Why does it need to be a session? Why do the scripts need to be on different domains? Quote Link to comment https://forums.phpfreaks.com/topic/260428-php-sessions-across-external-domains/#findComment-1334891 Share on other sites More sharing options...
cpd Posted April 6, 2012 Share Posted April 6, 2012 So your looking at reading the reports from different websites? Quote Link to comment https://forums.phpfreaks.com/topic/260428-php-sessions-across-external-domains/#findComment-1334903 Share on other sites More sharing options...
jortega2 Posted April 6, 2012 Author Share Posted April 6, 2012 @Muddy_Funster The page i'm making sits on mydomain.com and links to the Google, Yahoo, and Yelp domains. My idea was to somehow create a session that would follow the user into Google, Yahoo, and Yelp to make sure they submitted a review of my business. Maybe this could be done by making sure the user filled out the required form fields and hit the submit button on the review page. (Google, Yahoo, and Yelp have different form fields) Also, I'm not entirely sure if this has to be a PHP session. That was just an initial idea. @CPD I'm interested in knowing that the user submitted the report regardless of what the content is. However if it is possible, I would like to read the reviews. Quote Link to comment https://forums.phpfreaks.com/topic/260428-php-sessions-across-external-domains/#findComment-1334964 Share on other sites More sharing options...
Muddy_Funster Posted April 6, 2012 Share Posted April 6, 2012 what are the forms on the remote end? are they your own forms or proprietry for the domain? Gonna need to know more about what you are working with to establish an accurate solution. Can we see some sample form code? Have you thought about embeding the forms in your own page(s)? Quote Link to comment https://forums.phpfreaks.com/topic/260428-php-sessions-across-external-domains/#findComment-1334969 Share on other sites More sharing options...
cpd Posted April 6, 2012 Share Posted April 6, 2012 The minute you move to a different site you can't alter the session which should still be active for your site. You could use frames to access these other pages through your website as some other sites do. If your just interested in knowing if they submitted a report/review regarding your site perhaps look into API's for the websites. They may have something... Quote Link to comment https://forums.phpfreaks.com/topic/260428-php-sessions-across-external-domains/#findComment-1334977 Share on other sites More sharing options...
jortega2 Posted April 6, 2012 Author Share Posted April 6, 2012 @Muddy_Funster The forms on the remote end are property of (Google, Yahoo, Yelp, etc). I have thought about embedding the forms in my page. However, I don't think it would be possible to submit the data to external servers because Google, Yahoo, Yelp, etc. require the user to sign in before sending the form. Check out the link below to get an idea of what i'm trying to do: http://universalconcretesystems.com/test/refferer.php Click the link and view source to look at the form code. Quote Link to comment https://forums.phpfreaks.com/topic/260428-php-sessions-across-external-domains/#findComment-1334981 Share on other sites More sharing options...
cpd Posted April 6, 2012 Share Posted April 6, 2012 http://developer.yahoo.com/local/ First thing I searched came up with this... it's not hard. Although, not 100% how useful it'll be. Quote Link to comment https://forums.phpfreaks.com/topic/260428-php-sessions-across-external-domains/#findComment-1334986 Share on other sites More sharing options...
jortega2 Posted April 6, 2012 Author Share Posted April 6, 2012 @CPD Could you elaborate on your frames idea? Quote Link to comment https://forums.phpfreaks.com/topic/260428-php-sessions-across-external-domains/#findComment-1334987 Share on other sites More sharing options...
cpd Posted April 6, 2012 Share Posted April 6, 2012 Its a pointless idea unless you can somehow detect the submission of the review. This can only be done with either JS or by accessing the data through an API like the one in my previous post... All the frame would do is keep them on your website so you can control (to a certain degree) where they are. Quote Link to comment https://forums.phpfreaks.com/topic/260428-php-sessions-across-external-domains/#findComment-1334989 Share on other sites More sharing options...
jortega2 Posted April 6, 2012 Author Share Posted April 6, 2012 @CPD That is exactly what I need help with. I need a script that can detect detect the submission of the reviews. Very few websites offer an API to do this (Yahoo is one of them). We are looking to extend this type of script to a bunch of business review sites. Including: Google, Yahoo, Yelp, YellowPages, Manta, ShowMeLocal, AngiesList, YellowBot, CitySearch, AOL, FourSquare etc. The list goes on (There are a total of 10-15 sites). Quote Link to comment https://forums.phpfreaks.com/topic/260428-php-sessions-across-external-domains/#findComment-1334993 Share on other sites More sharing options...
kicken Posted April 6, 2012 Share Posted April 6, 2012 There is not way to follow what a user does on another site without enlisting that site's help. What I mean by that is you would have to contact Google, Yahoo, etc and ask them to provide you with some method of determining that the user submitted the review. PHP sessions are only valid for your own pages and JS is limited by the same-origin policy which prevents you from interacting with the other sites. The best you could do without entering some kind of partnership with the sites is either: 1) Have the user's submit the review to you and then you re-submit it to the other sites. If the other sites require a login first then this option won't work. 2) Use screen-scraping techniques to check the sites periodically to see if the review has been posted. Not a very reliable method and you'd need some way to identify their review vs any other user reviews that have been submitted. Quote Link to comment https://forums.phpfreaks.com/topic/260428-php-sessions-across-external-domains/#findComment-1335104 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.