By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,727 Members | 1,151 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,727 IT Pros & Developers. It's quick & easy.

Running PHP from a remote server

P: n/a
My ISP provides me with 2 servers: one for normal web hosting
(non-PHP) and a CGI server (with PHP). I create my website using
fusion 7 and upload this in its entirity to the web hosting server. If
I want to run CGI scripts, I can do so with an external link to a page
on the CGI server. The problem however is that I have to maintain two
sites and all associated links.

Ideally, I'd like everything to be in one place, but I'm not allowed
to upload my entire site to the CGI server. Alternatively then, is
there a way of calling PHP scripts on the CGI server from a non-CGI
server, without resorting to a clickable link. I can include HTML such
as <A HREF="http://cgiserver/......>php script link<A>, however this
requires the user to click on some text to run my script. I'd like to
run the script from the remote server without them clicking.
Aug 31 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a

Troy wrote (in part):

Ideally, I'd like everything to be in one place, but I'm not allowed
to upload my entire site to the CGI server. Alternatively then, is
there a way of calling PHP scripts on the CGI server from a non-CGI
server, without resorting to a clickable link. I can include HTML such
as <A HREF="http://cgiserver/......>php script link<A>, however this
requires the user to click on some text to run my script. I'd like to
run the script from the remote server without them clicking.


Get your code off of your ISP onto a real hosting site. That is no way
to do hosting.

Ken

Aug 31 '05 #2

P: n/a
Ken,

You're probably right....I'm just at the outset of trying to learn
about all this server side scripting at the moment, and not to sure
what is and isn't best practice - so don't feel too confident about my
ability to choose a 'good' host. Would I be right in saying that my
ISP's practice of separate web & CGI servers isn't normal, 'cos it's a
pain in the but having to separate out the cgi and non-cgi pages?

Troy.
On 31 Aug 2005 06:37:09 -0700, "Ken Robinson" <ke******@rbnsn.com>
wrote:

Troy wrote (in part):

Ideally, I'd like everything to be in one place, but I'm not allowed
to upload my entire site to the CGI server. Alternatively then, is
there a way of calling PHP scripts on the CGI server from a non-CGI
server, without resorting to a clickable link. I can include HTML such
as <A HREF="http://cgiserver/......>php script link<A>, however this
requires the user to click on some text to run my script. I'd like to
run the script from the remote server without them clicking.


Get your code off of your ISP onto a real hosting site. That is no way
to do hosting.

Ken

Aug 31 '05 #3

P: n/a
"Troy" <tr**@nospam.com> kirjoitti
viestissä:gk********************************@4ax.c om...
My ISP provides me with 2 servers: one for normal web hosting
(non-PHP) and a CGI server (with PHP). I create my website using
fusion 7 and upload this in its entirity to the web hosting server. If
I want to run CGI scripts, I can do so with an external link to a page
on the CGI server. The problem however is that I have to maintain two
sites and all associated links.

Ideally, I'd like everything to be in one place, but I'm not allowed
to upload my entire site to the CGI server. Alternatively then, is
there a way of calling PHP scripts on the CGI server from a non-CGI
server, without resorting to a clickable link. I can include HTML such
as <A HREF="http://cgiserver/......>php script link<A>, however this
requires the user to click on some text to run my script. I'd like to
run the script from the remote server without them clicking.


how about
<script type="text/javascript"
src="http://www.urltotheother.site/cgi/mythingy.php"></script>

or alternatively call it as a src for an image.

<img src="http://www.urltotheother.site/cgi/mythingy.php"
style="display:none;">

Or yet another one: make it an iframe.

<iframe src="http://www.urltotheother.site/cgi/mythingy.php"
style="display:none;"></iframe>

That'll fool the browser to think it needs to fetch some content from the
other site. Thus we have successfully disguised a script to be run as an
image or a script or just another page.

IMHO, the iframe solution would be the best, cos that's not even fooling the
browser. And you can be quite sure that content isn't cahced in that case...
If I were you, I'd use the iframe. Just make it small enough, like on pixel
wide and heigh, hide it in every possible way using css, and that's it! It
gets fetched every time but is invisible to the user...

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Kimmo Laine <et****************@5P4Mgmail.com>
Aug 31 '05 #4

P: n/a
Many thanks Kimmo, your HTML is better than mine, I'll try out those
suggestions and post back.

