title: How to send data from aspx to php page
body: <p>so far i have used this code.It is working when i am sending the data from aspx to aspx.</p>
  
  <p>But in case of aspx to php it is not working.....</p>
  
  <pre><code>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("&lt;html&gt;&lt;head&gt;");
  
          System.Web.HttpContext.Current.Response.Write(string.Format("&lt;/head&gt;&lt;body onload=\"document.{0}.submit()\"&gt;", FormName));
          System.Web.HttpContext.Current.Response.Write(string.Format("&lt;form name=\"{0}\" method=\"{1}\" action=\"{2}\" &gt;", FormName, Method, Url));
          for (int i = 0; i &lt; Inputs.Keys.Count; i++)
          {
              System.Web.HttpContext.Current.Response.Write(string.Format("&lt;input name=\"{0}\" type=\"hidden\" value=\"{1}\"&gt;", Inputs.Keys[i], Inputs[Inputs.Keys[i]]));
          }
          System.Web.HttpContext.Current.Response.Write("&lt;/form&gt;");
          System.Web.HttpContext.Current.Response.Write("&lt;/body&gt;&lt;/html&gt;");
  
          System.Web.HttpContext.Current.Response.End();
      }
  }
  </code></pre>
  
  <p>In case of php i have use this code:</p>
  
  <pre><code>&lt;script runat="server"&gt;
  
      function formload()
      {
           alert("its working");  
          if(Request.Form["field1"] != null ){
              alert("its working");
              Response.Write("field1 : " + Request.Form["field1"] + "&lt;/br&gt;");
          }
          if(Request.Form["field2"] != null ){
              Response.Write("field2 : " +Request.Form["field2"] + "&lt;/br&gt;");
          }
      }
      &lt;/script&gt;
      &lt;/head&gt;
  &lt;body onload="JavaScript:formload()"&gt;
  &lt;script language="JavaScript"&gt;// change to text/javascript or even remove, no effect
  window.onload = function() {
    formload();
  };
  &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>My aim is i want to send data from aspx to php not in the query string.</p>