calculations in C, userinterface in PHP

E

Erik

I was thinking about building a Web utility with a tried-and-tested
(15 years) C-module.

I was thinking of generating an input-web-page with PHP, which would
send back data to the server (FORM-stuff), where a C-routine would do
the complex calculations, and give output back to the user, again via
a PHP routine.

is this feasible ?
practical ?
smart ?

frgr
Erik
 
C

CountScubula

Erik said:
I was thinking about building a Web utility with a tried-and-tested
(15 years) C-module.

I was thinking of generating an input-web-page with PHP, which would
send back data to the server (FORM-stuff), where a C-routine would do
the complex calculations, and give output back to the user, again via
a PHP routine.

is this feasible ?
practical ?
smart ?

frgr
Erik

Feasable, yes.

Smart? Well, do what is faster (to implement), easier, less expensive.
Practical? If you can make it happen go for it.

If you only have a few visitors (few thousand) don't worry about it, go for
it any way that you can make it happen.
 
D

Default User

Erik said:
I was thinking about building a Web utility with a tried-and-tested
(15 years) C-module.

I was thinking of generating an input-web-page with PHP, which would
send back data to the server (FORM-stuff), where a C-routine would do
the complex calculations, and give output back to the user, again via
a PHP routine.


This is not a C question. Could those who reply in comp.lang.php please
remove the crosspost to clc?



Brian Rodenborn
 
C

CBFalconer

Erik said:
I was thinking about building a Web utility with a tried-and-tested
(15 years) C-module.

I was thinking of generating an input-web-page with PHP, which
would send back data to the server (FORM-stuff), where a C-routine
would do the complex calculations, and give output back to the
user, again via a PHP routine.

is this feasible ?
practical ?
smart ?
on-topic for c.l.c?

In order: maybe, maybe, see 1, no.
 
E

Erik

This is not a C question. Could those who reply in comp.lang.php please
remove the crosspost to clc?



Brian Rodenborn

In my opinion, it is a question that crosses the blurred boundaries
between C, PHP, HTML and even MySQL.

That is exactly the reason I cross-posted.
There is no newsgroup comp.languages.php.c.mysql.html, thank The Lord.

At least two C-aspects of the question come to mind:

- maybe I need to work on the C-side interface, to make the connection
to PHP.
- How would the data-interfacing structures have to look...

Maybe the answers will learn me, that I need not do anything to the
C-code. But only that **answer** would make this a non-C question and
therefor off-topic. The **question** is not.

A bit philosophical maybe, and yes: philosophy IS off-topic :)

friendly greetings

Erik
 
M

Mark McIntyre

At least two C-aspects of the question come to mind:

- maybe I need to work on the C-side interface, to make the connection
to PHP.

This is impossible in C.
- How would the data-interfacing structures have to look...

Thats also impossible to say.

The point is, C doesn't have an interface to PHP. If you want to
interface to PHP or mysql or whtever, you need to use nonstandard
extensions to C, which are not discussed in this group.
 
E

Erik

This is impossible in C.


Thats also impossible to say.

The point is, C doesn't have an interface to PHP. If you want to
interface to PHP or mysql or whtever, you need to use nonstandard
extensions to C, which are not discussed in this group.

forgive me to contradict you:

As I said, I cross-posted to the PHP people, and they gave me some doc
links, that tell me in rather great detail how to do it.

As I once interfaced these same routines to Prolog, many years ago, I
suspected it could be done to PHP also. and I appear to be right.

In my opinion (which is now confirmed again) C-code can be interface
to just about anything.
The How-question is another matter: not at all easy sometimes.

As to "which are not discussed in this group":
This is weird:
My question is about connecting C-code with PHP-code.
If clc says it's off topic, logically the php groups should say so
too.
Result would be that my question cannot have a place on Usenet. Which
again is contrary to the Usenet idea, for it's not feasible to make a
C-and-PHP group.
Number of groups would quickly become astronomical.

(think of: "alt.dog-breeding" , "alt.paris" and
"alt.dog-breeding.paris" ... hey come on !!)

As it is a question about C AND/OR PHP, cross-posting seems to be a
most logical thing to do **in this case**.

