HTTP POST from VB app to PHP script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • majik92@gmail.com

    #1

    HTTP POST from VB app to PHP script

    Hello,

    I'm in the process of rewriting a program I wrote in LUA to VB.NET.
    So, I am still learning the language (VB). I just have a question...

    I have a windows form called "mainPage". I want to connect to the
    Internet while loading. I know that I have to put the code in the Load
    event for the form. Basically I want the app to send a value (latest =
    1) to a remote PHP script (http://www.example.com/latest.php) using
    the HTTP POST method.

    I've tried using Visual Studio 2005's help topics with not luck...

    I was hoping someone could help me here. Thank you.

  • Jeff Johnson

    #2
    Re: HTTP POST from VB app to PHP script


    <majik92@gmail. comwrote in message
    news:1175477276 .936607.263810@ d57g2000hsg.goo glegroups.com.. .
    I'm in the process of rewriting a program I wrote in LUA to VB.NET.
    [Canned response]
    This is a VB "classic" newsgroup. Questions about VB.NET (including VB 2005,
    which has dropped .NET from its name) are off-topic here.

    Please ask .NET questions in newsgroups with "dotnet" in their names. The
    *.vb.* groups are for VB6 and earlier. If you don't see the *.dotnet.*
    groups on your news server, connect directly to the Microsoft server:
    msnews.microsof t.com.

    For questions specific to the VB.NET language, use this group:
    microsoft.publi c.dotnet.langua ges.vb

    Please note that things like controls and data access, which have their own
    subgroups in the Classic VB hierarchy, are not language-specific in .NET, so
    you should look for groups like these:
    microsoft.publi c.dotnet.framew ork.windowsform s.controls
    microsoft.publi c.dotnet.framew ork.adonet
    (Note that "vb" is not present in the group name.)


    Comment

    • Mike Williams

      #3
      Re: HTTP POST from VB app to PHP script

      <majik92@gmail. comwrote in message
      news:1175477276 .936607.263810@ d57g2000hsg.goo glegroups.com.. .
      I'm in the process of rewriting a program I wrote in LUA
      to VB.NET. So, I am still learning the language (VB).
      You've got me confused now. That's three different languages you've quoted.

      Mike


      Comment

      • Alcibiade

        #4
        Re: HTTP POST from VB app to PHP script

        On 2 Apr, 03:27, maji...@gmail.c om wrote:
        Hello,
        >
        I'm in the process of rewriting a program I wrote in LUA to VB.NET.
        So, I am still learning the language (VB). I just have a question...
        >
        I have a windows form called "mainPage". I want to connect to the
        Internet while loading. I know that I have to put the code in the Load
        event for the form. Basically I want the app to send a value (latest =
        1) to a remote PHP script (http://www.example.com/latest.php) using
        the HTTP POST method.
        >
        I've tried using Visual Studio 2005's help topics with not luck...
        >
        I was hoping someone could help me here. Thank you.
        Hi, I had same problem.
        Try to look here http://snipurl.com/1ew5a

        Comment

        • majik92@gmail.com

          #5
          Re: HTTP POST from VB app to PHP script

          On Apr 2, 12:46 am, "Jeff Johnson" <i...@enough.sp amwrote:
          <maji...@gmail. comwrote in message
          >
          news:1175477276 .936607.263810@ d57g2000hsg.goo glegroups.com.. .
          >
          I'm in the process of rewriting a program I wrote in LUA to VB.NET.
          >
          [Canned response]
          This is a VB "classic" newsgroup. Questions about VB.NET (including VB 2005,
          which has dropped .NET from its name) are off-topic here.
          >
          Please ask .NET questions in newsgroups with "dotnet" in their names. The
          *.vb.* groups are for VB6 and earlier. If you don't see the *.dotnet.*
          groups on your news server, connect directly to the Microsoft server:
          msnews.microsof t.com.
          >
          For questions specific to the VB.NET language, use this group:
          microsoft.publi c.dotnet.langua ges.vb
          >
          Please note that things like controls and data access, which have their own
          subgroups in the Classic VB hierarchy, are not language-specific in .NET, so
          you should look for groups like these:
          microsoft.publi c.dotnet.framew ork.windowsform s.controls
          microsoft.publi c.dotnet.framew ork.adonet
          (Note that "vb" is not present in the group name.)
          sorry, i won't reply on microsoft.publi c.vb.general.di scussion anymore
          about vb.net


          On Apr 2, 4:29 am, "Mike Williams" <m...@whiskyand Coke.comwrote:
          <maji...@gmail. comwrote in message
          >
          news:1175477276 .936607.263810@ d57g2000hsg.goo glegroups.com.. .
          >
          I'm in the process of rewriting a program I wrote in LUA
          to VB.NET. So, I am still learning the language (VB).
          >
          You've got me confused now. That's three different languages you've quoted.
          >
          Mike
          sorry, i meant to right " I am still learning the language
          (VB.NET)"...

          On Apr 2, 3:03 pm, "Alcibiade" <panda...@liber o.itwrote:
          On 2 Apr, 03:27, maji...@gmail.c om wrote:
          >
          Hello,
          >
          I'm in the process of rewriting a program I wrote in LUA to VB.NET.
          So, I am still learning the language (VB). I just have a question...
          >
          I have a windows form called "mainPage". I want to connect to the
          Internet while loading. I know that I have to put the code in the Load
          event for the form. Basically I want the app to send a value (latest =
          1) to a remote PHP script (http://www.example.com/latest.php) using
          the HTTP POST method.
          >
          I've tried using Visual Studio 2005's help topics with not luck...
          >
          I was hoping someone could help me here. Thank you.
          >
          Hi, I had same problem.
          Try to look herehttp://snipurl.com/1ew5a
          sorry, i can't read italian, but thx anyway

          Comment

          • Branco Medeiros

            #6
            Re: HTTP POST from VB app to PHP script

            maji wrote:
            <snip>
            I'm in the process of rewriting a program I wrote in LUA to VB.NET.
            So, I am still learning the language (VB). I just have a question...
            wellcome aboard...
            I have a windows form called "mainPage". I want to connect to the
            Internet while loading. I know that I have to put the code in the Load
            event for the form. Basically I want the app to send a value (latest =
            1) to a remote PHP script (http://www.example.com/latest.php) using
            the HTTP POST method.
            <snip>

            To send an http request, you'll probably want to use the UploadString
            method of the System.Net.WebC lient class.

            Note, however, that if you want your form to paint itself *before*
            actually connecting the web, you'll probably prefer to send your
            request from the FormShown event instead of using the Load event.

            HTH.

            Regards,

            Branco.

            Comment

            • Alcibiade

              #7
              Re: HTTP POST from VB app to PHP script

              Hi, I had same problem.
              Try to look herehttp://snipurl.com/1ew5a
              >
              sorry, i can't read italian, but thx anyway
              No problem:
              in vb6 I used winsock control, in vb.net you can use tcpclient.
              I sent following data(some parameters have to be changed: script path,
              server path, filename, file content):

              POST /www/amico.php HTTP/1.1
              Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
              application/x-shockwave-flash, application/vnd.ms-excel,
              application/msword, */*
              Referer: http://127.0.0.1/www/
              Accept-Language: it
              Content-Type: multipart/form-data;
              boundary=---------------------------7d52ee2010028a
              User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
              ..NET CLR 1.1.4322)
              Host: 127.0.0.1
              Content-Length: 41702
              Connection: Keep-Alive
              Cache-Control: no-cache

              -----------------------------7d52ee2010028a
              Content-Disposition: form-data; name="MAX_FILE_ SIZE"

              300000
              -----------------------------7d52ee2010028a
              Content-Disposition: form-data; name="userfile" ; filename="E:
              \Documents
              and Settings\Evs\De sktop\157930540 .jpg"
              Content-Type: image/pjpeg

              This is a test, I'm not a picture but only text



              Comment

              Working...