Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

i need help about internet programming

arhannur1arhannur1 Posts: 10Member
i'm going to be crazy. please help me...
i want to create an application running on the net. it has a form and a combobox on the form. when the page opened, the combobox gets the filenames from the service computer; and when user write on the combobox, application creates an another text file on the service computer.
what are the procedures that i had to follow to create an application running on internet such this. (sorry for bad english; please help me...)

Comments

  • zibadianzibadian Posts: 6,349Member
    : i'm going to be crazy. please help me...
    : i want to create an application running on the net. it has a form and a combobox on the form. when the page opened, the combobox gets the filenames from the service computer; and when user write on the combobox, application creates an another text file on the service computer.
    : what are the procedures that i had to follow to create an application running on internet such this. (sorry for bad english; please help me...)
    :
    IMHO the best way to tackle this is to write an ISAPI dll and run that within the confines of a webserver. For this you'll need to klow a little HTML and their forms. And of course you need to have access to a webserver, which allows you to run ISAPI libraries. If you want to test it on your own computer, I suggest that you use the Apache webserver (free downloadable from http://httpd.apache.org/). This method uses mainly the TPageProducer component, and the TWebModule datamodule. Most of the code is already in those two objects. Delphi ships a demo of an ISAPI dll called iserver.dll (demo/webserv).
    Another method is to use ActiveX forms, which are loaded into the html code. Some users might not be able to access this, because they have turned off the ActiveX support or might run a browser, which doesn't support ActiveX. Also this again requires a webbrowser, which allows you to run CGI scripts. I don't know much about this method, because I dislike ActiveX in general, so I never took the time to learn it.
  • arhannur1arhannur1 Posts: 10Member
    : : i'm going to be crazy. please help me...
    : : i want to create an application running on the net. it has a form and a combobox on the form. when the page opened, the combobox gets the filenames from the service computer; and when user write on the combobox, application creates an another text file on the service computer.
    : : what are the procedures that i had to follow to create an application running on internet such this. (sorry for bad english; please help me...)
    : :
    : IMHO the best way to tackle this is to write an ISAPI dll and run that within the confines of a webserver. For this you'll need to klow a little HTML and their forms. And of course you need to have access to a webserver, which allows you to run ISAPI libraries. If you want to test it on your own computer, I suggest that you use the Apache webserver (free downloadable from http://httpd.apache.org/). This method uses mainly the TPageProducer component, and the TWebModule datamodule. Most of the code is already in those two objects. Delphi ships a demo of an ISAPI dll called iserver.dll (demo/webserv).
    : Another method is to use ActiveX forms, which are loaded into the html code. Some users might not be able to access this, because they have turned off the ActiveX support or might run a browser, which doesn't support ActiveX. Also this again requires a webbrowser, which allows you to run CGI scripts. I don't know much about this method, because I dislike ActiveX in general, so I never took the time to learn it.
    :

    i was working on active forms until now. thank you for this new way. now, i downloaded apache. should i use TPageProducer on a normal form; or on the web module? thanks again...
  • arhannur1arhannur1 Posts: 10Member
    : : : i'm going to be crazy. please help me...
    : : : i want to create an application running on the net. it has a form and a combobox on the form. when the page opened, the combobox gets the filenames from the service computer; and when user write on the combobox, application creates an another text file on the service computer.
    : : : what are the procedures that i had to follow to create an application running on internet such this. (sorry for bad english; please help me...)
    : : :
    : : IMHO the best way to tackle this is to write an ISAPI dll and run that within the confines of a webserver. For this you'll need to klow a little HTML and their forms. And of course you need to have access to a webserver, which allows you to run ISAPI libraries. If you want to test it on your own computer, I suggest that you use the Apache webserver (free downloadable from http://httpd.apache.org/). This method uses mainly the TPageProducer component, and the TWebModule datamodule. Most of the code is already in those two objects. Delphi ships a demo of an ISAPI dll called iserver.dll (demo/webserv).
    : : Another method is to use ActiveX forms, which are loaded into the html code. Some users might not be able to access this, because they have turned off the ActiveX support or might run a browser, which doesn't support ActiveX. Also this again requires a webbrowser, which allows you to run CGI scripts. I don't know much about this method, because I dislike ActiveX in general, so I never took the time to learn it.
    : :
    :
    : i was working on active forms until now. thank you for this new way. now, i downloaded apache. should i use TPageProducer on a normal form; or on the web module? thanks again...

    i tried tpageproducer. with this i can show a database table on internet. but my main problem is to make possible entering data to this table by an internet user. when i put some controls or link on this page to write on my database table( for example, when user click on radiobutton1 database must save it as 1 or 2 on radiobutton2) , remote machine fails to reach the file. which procedure i pass?
    :

  • zibadianzibadian Posts: 6,349Member
    : : : : i'm going to be crazy. please help me...
    : : : : i want to create an application running on the net. it has a form and a combobox on the form. when the page opened, the combobox gets the filenames from the service computer; and when user write on the combobox, application creates an another text file on the service computer.
    : : : : what are the procedures that i had to follow to create an application running on internet such this. (sorry for bad english; please help me...)
    : : : :
    : : : IMHO the best way to tackle this is to write an ISAPI dll and run that within the confines of a webserver. For this you'll need to klow a little HTML and their forms. And of course you need to have access to a webserver, which allows you to run ISAPI libraries. If you want to test it on your own computer, I suggest that you use the Apache webserver (free downloadable from http://httpd.apache.org/). This method uses mainly the TPageProducer component, and the TWebModule datamodule. Most of the code is already in those two objects. Delphi ships a demo of an ISAPI dll called iserver.dll (demo/webserv).
    : : : Another method is to use ActiveX forms, which are loaded into the html code. Some users might not be able to access this, because they have turned off the ActiveX support or might run a browser, which doesn't support ActiveX. Also this again requires a webbrowser, which allows you to run CGI scripts. I don't know much about this method, because I dislike ActiveX in general, so I never took the time to learn it.
    : : :
    : :
    : : i was working on active forms until now. thank you for this new way. now, i downloaded apache. should i use TPageProducer on a normal form; or on the web module? thanks again...
    :
    : i tried tpageproducer. with this i can show a database table on internet. but my main problem is to make possible entering data to this table by an internet user. when i put some controls or link on this page to write on my database table( for example, when user click on radiobutton1 database must save it as 1 or 2 on radiobutton2) , remote machine fails to reach the file. which procedure i pass?
    : :
    :
    :
    You need to create a "Web Server Application" (dialog after File|New). This will create a TWebApplication with a single TWebModule. Onto the webmodule you place the database access components and page producing components (such as TPageProducer, and perhaps TQueryTableProducer, etc). The HTML code itself is created by the TPageProducer using the OnHTMLTag() event and a template page. Remember the HTML pages become the forms of the project. Things like buttons, comboboxes, etc. all need to be code in HTML instead of in Delphi.
    Once you have the HTML code generated by the TPageProducer, you can start on exposing them to the user. This is done using the Actions. Through their OnAction()'s, you can determine what the user is doing, and what he wants to be done by the application. Here is a small HTML page, which asks the user for his name:
    [code]


    Type your name


    Type your name









    [/code]
    And this is the code for the action to get the Username into the application:
    [code]
    procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
    Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
    begin
    UserName := Request.GetFieldByName('UserName');
    // Username is a global variable
    Response.Content := 'Welcome, '+UserName+'';
    end;
    [/code]
    The PathInfo of WebActionItem1 is "SetUserName", and its producer is left empty for this example.
    As you can see there are no forms or dialog boxes, which tells the user what's going on. All the communication is done using HTML. Here is a small example of how to use the TPageProducer.OnHTMLTag() event:
    First the HTML code:
    [code]


    Updated Record Stats


    <#UserName> has updated <#RecordNum> records.


    [/code]
    And the Delphi code:
    [code]
    procedure TWebModule1.PageProducer1HTMLTag(Sender: TObject; Tag: TTag;
    const TagString: String; TagParams: TStrings; var ReplaceText: String);
    begin
    if TagString = 'UserName' then
    ReplaceText := UserName
    else if TagString = 'RecordNum' then
    ReplaceText := IntToStr(UpdatedRecordNum);
    end;
    [/code]
    You then use a TWebActionItem to make sure the user can surf to this page, by setting its Producer and PathInfo properties. You don't need to write an OnAction() in this case, because it will automatically send the Pageproducer's Content to the user.

    On a final note: there is a memory leak in Delphi, which is important for web programmers. See this article in the Delphi Magazine http://www.thedelphimagazine.com/samples/1328/1328.htm for more info.
  • arhannur1arhannur1 Posts: 10Member
    : : : : : i'm going to be crazy. please help me...
    : : : : : i want to create an application running on the net. it has a form and a combobox on the form. when the page opened, the combobox gets the filenames from the service computer; and when user write on the combobox, application creates an another text file on the service computer.
    : : : : : what are the procedures that i had to follow to create an application running on internet such this. (sorry for bad english; please help me...)
    : : : : :
    : : : : IMHO the best way to tackle this is to write an ISAPI dll and run that within the confines of a webserver. For this you'll need to klow a little HTML and their forms. And of course you need to have access to a webserver, which allows you to run ISAPI libraries. If you want to test it on your own computer, I suggest that you use the Apache webserver (free downloadable from http://httpd.apache.org/). This method uses mainly the TPageProducer component, and the TWebModule datamodule. Most of the code is already in those two objects. Delphi ships a demo of an ISAPI dll called iserver.dll (demo/webserv).
    : : : : Another method is to use ActiveX forms, which are loaded into the html code. Some users might not be able to access this, because they have turned off the ActiveX support or might run a browser, which doesn't support ActiveX. Also this again requires a webbrowser, which allows you to run CGI scripts. I don't know much about this method, because I dislike ActiveX in general, so I never took the time to learn it.
    : : : :
    : : :
    : : : i was working on active forms until now. thank you for this new way. now, i downloaded apache. should i use TPageProducer on a normal form; or on the web module? thanks again...
    : :
    : : i tried tpageproducer. with this i can show a database table on internet. but my main problem is to make possible entering data to this table by an internet user. when i put some controls or link on this page to write on my database table( for example, when user click on radiobutton1 database must save it as 1 or 2 on radiobutton2) , remote machine fails to reach the file. which procedure i pass?
    : : :
    : :
    : :
    : You need to create a "Web Server Application" (dialog after File|New). This will create a TWebApplication with a single TWebModule. Onto the webmodule you place the database access components and page producing components (such as TPageProducer, and perhaps TQueryTableProducer, etc). The HTML code itself is created by the TPageProducer using the OnHTMLTag() event and a template page. Remember the HTML pages become the forms of the project. Things like buttons, comboboxes, etc. all need to be code in HTML instead of in Delphi.
    : Once you have the HTML code generated by the TPageProducer, you can start on exposing them to the user. This is done using the Actions. Through their OnAction()'s, you can determine what the user is doing, and what he wants to be done by the application. Here is a small HTML page, which asks the user for his name:
    : [code]
    :
    :
    : Type your name
    :
    :
    : Type your name
    :
    :
    :
    :
    :
    :
    :
    : [/code]
    : And this is the code for the action to get the Username into the application:
    : [code]
    : procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
    : Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
    : begin
    : UserName := Request.GetFieldByName('UserName');
    : // Username is a global variable
    : Response.Content := 'Welcome, '+UserName+'';
    : end;
    : [/code]
    : The PathInfo of WebActionItem1 is "SetUserName", and its producer is left empty for this example.
    : As you can see there are no forms or dialog boxes, which tells the user what's going on. All the communication is done using HTML. Here is a small example of how to use the TPageProducer.OnHTMLTag() event:
    : First the HTML code:
    : [code]
    :
    :
    : Updated Record Stats
    :
    :
    : <#UserName> has updated <#RecordNum> records.
    :
    :
    : [/code]
    : And the Delphi code:
    : [code]
    : procedure TWebModule1.PageProducer1HTMLTag(Sender: TObject; Tag: TTag;
    : const TagString: String; TagParams: TStrings; var ReplaceText: String);
    : begin
    : if TagString = 'UserName' then
    : ReplaceText := UserName
    : else if TagString = 'RecordNum' then
    : ReplaceText := IntToStr(UpdatedRecordNum);
    : end;
    : [/code]
    : You then use a TWebActionItem to make sure the user can surf to this page, by setting its Producer and PathInfo properties. You don't need to write an OnAction() in this case, because it will automatically send the Pageproducer's Content to the user.
    :
    : On a final note: there is a memory leak in Delphi, which is important for web programmers. See this article in the Delphi Magazine http://www.thedelphimagazine.com/samples/1328/1328.htm for more info.
    :


    thanks a thousand lots!!! You saved my life...
Sign In or Register to comment.