The answers would in both groups be limited to the appropriate "side"
of the question, I would expect.

Please feel free to disagree ;-)

friendly greetings,

Erik
 
?

=?iso-8859-1?q?Jos=E9_de_Paula?=

Em Fri, 06 Feb 2004 19:44:54 +0100, Erik escreveu:
I was thinking about building a Web utility with a tried-and-tested
(15 years) C-module.

I was thinking of generating an input-web-page with PHP, which would
send back data to the server (FORM-stuff), where a C-routine would do
the complex calculations, and give output back to the user, again via
a PHP routine.

is this feasible ? Yes
practical ? Yes
smart ?
Dunno

Perhaps what you want is to write a C CGI frontend to your module (if you
can't make itself a CGI app), and use the PHP to create a page that has a
<form action="your-c-frontend.cgi">. The PHP output would be a little
harder to do, but still possible.
 
D

Default User

Erik said:
In my opinion, it is a question that crosses the blurred boundaries
between C, PHP, HTML and even MySQL.

Sorry, but you are incorrect. The newsgroup comp.lang.c deals only with
ISO standard C, not interfaces to other languages (because C has no
defined capabilities for that).

- maybe I need to work on the C-side interface, to make the connection
to PHP.

If you uncover a C problem to solve, AND it is one that can be
accomplished in standard C, then and only then should it be brougt up
here. There are no PHP interface facilities, so anything along these
lines comes first from the PHP solution, so that's where your initial
question belongs.
- How would the data-interfacing structures have to look...

PHP question, not a C question.
Maybe the answers will learn me, that I need not do anything to the
C-code. But only that **answer** would make this a non-C question and
therefor off-topic. The **question** is not.

A bit philosophical maybe, and yes: philosophy IS off-topic :)

Nope. You have to start with PHP, not with C.



Brian Rodenborn
 
A

Alan Balmer

forgive me to contradict you:

As I said, I cross-posted to the PHP people, and they gave me some doc
links, that tell me in rather great detail how to do it.
Contradict all you like - the C standard says nothing about interfaces
to PHP. That is not to say that it can't be done, only that it
requires nonstandard extension, as Mark said.

As to "which are not discussed in this group":
This is weird:
My question is about connecting C-code with PHP-code.
If clc says it's off topic, logically the php groups should say so
too.

Why? The php groups can have their own definition of topicality. This
group restricts its topic to standard C, which you would know if you
spent a reasonable amount of time reading the group before posting to
it.
Result would be that my question cannot have a place on Usenet. Which
again is contrary to the Usenet idea, for it's not feasible to make a
C-and-PHP group.
Number of groups would quickly become astronomical.

That's why there are more general groups, such as comp.programming.
(think of: "alt.dog-breeding" , "alt.paris" and
"alt.dog-breeding.paris" ... hey come on !!)

As it is a question about C AND/OR PHP, cross-posting seems to be a
most logical thing to do **in this case**.

The answers would in both groups be limited to the appropriate "side"
of the question, I would expect.

You didn't present any "appropriate side" of your question. If you
want to present the C code you are using and have questions about that
code, please do.
 
E

Erik

Nope. You have to start with PHP, not with C.

That is an answer which points me in the right direction or a
worthwhile direction, anyway.
and an answer that can only come from C-people...

Thanks for the enlightenment
 
E

Erik

Contradict all you like - the C standard says nothing about interfaces
to PHP. That is not to say that it can't be done, only that it
requires nonstandard extension, as Mark said.

No need to bark.

Many of the questions in this group are about home-built, non-standard
C-extensions...
Why? The php groups can have their own definition of topicality. This
group restricts its topic to standard C, which you would know if you
spent a reasonable amount of time reading the group before posting to
it.

My conclusion, sofar, is, that I will have to alter my C-code somewhat
and write some in-Standard-C interface-structures to get my data in...

That's why there are more general groups, such as comp.programming.


is like jumping into the ocean, instead of a bathtub....

You didn't present any "appropriate side" of your question. If you
want to present the C code you are using and have questions about that
code, please do.

There are even TWO appropriate sides to my question...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,139
Messages
2,570,805
Members
47,355
Latest member
MavoraTech

Latest Threads

Top