On Wed, 31 Aug 2005 21:05:34 +0300, "Kimmo Laine"
<et*******************@Mgmail.com> wrote:
"Troy" <tr**@nospam.com> kirjoitti
viestissä:gk********************************@4ax. com...
My ISP provides me with 2 servers: one for normal web hosting
(non-PHP) and a CGI server (with PHP). I create my website using
fusion 7 and upload this in its entirity to the web hosting server. If
I want to run CGI scripts, I can do so with an external link to a page
on the CGI server. The problem however is that I have to maintain two
sites and all associated links.

Ideally, I'd like everything to be in one place, but I'm not allowed
to upload my entire site to the CGI server. Alternatively then, is
there a way of calling PHP scripts on the CGI server from a non-CGI
server, without resorting to a clickable link. I can include HTML such
as <A HREF="http://cgiserver/......>php script link<A>, however this
requires the user to click on some text to run my script. I'd like to
run the script from the remote server without them clicking.


how about
<script type="text/javascript"
src="http://www.urltotheother.site/cgi/mythingy.php"></script>

or alternatively call it as a src for an image.

<img src="http://www.urltotheother.site/cgi/mythingy.php"
style="display:none;">

Or yet another one: make it an iframe.

<iframe src="http://www.urltotheother.site/cgi/mythingy.php"
style="display:none;"></iframe>

That'll fool the browser to think it needs to fetch some content from the
other site. Thus we have successfully disguised a script to be run as an
image or a script or just another page.

IMHO, the iframe solution would be the best, cos that's not even fooling the
browser. And you can be quite sure that content isn't cahced in that case...
If I were you, I'd use the iframe. Just make it small enough, like on pixel
wide and heigh, hide it in every possible way using css, and that's it! It
gets fetched every time but is invisible to the user...

Aug 31 '05 #5

P: n/a
Troy wrote:
My ISP provides me with 2 servers: one for normal web hosting
(non-PHP) and a CGI server (with PHP). I create my website using
fusion 7 and upload this in its entirity to the web hosting server. If
I want to run CGI scripts, I can do so with an external link to a page
on the CGI server. The problem however is that I have to maintain two
sites and all associated links.

Ideally, I'd like everything to be in one place, but I'm not allowed
to upload my entire site to the CGI server. Alternatively then, is
there a way of calling PHP scripts on the CGI server from a non-CGI
server, without resorting to a clickable link. I can include HTML such
as <A HREF="http://cgiserver/......>php script link<A>, however this
requires the user to click on some text to run my script. I'd like to
run the script from the remote server without them clicking.


Troy,

Ken's right. Get another host. There are a lot of inexpensive options
available. You should be easily be able to find something for < $50/yr, or even
1/2 that if your requirements are minimal.

Check out www.webhostingtalk.com for discussions about various hosting companies.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Aug 31 '05 #6

P: n/a
1and1.com is great. Developer package is $20/month it includes (IIRC)
4 gb hosting, 50 (not sure) GB bandwidth/month, php, mysql (3
databases, each up to 100 mb), 5 included domains, 200 (i THINK)
subdomains, and each additional domain is only 5.99/yr.

unbelievable deal IMO

Sep 1 '05 #7

P: n/a
IW****@gmail.com wrote:
1and1.com is great. Developer package is $20/month it includes (IIRC)
4 gb hosting, 50 (not sure) GB bandwidth/month, php, mysql (3
databases, each up to 100 mb), 5 included domains, 200 (i THINK)
subdomains, and each additional domain is only 5.99/yr.

unbelievable deal IMO


Hmmm, that's a bit expensive. I have a full VPS for $20/mo. It's only 3GB disk
and 20GB bandwidth - but that's more than I need. And no limit on the number
of domains, etc. - because I control it all.

Shared hosting with MySQL and PHP can be found for under $3/mo (less if you pay
by the year) if you don't require a lot of bandwidth and space. And you can
move up as your needs increase.

But some of these are good, some not so good. That's why I recommended
webhostingtalk.com.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 1 '05 #8

P: n/a
Kimmo Laine wrote:
how about
<script type="text/javascript"
src="http://www.urltotheother.site/cgi/mythingy.php"></script>
Which will be ignored by people with Javascript disabled. (5%-15% of
people, depending on who you ask.)
or alternatively call it as a src for an image.
<img src="http://www.urltotheother.site/cgi/mythingy.php"
style="display:none;">


Which is invalid HTML.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Sep 3 '05 #9

P: n/a
"Toby Inkster" <us**********@tobyinkster.co.uk> kirjoitti
viestissä:bf************@ophelia.g5n.co.uk...
Kimmo Laine wrote:
how about
<script type="text/javascript"
src="http://www.urltotheother.site/cgi/mythingy.php"></script>


