VB connecting to a PHP website

Reply

Join Date: Jan 2009
Posts: 37
Reputation: headedtomexico is an unknown quantity at this point 
Solved Threads: 0
headedtomexico headedtomexico is offline Offline
Light Poster

VB connecting to a PHP website

 
0
  #1
Mar 24th, 2009
I have a VB application that connects to a PHP page for user validation, and I'm having some problems getting it to work for a particular user. I didn't wanna double post in both forums and Im not sure if its a PHP or VB problem so here is the main thread. Any help anyone has would be very appreciated

http://www.daniweb.com/forums/post83...tml#post831548
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 271
Reputation: fatihpiristine has a little shameless behaviour in the past 
Solved Threads: 16
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: VB connecting to a PHP website

 
0
  #2
Mar 24th, 2009
it doesnt matter where you connecting or how you are connecting. as long as you are processing your requests on server side you can get the data and the content of any page passing correct parameters. for example we have written a code to content of the mails from live mail...

  1. HttpWebRequest mailLive = (HttpWebRequest)WebRequest.Create(new Uri(uriString));
  2.  
  3. // create a Cookie Container
  4. CookieContainer cookieContainer = new CookieContainer();
  5. mailLive.CookieContainer = cookieContainer;
  6. mailLive.AllowAutoRedirect = true;
  7.  
  8. mailLive.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate");
  9. mailLive.Accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*";
  10. mailLive.Headers.Add(HttpRequestHeader.AcceptCharset, "iso-8859-1, utf-8, iso-10646-ucs-2;q=0.6");
  11. mailLive.Headers.Add(HttpRequestHeader.AcceptLanguage, "en-us");
  12. mailLive.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; InfoPath.2; MS-RTC LM 8; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; SPC 3.1 P1 Tc";
  13. mailLive.Headers.Add(HttpRequestHeader.CacheControl, "no-cache");
  14. mailLive.ContentType = "application/x-www-form-urlencoded";
  15.  
  16.  
  17. mailLive.Method = "POST";
  18. byte[] postBuffer = Encoding.GetEncoding("iso-8859-1").GetBytes(postData);
  19. mailLive.ContentLength = postBuffer.Length;
  20. mailLive.UnsafeAuthenticatedConnectionSharing = true;


if you reach this point, you will need a stream reader to read and parse the rest of the content... hope this will give you some ideas. the code is written in C#.

this is just a part of the code. i cannot post complete source code here.

Enjoy
Last edited by peter_budo; Mar 26th, 2009 at 11:20 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,075
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: VB connecting to a PHP website

 
0
  #3
Mar 25th, 2009
so you're saying the output from the PHP file is:

2
#1

In the HTTP Body?

So that means you have some junk before the #1.

If you just use the browser, and populate the URL with:

server.com/validtaion.php?user=testlogin&pass=testpass

If it returns 1 or 0 correctly. Then you can forget about the PHP side of things, and know that there is something wrong with the VB side.

The languages used really doesn't affect anything, since you're working with text here. (the text in the HTTP Body, it doesn't matter what created that text).
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC