Asp.net System.Windows.Forms alternative in php

Hi guys

i am in search of php alternative of System.Windows.Forms class functionality,
my project involves handling of asp.net forms, and i have to create a php based web application that will have full control of these forms.

below is the c# code from desktop application that is using System.Windows.Forms class to do this. (my job is to create php based web app that will do similar thing in php )


public void Check()
{
    this._webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(this.ClickChangeButton);
    this._webBrowser.Url = new Uri("https://example.com/login.aspx");
}
 
private void ChooseDateOption(object sender, WebBrowserDocumentCompletedEventArgs e)
{
    this._supervisor.UpdateStatus("Logged on- choosing change details option");
    this._webBrowser.DocumentCompleted -= new WebBrowserDocumentCompletedEventHandler(this.ChooseDateOption);
    if (this._webBrowser.Document.GetElementById("changeDetails") == null)
    {
        if (this._webBrowser.Document.GetElementById("NextButton") != null)
        {
            this._webBrowser.Document.GetElementById("NextButton").InvokeMember("click");
            this._webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(this.ChooseDateOption);
        }
        else
        {
            this._supervisor.UpdateStatus("Log-on Failed - check log-on settings");
            Logger.LogError("Log-on Failed - check log-on settings");
            if (this._webBrowser.Document.Forms.Count > 0)
            {
                Logger.LogError(this._webBrowser.Document.Forms[0].InnerHtml);
            }
        }
    }
    else
    {
        this._webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(this.ChooseSoonestPossible);
        this._webBrowser.Document.GetElementById("changeDetails").InvokeMember("click");
    }
}

i hope i have explained my question, if not then i ll try to explain it even further

Salman