Re: [PHP] Passing data between the web to an Intranet

2003-04-01 Thread Randy
Thursday, March 27, 2003, 5:00:10 PM, you wrote:
 Sorry. What I mean is that we have an externally hosted website.
 Currently all the forms etc update tables in the web hosted mysql DB. I
 am in the process of building a small CRM system and want the data to
 drop into our non public domain Intranet server. Is this possible?

If you can configure your apache, you could set up your remote
web as a reverse proxy to a form on your local intranet. When
this is done, the only access to your local form would be from
the web host, not the user. To the user, it looks like they never
went anywhere else.

You would have something like:

ProxyPass /yourwebdirectory/ http://yourlocalsite/filloutdbform.html

Some info on it is here:
http://www.devshed.com/Server_Side/Administration/ApacheProxy/page1.html 


Best regards,
 Randy   


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Passing data between the web to an Intranet

2003-03-27 Thread Ernest E Vogelsinger
Here's some ideas how I'd go for something like that. I'd have some PHP on
the externally hosted website, and some PHP on the Intranet/CRM-DB server.

At 08:39 27.03.2003, Steve Jackson said:
[snip]
gathering tool. Basically what I'll need to set-up is some sort of
system which:
1) Validates user input from the web (php)

Should be done on the external website box.

2) Sends the information to the external website DB for future customer
login authentication (php mysqlupdate/insert)

Same thing here - PHP on the external box.

3) Sends the information to our internal website DB (Intranet server)
(email or replication?) 

A PHP form residing on the internal box to receive POSTed data from the
external box. The external box would use cURL to post aony content that
needs to go internal.

4) Flags our people here when a new prospect arrives (phpemail)
5) Full front end system for the prospect details etc (Intranet server).
(php/mysql)

Both internally, PHP intranet style.

Using this approach you have full control over what goes into the internal
DB; much better for this task IMHO than replicating a complete DB.

Of course you need to make sure that only the external webbox can post to
the Intranet server, the level of authorization depends on your security
considerations and the network layout. 

If the Intranet host only has a private IP (192.168.*, or 10.*) but can be
reached by the external box via secondary interface this aint really an
issue since it can't be reached from the outside. If the Intranet box
_could_ be reached from the outside I'd recommend to run the receiving form
on an SSL interface, the external box using a client certificate to
authenticate itself. AFAIK this can be done with cURL.

HTH,

-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Passing data between the web to an Intranet

2003-03-27 Thread Ernest E Vogelsinger
At 13:53 27.03.2003, Steve Jackson said:
[snip]
That would've been ideal.
However I asked our webhost and they want 2100+ Danish Marks (Dotserv -
tight ###! - needless to say it isn't going to happen) to configure
cURL within their PHP, can't do cron jobs either. 
[snip]

May I suggest switching ISP's - I'm offering you my server farm for half
this price ;-)

[snip]
They suggest I use wget to do the same thing, however the only way I can
think of to do that is display the submissions on a page and and somehow
parse that into SQL to insert it. Any ideas on how I can go about that?
[snip]

I have another idea - you could simply go the other way round, the intranet
box polls the external one by executing a special PHP script. This script
on the external server checks the IP (only your intranet host, rsp. the
gateway is allowed), and maybe some secret token passed to it. It then
responds by transmitting any content that needs to go into the intranet DB,
formatted in a way easy to parse by an intranet script (e.g. ini style, or
xml, whatever). On the intranet box have a cronjob running that polls once
per minute.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Jason Wong
On Wednesday 26 March 2003 15:28, Steve Jackson wrote:
 Has anyone ever simply tried to pass information direct from the web
 into a secure Intranet mysql DB rather than to a web DB?

Haven't the faintest idea what you mean by direct from the web and a secure 
Intranet mysql db and web DB. 

 I am thinking down one of three lines.
 1) I use PHP to send an email with the data in it and update our
 internal DB manually (the worst case)

Can be done pretty easily.

 2) I use PHP which takes data, sends it as an email, puts it into a form
 which then automatically updates our internal network (interesting idea
 but I have no clue if it can be done ;o)

Not sure what you mean here. How is it different from the above?

 3) I use some sort of synchronisation so every time the web DB is
 updated our internal one is also updated (ideal).