Which will be ignored by people with Javascript disabled. (5%-15% of
people, depending on who you ask.)


That's true.
or alternatively call it as a src for an image.
<img src="http://www.urltotheother.site/cgi/mythingy.php"
style="display:none;">


Which is invalid HTML.


Invalid how? Please explain, I see nothing wrong in that. Missing some
attributes? Okay, alt is required... Anything else? Also, you forgot to
mention that this is ignored by people who have images turned of. Which is
altogether why I encouraged to use iframe...

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Kimmo Laine <et****************@5P4Mgmail.com>
Sep 3 '05 #10

P: n/a
Kimmo Laine wrote:
[Toby Inkster wrote:]
Kimmo Laine wrote:
<img src="http://www.urltotheother.site/cgi/mythingy.php"
style="display:none;">

Which is invalid HTML.


Invalid how? Please explain, I see nothing wrong in that.


Validity, in its technical sense, is a dichotomy: it's either Valid
or Invalid. If it conforms to the DTD it purports to, it's Valid;
otherwise it's Invalid. There's no middle ground.

Conformance to the specification, however, is another matter. If a
document is Invalid, it can't conform to the spec. If it's Valid,
you can find yourself in a grey area, because a document can be Valid
without conforming to your, or anyone else's, interpretation of the
prose of the spec.

The upshot is, rightness and wrongness weren't in question and have
no bearing on Validity.

--
Jock
Sep 3 '05 #11

P: n/a
Kimmo Laine wrote:
Invalid how? Please explain, I see nothing wrong in that.
Missing some attributes? Okay, alt is required... Anything else?
After you realised that "alt" is required, why didn't you go back and
delete the preceding line?

Yes, that is how it was invalid.
Also, you forgot to mention that this is ignored by people who have
images turned of.
I didn't forget. I thought about it, but decided against mentioning it as
the number of such people is rather low, compared with the number of
people with no Javascript.
Which is altogether why I encouraged to use iframe...


If we're going to continue the "some browsers don't support that" and
"other browsers do support it but allow it to be disabled" line of
reasoning, that ain't ideal either, but it's the best of the three.

Probably the best solution would be to simply redirect to the PHP page in
question. The preferred method of doing this would be to send an
appropriate HTTP 3xx response, but given the problem at hand, I think
this would not be viable on this entirely static server.

So I'd suggest a timed (about 5 to 10 seconds) <meta> refresh; combined
with a Javascript redirect for the odd esoteric browser that doesn't
support that particular non-standard, but widely supported HTTP extension;
and finished off with a "you will be redirected in a few seconds, but if
it doesn't work, please manually follow this link to my <a
href='foo'>dynamic server</a>" message for good measure.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Sep 3 '05 #12

P: n/a
"Toby Inkster" <us**********@tobyinkster.co.uk> kirjoitti
viestissä:9a************@ophelia.g5n.co.uk...
Kimmo Laine wrote:
Invalid how? Please explain, I see nothing wrong in that.
Missing some attributes? Okay, alt is required... Anything else?
After you realised that "alt" is required, why didn't you go back and
delete the preceding line?


Well I didn't think you were actually that anal...
Yes, that is how it was invalid.


Okay. Splitting hair is fun.
Also, you forgot to mention that this is ignored by people who have
images turned of.


I didn't forget. I thought about it, but decided against mentioning it as
the number of such people is rather low, compared with the number of
people with no Javascript.
Which is altogether why I encouraged to use iframe...


If we're going to continue the "some browsers don't support that" and
"other browsers do support it but allow it to be disabled" line of
reasoning, that ain't ideal either, but it's the best of the three.

Probably the best solution would be to simply redirect to the PHP page in
question. The preferred method of doing this would be to send an
appropriate HTTP 3xx response, but given the problem at hand, I think
this would not be viable on this entirely static server.

So I'd suggest a timed (about 5 to 10 seconds) <meta> refresh; combined
with a Javascript redirect for the odd esoteric browser that doesn't
support that particular non-standard, but widely supported HTTP extension;
and finished off with a "you will be redirected in a few seconds, but if
it doesn't work, please manually follow this link to my <a
href='foo'>dynamic server</a>" message for good measure.


Yah. That would be the ultimate solution, other than switching to a less
crappy server. (which has been recommended also)

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Kimmo Laine <et****************@5P4Mgmail.com>
Sep 3 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.