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

  • Home
  • SEARCH
  • 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 6971179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:48:24+00:00 2026-05-27T16:48:24+00:00

so far i have used this code.It is working when i am sending the

  • 0

so far i have used this code.It is working when i am sending the data from aspx to aspx.

But in case of aspx to php it is not working…..

protected void Button1_Click(object sender, EventArgs e)
{
    RemotePost myremotepost = new RemotePost();
    myremotepost.Url = "http://172.16.126.32/Riyas/marggroup.com/get-current-openings.php";
    myremotepost.Add("field1", TextBox1.Text);
    myremotepost.Post();
}
public class RemotePost
{
    private System.Collections.Specialized.NameValueCollection Inputs = new System.Collections.Specialized.NameValueCollection();


    public string Url = "";
    public string Method = "post";
    public string FormName = "form1";

    public void Add(string name, string value)
    {
        Inputs.Add(name, value);
    }

    public void Post()
    {
        System.Web.HttpContext.Current.Response.Clear();

        System.Web.HttpContext.Current.Response.Write("<html><head>");

        System.Web.HttpContext.Current.Response.Write(string.Format("</head><body onload=\"document.{0}.submit()\">", FormName));
        System.Web.HttpContext.Current.Response.Write(string.Format("<form name=\"{0}\" method=\"{1}\" action=\"{2}\" >", FormName, Method, Url));
        for (int i = 0; i < Inputs.Keys.Count; i++)
        {
            System.Web.HttpContext.Current.Response.Write(string.Format("<input name=\"{0}\" type=\"hidden\" value=\"{1}\">", Inputs.Keys[i], Inputs[Inputs.Keys[i]]));
        }
        System.Web.HttpContext.Current.Response.Write("</form>");
        System.Web.HttpContext.Current.Response.Write("</body></html>");

        System.Web.HttpContext.Current.Response.End();
    }
}

In case of php i have use this code:

<script runat="server">

    function formload()
    {
         alert("its working");  
        if(Request.Form["field1"] != null ){
            alert("its working");
            Response.Write("field1 : " + Request.Form["field1"] + "</br>");
        }
        if(Request.Form["field2"] != null ){
            Response.Write("field2 : " +Request.Form["field2"] + "</br>");
        }
    }
    </script>
    </head>
<body onload="JavaScript:formload()">
<script language="JavaScript">// change to text/javascript or even remove, no effect
window.onload = function() {
  formload();
};
</script>
</body>

My aim is i want to send data from aspx to php not in the query string.

  • 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-05-27T16:48:24+00:00Added an answer on May 27, 2026 at 4:48 pm

    Interesting…

    in the onload function, you are calling formload(), which is a server side function , isn’t it?

    this is not correct, on client site you should only call client site javascript function.

    if you want to post information to another server, no matter it is php/asp.net/jsp.

    simply use a form….

    in the Post function of your remotepost class, you didn’t post to your remote server… just generate some html tags, and in the page load function, submit the form automatically,

    it is not nice, but should work.

    correct first issue first, then see how it goes.

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

Sidebar

Related Questions

I have used this effect before, everything is in order (As far as I
I have toyed with a number of ideas to do this, but so far
I got this code I've been working on so far, it is going to
I have used just Windows for programming so far. Now, I have an internship
As far as I remember, Visual Studio (both 2008 and 2010) used to have
So far i have got the code below which works lovely when trying an
So far I have been creating Web Portal but recently I had a request
So far I have managed to write some code that should print the source
Does VB.NET have anything similar to Java's JDK source code? When I used to
I have a webapp written in PHP using a MySQL database backend. This question

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.