473,224 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Passing data from one site to another

Hi,

I run a few sites and I want to log in my main site database when/if there
is a problem, (like a page not found or an unknown agent).

But I don't want to give direct access to my database to the other sites, so
how could I safely pass data, (without passwords), from one site to another?

Thanks.
Simon
Jul 17 '05 #1
5 2933
i think i follow your question,

Something i am doing is i built a listener...
www.page12.com/errors.php (not a real url)

then in all my apps, i have an error class-- then i curl with a post
to errors.php.

i also use this for other stuff like tracking and all

Phil
Florent wrote:
Hi,

I run a few sites and I want to log in my main site database when/if there is a problem, (like a page not found or an unknown agent).

But I don't want to give direct access to my database to the other sites, so how could I safely pass data, (without passwords), from one site to another?
Thanks.
Simon


Jul 17 '05 #2
>i think i follow your question,

Something i am doing is i built a listener...
www.page12.com/errors.php (not a real url)

then in all my apps, i have an error class-- then i curl with a post
to errors.php.

i also use this for other stuff like tracking and all

Phil


No, What I mean was if site A wants to send data to site B.
I guess I could "www.B.com/msg.php?a=10"
but what I was really after is site A sending long information to B without
redirecting to A

Simon
Jul 17 '05 #3
NC

Florent wrote:

I run a few sites and I want to log in my main site
database* when/if there is a problem, (like a page not
found or an unknown agent).

But I don't want to give direct access to my database
to the* other sites, so how could I safely pass data,
(without passwords), from one *site to another? .... What I mean was if site A wants to send data to site B.
I guess I could "www.B.com/msg.php?a=10"
but what I was really after is site A sending long
information to B without redirecting to A


This is entirely possible, but will likely result in a
performance drag. If you are prepared to live with it,
here are a few recommendations.

The easiest thing to do would be to implement a report
generator of sorts on site A and have site B request
reports by name. Example:

Site B code:

readfile('http://www.siteB.com/report.php?id=status');

Site A code:

if (isset($_GET['id'])) {
$id = $_GET['id'];
} else {
die();
}
switch($id) {
case 'status':
$query = 'SELECT this FROM that ...';
break;
// many other cases here...
default:
die();
}
$result = mysql_query($query);
while ($record = mysql_fetch_array($result, MYSQL_NUM)) {
echo "<tr>\r\n";
foreach ($record as $field) {
echo "<td>$field</td>\r\n";
echo "</tr>\r\n";
}
}

In other words, site A would return fully-formatted HTML in
response to a request from site B. Alternatively, you can
return comma-separated or tab-delimited text and have it
formatted on site B.

A less secure alternative is to send actual queries from
site B to site A. The danger is that a hacker could send
a query which would destroy or modify your data. So if
you want to go this route, you will have to make sure that
the report generator script connects to the database as a
user with SELECT-only rights.

Finally, you can implement a Web service with a similar
functionality...

Cheers,
NC

Jul 17 '05 #4
> This is entirely possible, but will likely result in a
performance drag. If you are prepared to live with it,
here are a few recommendations.
Looking at your example I am not sure I understand where there would be a
performance lag.

The easiest thing to do would be to implement a report
generator of sorts on site A and have site B request
reports by name. Example:

Site B code:

readfile('http://www.siteB.com/report.php?id=status');
don't you mean 'www.siteA.com' rather?
Site B will request from SiteA...


In other words, site A would return fully-formatted HTML in
response to a request from site B. Alternatively, you can
return comma-separated or tab-delimited text and have it
formatted on site B.
Does it really have to be html, CS or TD text?
Can it not be any format I like? The reason I ask is that I could return
encrypted text of some sort to be certain that the data is 'fairly' safe.

A less secure alternative is to send actual queries from
site B to site A. The danger is that a hacker could send
a query which would destroy or modify your data. So if
you want to go this route, you will have to make sure that
the report generator script connects to the database as a
user with SELECT-only rights.
I don't think i wwill go down this road.

Finally, you can implement a Web service with a similar
functionality...
A biut of an overkill wouldn't it be?

Cheers,
NC


Many thanks,
Regards

Simon
Jul 17 '05 #5
NC
Florent wrote:

Looking at your example I am not sure I understand where
there would be a performance lag.
OK, if you allow site B direct access to site A's database
server, here's what going to happen:

1. Site B opens a TCP connection to site A's database
server.

That's it; a single step.

If you prefer to go through site A as an intermediary,
there's going to be an extra step involved:

1. Site B opens an HTTP connection to site A.
2. Site A opens a TCP or socket connection to its database
server.

Opening a connection takes time. In the first scenario,
only one connection needs to be opened. In the second
scenario, two connections need to be established.

NC> Site B code:
NC>
NC> readfile('http://www.siteB.com/report.php?id=status');
don't you mean 'www.siteA.com' rather?
Site B will request from SiteA...
Of course. My apologies for confusion.

NC> In other words, site A would return fully-formatted HTML in
NC> response to a request from site B. Alternatively, you can
NC> return comma-separated or tab-delimited text and have it
NC> formatted on site B.
Does it really have to be html, CS or TD text?


No, it can be anything you want. HTML or text were just the
most obvious and easiest to implement examples.

Cheers,
NC

Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
1
by: Kevin Lyons | last post by:
Hello, I am trying to get all of my form elements passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html to the following URL:...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
1
by: Russell | last post by:
Hi there, I'm currently creating a .NET Web Application and I have a question about passing values from one screen to another. I previously used Session variables in the code to store these...
1
by: Eric | last post by:
Hello, I am trying to come up with the best way to pass large amounts of data from page to page, namely a data table. The user needs to enter data into a form in one page and confirm it on...
4
by: Vasantha peddireddy | last post by:
I am posting a page to another page (form post). The data grid on the second page is being populated with data. Now, on page load of the second page, I would like to send the grid data on this page...
3
by: James Robertson | last post by:
I am new to the ASP and VB thing so be kind. Question I have is that I have created an ASPX web site to use as an E-Mail page. But I want to use this for a lot of users. Can I create the link on...
1
by: TheSailor | last post by:
Forgive me - I am a bit new to cURL and passing form elements from one site to the next... If you can help with a HOW TO or by holding my hand a bit with examples - so I can learn - I would be in...
3
by: DaTurk | last post by:
If I call this method, and pass it a byte by ref, and initialize another byte array, set the original equal to it, and then null the reference, why is the original byte array not null as well? I...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.