Click here to Skip to main content
15,886,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
hi
i’m  tried to make my own edu website but i’m facing lot of problem:
1)when the students enter their usn no/reg no(eg:1db12cs005) when user hit submit button it must fetch result from external website(eg:http://www.results.vtu.ac.in/)‎ but I don’t want to redirected to the external website, where results can be seen. Instead, I want the results to be displayed on the same website(its mine). I’m open to to all kinds of suggestion!
but dont post a code on reply form instead plz mail me punithramesh007@gmail.com

there r many website for (eg fastvturesults.com,vtualerts) they fetch from website http://results.vtu.ac.in/vitavi.php and display there result on there own table plz help me out from this problem
Posted

To get data from another site do this:

C#
string Url = "http://someurl";
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(Url);
myRequest.Method = "GET";
WebResponse myResponse = myRequest.GetResponse();
            
StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);
string result = sr.ReadToEnd();
sr.Close();
myResponse.Close();
 
Share this answer
 
Comments
ZurdoDev 25-Feb-14 14:42pm    
1. C#
2. No, I will not email you. That would expose my email address and I am not willing to do that.
3. If you do not want spam, you should remove your email address from the question.
You better start by contacting the owners of the website you're trying to get data from. Usually there is a Terms of Service in place that denies you from reusing their content without express written permission from them.

On top of that, why would anyone who knows anything about security issues give your website the credentials they use on some other website? What guarantees do the users have that you won't use their credentials for malicious purposes??

Hint: They don't have any.
 
Share this answer
 
Comments
Dave Kreskowiak 26-Feb-14 7:57am    
Yes, but you don't give your credentials to a 3rd party site. Ever.

For example, pay for something using your PayPal account. The vendor site sends you to a PayPal page to enter your credentials and verify the transaction details. The vendor site never sees that information. It only gets a response back from PayPal that the transaction was processed.

In your case, you would normally redirect the user to the site that has the record information. The user would enter their credentials on that page and your site would get back a time-limited security token that your code would then pass to that sites API to get the data to display. Your site never sees the user enter their username and password.

Sure, there are plenty of legitimate sites that do this, but not the way you think they do. Giving your username and password to a site that does not own the credential database is just insane. Sites that do it the way you want to do it are either just written by complete newbies who don't know they are exposing their users to security risks, or are there to harvest credential information under the guise of being "legitimate" portals.

The correct thing to do would be to get with that website and see if they have a WebAPI or WebService that you can get the data from without scraping web pages.

Your only other alternative is to do it the hard way, which is also the newbie way, and load their web page, scrap it for data (which the format of the page can change, rendering your scraping code useless!), and then reformat the data on your own page. Check out the HTML Agility Pack for that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900