Forum Moderators: phranque

Message Too Old, No Replies

HOW:create webserver application or upload it?

confuesd..working with delphi

         

Roozbeh

10:14 pm on Nov 25, 2003 (gmt 0)

10+ Year Member



Hi

my first post!

I have just got a domain and i want to write an application wich takes some lines and translate them with my application and then show translated result.

I know working with delphi pretty much.
but i just dont know how to do this and where to begin...

i thought i have to write my program as CGI or Apache but i dont know what to do with exe that is created from CGI or dlls from Apache...

where to put them and how to work with them.

these are what i know from my server:(supported)
linux,php,perl,apache,mysql...
and i use cPanel for working....

also there is an option for building ISAP(?)and like this can i use them too?

Thanx

DaveAtIFG

1:32 am on Nov 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Roozbeh, welcome to WebmasterWorld! :)

I suspect English is a second language for you. It's not clear to me from your post exactly what you want to do. I think we need to clarify that before we talk about how to do it.

It sounds as if you want to create a script to translate from one language to another. Is that correct? And you plan to write the script using Delphi?

From your post, it appears that you have a domain name and an account on an *nix/Apache based server that supports both PHP and Perl. Is this correct so far? :)

Roozbeh

9:20 am on Nov 26, 2003 (gmt 0)

10+ Year Member



:))
well yes english is my second language...sorry for bad writings :(

yes thats all correct...

although i have that program in exe..ie i just want to make some changes to it so it would work in my webpage...

and i know delphi can write webserver applications.
as far as i know delphi got these option for writeing webserver applications:
1.ISAPI/NSAPI Dynamic library
2.CGI stand alone executable
3.Apache 1.x/2.x shared module

but compiled output is exe or dll and i dont know how to use it or how to upload them or....

So?

Cheers
Roozbeh

bakedjake

3:35 pm on Nov 26, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Roozbeh, welcome to WebmasterWorld!

Delphi is a Windows application. There is a UNIX equivalent (called Kylix), but it doesn't sound like you're using it.

If your host is running Apache on a UNIX platform, you won't be able to develop compiled applications for it using Delphi. You might want to check out the other languages you named on your list above (perl, php, etc.) or look into Kylix.

If you host is running Apache on a Windows platform, you can indeed use Delphi to develop for it. Your best bet for writing the app and debugging it is to use a standalone CGI - it can be dropped in and replaced quickly. From there, you can look into developing a shared module, which is a bit harder.

trillianjedi

3:47 pm on Nov 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As per BakedJake's post.

Also worth bearing in mind that Kylix is cross-compatible with Delphi - both object pascal, but they have different implementations of the TSocket object that I suspect you're using (either original or descendant form).

I've done development on both, it's not always easy to cross-compile networking apps.

As BakedJake says, easiest thing would be to use a scripting language instead.

From what you've said so far, I would say .php would be your best bet.

TJ

Roozbeh

8:56 pm on Nov 26, 2003 (gmt 0)

10+ Year Member



Well....

thx guys but i know kylix too.
and i think i can also make .so files from delphi (i've done it but dont remember it now.

But imagine if it is running windows with apache.and i have created a .exe cgi standalone file what should i do with it?ie how can i use it on .html page?

(i change setting in my webserver by cPanel.)

bakedjake

9:09 pm on Nov 26, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



But imagine if it is running windows with apache.and i have created a .exe cgi standalone file what should i do with it? ie how can i use it on .html page?

Well, you'd just call it either directly or from another .html page using a form POST or GET method. The GET method is the type you generally see, that is, putting parameters over the line. POSTed variables are contained within the HTTP request sent from the browser to the server.

Let's use the GET method, as it is the easiest to deal with. You'd simply upload the program (to a CGI-BIN directory as configured by your cPanel app for Apache), and then call it via link or direct request like so:

[domain.com...]

Your Delphi app would handle the "dosomething" parameter by checking it's value, do something, and then output something. It could either output html (or other) content, or redirect somewhere else. Of course, you can have as many parameters and values that you want.

I haven't used Delphi in a long time, but I have to imagine that it has to have built in functions to handle CGI requests. You should read up on these functions and use them. These functions will do the hard part for you, such as getting the enviornment variables and parsing them for you so that they are easily available to you.