Results 1 to 9 of 9

Thread: looking for example of Inet.Execute post

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Unhappy looking for example of Inet.Execute post

    Hi all i am looking for example of Inet.Execute post method by passing 2 varibales name and pass to website. I be happy if some one show me how.Thanks

    Code:
    Inet.Execute "http://www.mysite.com" , "post"

  2. #2
    Member Mythrandil's Avatar
    Join Date
    Mar 2006
    Posts
    55

    Re: looking for example of Inet.Execute post

    can;t you pass vars in the web address?

    eg

    www.mysite.com?var1=test&var2=test2

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Re: looking for example of Inet.Execute post

    Quote Originally Posted by Mythrandil
    can;t you pass vars in the web address?

    eg

    www.mysite.com?var1=test&var2=test2
    well i prefare post method but i do not know how to execute post inside vb form . I want to just send form input value to external php link using post method :-)

  4. #4
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4700 x4
    Posts
    1,334

    Re: looking for example of Inet.Execute post

    VB Code:
    1. Dim var1 As String
    2. var1 = "name=frederick&age=31"
    3. Inet1.Execute "http://www.mysite.com", "POST", var1

    That's how it should work.
    Zeegnahtuer?

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Talking Re: looking for example of Inet.Execute post

    Quote Originally Posted by thegreatone
    VB Code:
    1. Dim var1 As String
    2. var1 = "name=frederick&age=31"
    3. Inet1.Execute "http://www.mysite.com", "POST", var1

    That's how it should work.
    Many thanks for u reply. I tried it but it actual does not pass the 2 char values that i want to post to my php fiile. I used a php script that normally writes post request to mysql db but in this case it creates a record for both data but no data in. I checked using form post and it worked whell but not in vb6!!could u tell me what is probably wrong?Thanks

  6. #6
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4700 x4
    Posts
    1,334

    Re: looking for example of Inet.Execute post

    Maybe you're not actually using the post mthod, or your PHP file isn't using it. It's possible you're using the GET method instead, which in that case would simply be

    Inet1.Execute "http://www.mysite.com/?name=frederick&age=31"

    Post a little snippet of your PHP coding that gets the information from the post data please.
    Zeegnahtuer?

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Re: looking for example of Inet.Execute post

    Quote Originally Posted by thegreatone
    Maybe you're not actually using the post mthod, or your PHP file isn't using it. It's possible you're using the GET method instead, which in that case would simply be

    Inet1.Execute "http://www.mysite.com/?name=frederick&age=31"

    Post a little snippet of your PHP coding that gets the information from the post data please.

    Thank u for u reply . I used your code which i assume should be for post and here is the code for php which recives post. I used it with php form and it work perfectly but when i use your code with in vb6 inside onload even it inserts a record but with no value of name and city !!

    Code:
    <?php
    
    
    
    
    $namevalue=$_POST['name'];
    $cityvalue=$_POST['city'];
    
    echo $namevalue;
    echo '<br>';
    echo $cityvalue;
    
    
    
    $server   = "localhost"; // MySQL hostname
    $username = "me"; // MySQL username
    $password = ""; // MySQL password
    $dbname   = "test"; // MySQL db name
    
    
    $db = mysql_connect($server, $username, $password) or die(mysql_error());
          mysql_select_db($dbname) or die(mysql_error());
    
    $sql = "INSERT INTO vbuser VALUES ('$ID','$namevalue','$cityvalue')";
    mysql_result(mysql_query($sql), 0, 0);

  8. #8
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4700 x4
    Posts
    1,334

    Re: looking for example of Inet.Execute post

    Well, are you sure you're passing the right variables to the form ?

    like so...

    VB Code:
    1. Dim var1 As String
    2. var1 = "[b]name[/b]=frederick&[b]city[/b]=Schenectady"
    3. Inet1.Execute "http://www.mysite.com", "POST", var1
    Zeegnahtuer?

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Arrow Re: looking for example of Inet.Execute post

    Quote Originally Posted by thegreatone
    Well, are you sure you're passing the right variables to the form ?

    like so...

    VB Code:
    1. Dim var1 As String
    2. var1 = "[b]name[/b]=frederick&[b]city[/b]=Schenectady"
    3. Inet1.Execute "http://www.mysite.com", "POST", var1
    well yes the names are correct the order are corect and also the data type but just does not transfer the data to php script but it executes the php without data!!:-( . Could u try it in your side see if it works?Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width