Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8884477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:04:10+00:00 2026-06-14T21:04:10+00:00

i was wondering how to post data from c# form to a php using

  • 0

i was wondering how to post data from c# form to a php using geckoWebBrowser?
I have done it with IE browser on form

    public Form1()
    {
        InitializeComponent();
        String postdata = "data=somedata";

        System.Text.Encoding a = System.Text.Encoding.UTF8;

        byte[] byte1 = a.GetBytes(postdata);

        webBrowser1.Navigate("somepage.php", "", byte1, "Content-Type: application/x-www-form-urlencoded");
    }

But how to do it with geckoWebBrowser1.Navigate?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:04:11+00:00Added an answer on June 14, 2026 at 9:04 pm

    The method GeckoWebBrowser.Navigate() passes its parameters to a nsIWebNavigation instance, which is the XPCOM interface for running a browser instance, in this case using XULRunner 1.8 (which is pretty old).

    Unfortunately, the Navigate() method of the GeckoWebBrowser does not supply an overload for postData; it simply passes Intptr.Zero for that argument.

    I can’t test it, but if you create a new method like this in GeckoWebBrowser.cs, you can call it with a string containing post data:

    public bool Navigate(string url, string postData, GeckoLoadFlags loadFlags)
    {
        if (url == null)
        {
            throw new ArgumentNullException("url");
        }
    
        if (!IsHandleCreated)
        {
                throw new InvalidOperationException("Cannot call Navigate() before the window handle is created.");
        }
    
        if (IsBusy)
        {
            this.Stop();
        }
    
        return WebNav.LoadURI(url, (uint)loadFlags, null, GetStreamFromString(postData), IntPtr.Zero) == 0;
    }
    
    public static Stream??? CreateStreamFromString(string input)
    {
        return new StreamReader???(input);
    }
    

    Please note that the LoadURI method accepts an nsIInputStream parameter, which I do not know. Try to find the parameter type and how to instantiate that, and fix the CreateStreamFromString() method to return and instantiate the right type.

    Also check out the documentation for the postData parameter:

    If the URI corresponds to a HTTP request, then this stream is appended directly to the HTTP request headers. It may be prefixed with additional HTTP headers. This stream must contain a \r\n sequence separating any HTTP headers from the HTTP request body. This parameter may be null.


    But perhaps you just want to use a WebClient or HttpClient (.NET 4.5 only) class if this is only for posting data to some URL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a short script to post from data to a PHP processing
I am using the PHP below to submit data from an html form to
I was wondering if converting POST input from an HTML form into html entities,
I have a form for updating user data. It posts to this page: <?php
I have the following php array that gets all values from a form full
I have a function which sends specified form data to a php processing page.
I'm sending a PHP script data converted from JSON into serialised form by JQuery
I have a PHP form, and I'm wondering how I should handle submission. I
Following on from my other post about primary keys I am wondering if there
i have a post with a LOT of variables, and I was wondering if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.