See mysql replication.

 I would welcome any other ideas or solutions. Does mysql have any
 replication or synchronisation functions? I am told Oracle has but
 haven't seen this or heard of this with mysql.

Did you actually do any research? I'm sure if you google for mysql 
replication or mysql synchronisation you would get thousands of hits.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Steve Jackson
 Haven't the faintest idea what you mean by direct from the 
 web and a secure 
 Intranet mysql db and web DB. 
 

Sorry. What I mean is that we have an externally hosted website.
Currently all the forms etc update tables in the web hosted mysql DB. I
am in the process of building a small CRM system and want the data to
drop into our non public domain Intranet server. Is this possible?

  I am thinking down one of three lines.
  1) I use PHP to send an email with the data in it and update our 
  internal DB manually (the worst case)
 
 Can be done pretty easily.
 

I know but I don't want to have to manually update data from emails to
our Intranet server.

  2) I use PHP which takes data, sends it as an email, puts it into a 
  form which then automatically updates our internal network 
  (interesting idea but I have no clue if it can be done ;o)
 
 Not sure what you mean here. How is it different from the above?
 

I was thinking that I may be able to *automatically* take the data from
emails and put them through a form (hosted internally) which would then
update our DB here. I just don't know whether it's possible to do or
where to start.

  3) I use some sort of synchronisation so every time the web DB is 
  updated our internal one is also updated (ideal).
 
 See mysql replication.
  I would welcome any other ideas or solutions. Does mysql have any 
  replication or synchronisation functions? I am told Oracle has but 
  haven't seen this or heard of this with mysql.
 
 Did you actually do any research? I'm sure if you google for mysql 
 replication or mysql synchronisation you would get 
 thousands of hits.

Yes I did but am not really understanding it which is why I asked here.
Sorry if that offends you.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Jason Wong
On Wednesday 26 March 2003 16:40, Steve Jackson wrote:

 Sorry. What I mean is that we have an externally hosted website.
 Currently all the forms etc update tables in the web hosted mysql DB. I
 am in the process of building a small CRM system and want the data to
 drop into our non public domain Intranet server. Is this possible?

OK. Yes, some of the possible solutions are as below:

   I am thinking down one of three lines.
   1) I use PHP to send an email with the data in it and update our
   internal DB manually (the worst case)
 
  Can be done pretty easily.

 I know but I don't want to have to manually update data from emails to
 our Intranet server.

Manually? What I meant was that it's pretty easy to send an email to a server 
and have a script process the email. Thus the script will parse the contents 
of the mail and update the db accordingly. Search the archives for process 
mail, I have some old posts which outline how this can be done.

   2) I use PHP which takes data, sends it as an email, puts it into a
   form which then automatically updates our internal network
   (interesting idea but I have no clue if it can be done ;o)
 
  Not sure what you mean here. How is it different from the above?

 I was thinking that I may be able to *automatically* take the data from
 emails and put them through a form (hosted internally) which would then
 update our DB here. I just don't know whether it's possible to do or
 where to start.

See above.

   3) I use some sort of synchronisation so every time the web DB is
   updated our internal one is also updated (ideal).
 
  See mysql replication.
 
   I would welcome any other ideas or solutions. Does mysql have any
   replication or synchronisation functions? I am told Oracle has but
   haven't seen this or heard of this with mysql.
 
  Did you actually do any research? I'm sure if you google for mysql
  replication or mysql synchronisation you would get
  thousands of hits.

 Yes I did but am not really understanding it which is why I asked here.
 Sorry if that offends you.

With all due respect that is not what you asked. In any case for help on 
mysql's replication feature you should ask on the mysql list.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
does your DRESSING ROOM have enough ASPARAGUS?
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread skate
as another solution (and not knowing mysql replication myself, so can't
comment on this) you could connect remotely to your MySQL database that is
on your intranet, and dump the data straight into it. it really depends how
open to the world that system is, or can be, and how security concious you
are.

or you could have some kinda XML output or DB dump from the online website
available, and have your local CRM machine access that every 5 minutes or
less...

just 2 other solutions, maybe not the best, but they'd do the job...


- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 10:53 AM
Subject: Re: [PHP] Passing data between the web to an Intranet


 On Wednesday 26 March 2003 16:40, Steve Jackson wrote:

  Sorry. What I mean is that we have an externally hosted website.
  Currently all the forms etc update tables in the web hosted mysql DB. I
  am in the process of building a small CRM system and want the data to
  drop into our non public domain Intranet server. Is this possible?

 OK. Yes, some of the possible solutions are as below:

I am thinking down one of three lines.
1) I use PHP to send an email with the data in it and update our
internal DB manually (the worst case)
  
   Can be done pretty easily.
 
  I know but I don't want to have to manually update data from emails to
  our Intranet server.

 Manually? What I meant was that it's pretty easy to send an email to a
server
 and have a script process the email. Thus the script will parse the
contents
 of the mail and update the db accordingly. Search the archives for
process
 mail, I have some old posts which outline how this can be done.

2) I use PHP which takes data, sends it as an email, puts it into a
form which then automatically updates our internal network
(interesting idea but I have no clue if it can be done ;o)
  
   Not sure what you mean here. How is it different from the above?
 
  I was thinking that I may be able to *automatically* take the data from
  emails and put them through a form (hosted internally) which would then
  update our DB here. I just don't know whether it's possible to do or
  where to start.

 See above.

3) I use some sort of synchronisation so every time the web DB is
updated our internal one is also updated (ideal).
  
   See mysql replication.
  
I would welcome any other ideas or solutions. Does mysql have any
replication or synchronisation functions? I am told Oracle has but
haven't seen this or heard of this with mysql.
  
   Did you actually do any research? I'm sure if you google for mysql
   replication or mysql synchronisation you would get
   thousands of hits.
 
  Yes I did but am not really understanding it which is why I asked here.
  Sorry if that offends you.

 With all due respect that is not what you asked. In any case for help on
 mysql's replication feature you should ask on the mysql list.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 does your DRESSING ROOM have enough ASPARAGUS?
 */


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Steve Jackson
 Manually? What I meant was that it's pretty easy to send an 
 email to a server 
 and have a script process the email. Thus the script will 
 parse the contents 
 of the mail and update the db accordingly. Search the 
 archives for process 
 mail, I have some old posts which outline how this can be done.

Hi,

After much searching I found this
http://marc.theaimsgroup.com/?l=php-generalm=104210703824057w=2
This
http://marc.theaimsgroup.com/?l=php-generalm=104219587732145w=2

And others with process in the body and subject line but not any of the
thread you refer to.
Don't suppose you could regurgitate it could you?
I must have trawled through about 1 messages. I was back to Nov
2001!
The above two links don't really help me that much, I just need the
process explained so I know I'm on the right track.
Cheers, 

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Ray Hunter
your best bet might be to use xml (soap) or to do mysql replication.

http://www.mysql.com/doc/en/Replication_HOWTO.html

Now if you have a web db saying that the db is used for web access only
and then you have an internal (intranet) db, i am supposing that it is
behind some firewall.  If not then I suggest that one is set up! You can
create an ssh tunnel and have all replicated data go from the web db to
the intranet db.  This would be the fastest way to populate the data.

If you do not want to use the network for transmitting data and if the 2
machines are physically close by you can use a serial connect to
transmit the database.

HTH

--
Ray


On Wed, 2003-03-26 at 01:40, Steve Jackson wrote:
  Haven't the faintest idea what you mean by direct from the 
  web and a secure 
  Intranet mysql db and web DB. 
  
 
 Sorry. What I mean is that we have an externally hosted website.
 Currently all the forms etc update tables in the web hosted mysql DB. I
 am in the process of building a small CRM system and want the data to
 drop into our non public domain Intranet server. Is this possible?
 
   I am thinking down one of three lines.
   1) I use PHP to send an email with the data in it and update our 
   internal DB manually (the worst case)
  
  Can be done pretty easily.
  
 
 I know but I don't want to have to manually update data from emails to
 our Intranet server.
 
   2) I use PHP which takes data, sends it as an email, puts it into a 
   form which then automatically updates our internal network 
   (interesting idea but I have no clue if it can be done ;o)
  
  Not sure what you mean here. How is it different from the above?
  
 
 I was thinking that I may be able to *automatically* take the data from
 emails and put them through a form (hosted internally) which would then
 update our DB here. I just don't know whether it's possible to do or
 where to start.
 
   3) I use some sort of synchronisation so every time the web DB is 
   updated our internal one is also updated (ideal).
  
  See mysql replication.
   I would welcome any other ideas or solutions. Does mysql have any 
   replication or synchronisation functions? I am told Oracle has but 
   haven't seen this or heard of this with mysql.
  
  Did you actually do any research? I'm sure if you google for mysql 
  replication or mysql synchronisation you would get 
  thousands of hits.
 
 Yes I did but am not really understanding it which is why I asked here.
 Sorry if that offends you.
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Jason Wong
On Wednesday 26 March 2003 22:31, Steve Jackson wrote:

 After much searching I found this
 http://marc.theaimsgroup.com/?l=php-generalm=104210703824057w=2
 This
 http://marc.theaimsgroup.com/?l=php-generalm=104219587732145w=2

 And others with process in the body and subject line but not any of the
 thread you refer to.

OK, the latter thread explains pretty much what you need to do if you're using 
sendmail as your MTA. But no matter what MTA you're using, the PHP script is 
going to be more or less the same:


1) read in the email through STDIN
2) parse it
3) do whatever you need with the data


How you invoke this script depends on what MTA you use. For example with qmail 
you just create a dot-qmail file with the following line:

| /path/to/your/script.php

Similar mechanisms exists for courier-mta and postfix.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The revolution will not be televised.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Steve Jackson
Thanks to those that have helped thus far.
To clarify what we need:

Our CRM system (really a prospect gathering system) needs to internally
hosted, be realtime and needs to be updated automatically. Our website
(hosted externally) is *one of many* tools which we are going to use to
gather information from prospects via subscription forms and our
shopping cart. Our internal system will hold much more detailed
information about our prospects and will be updated every time we deal
with the prospect whether that be by phone, mail, email etc. From the
web we will simply get information such as email address, name, company
name, telephone and country via a form.

The idea is that if someone wants to subscribe via the web they are in
effect a prospect for our company because they are interested in our
products. 

So our internal DB will have lots of information about each prospect and
be updated frequently whereas the web form is a small information
gathering tool. Basically what I'll need to set-up is some sort of
system which:
1) Validates user input from the web (php)
2) Sends the information to the external website DB for future customer
login authentication (php mysqlupdate/insert)
3) Sends the information to our internal website DB (Intranet server)
(email or replication?) 
4) Flags our people here when a new prospect arrives (phpemail)
5) Full front end system for the prospect details etc (Intranet server).
(php/mysql)

The MySQL replication documentation is for someone experienced with
MySQL and understands the replication concept fully. This is the first
time I have even looked at it and I'm a bit unclear. For instance I
would assume that my Master DB would be my Internal server but it's just
that, an assumption. Also how would I go about configuring an externally
hosted web db to be it's slave? Would I need the sysadmin of our web
host company to do it? Looking at the documentation it appears that the
two databases need to have exactly the same data structure (I think) if
they are to be reproduced so if I have 30 fields on my intranet DB for
prospects and only five on my externally hosted web DB would replication
even be an option? Or is it simply the individual fields which need to
be the same?

The only part I have a problem with is number 3. Jason Wong has
suggested one solution which I can probably get working in a few days
when I get more information on how STDIN works but suggestions have been
that I should look at replication as more robust and efficient. What
(based on what I have told you) would you do?

Any help much appreciated.

 
 RTFM: 
 http://www.mysql.com/documentation/mysql/bychapter/manual_MySQ
 L_Database_Administration.html#Replication
 
 This really seems to be what you need. Any php-level solution 
 is going to be kludgy and slow by comparison and prone to 
 problems. Go with the tested, production code. It sounds like 
 you may also have a gray area in your requirements that you 
 should clarify. How current does the internal db need to be? 
 Is a once-a-day replication ok for crm applications or does 
 it need to be in real-time? Clarifying this point can 
 really help you out in terms of what your solution needs to be.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php