Forum Topic: Running Scripts from another Place

(131 views • 6 replies)

This topic is 1 page long.

<< < > >>
None

066pop

Reply To Post Reply & Quote

Posted at: 3/26/09 01:06 PM

066pop EVIL LEVEL 12

Sign-Up: 10/23/08

Posts: 1,044

I was recently trying to run a script from my web host, on an old one of mine to see if I could do something for my friend.

I was trying to run a simple "echo 'this is working';" from a php file on this other website. Just to prove it would work... I tried but failed.

So far I have come accross this thing that said I could get it using this:

<script type="text/javascript" src="http://www.somewhere.com/Script.php"></script>

And in the php file I would also put this (cos I thinks it going to be javascript):

Header("content-type: application/x-javascript");

But none of this has worked so far.
AND my googleing hasnt gotten an answer yet... =(

Is there like an include thing? This other webhost (a free one) doent let you use PHP though, so it would have to be something in the HTML page, javascript or something...

Wagons: #1

BBS Signature

None

Jon-86

Reply To Post Reply & Quote

Posted at: 3/26/09 03:06 PM

Jon-86 NEUTRAL LEVEL 13

Sign-Up: 01/30/07

Posts: 3,858

You cant include a PHP file that is sitting on another host. Otherwise people would just include the config files from other sites and steal passwords. If you want a free webhost that has PHP and even database support then get a free account on Awardspace or one of the many others that have been suggested here.

Search this forum for webhost topics!

PHP Main :: C++ Main :: Java Main :: irc.freenode.net

BBS Signature

None

GustTheASGuy

Reply To Post Reply & Quote

Posted at: 3/26/09 03:34 PM

GustTheASGuy LIGHT LEVEL 08

Sign-Up: 11/02/05

Posts: 11,324

At 3/26/09 03:06 PM, Jon-86 wrote: Search this forum for webhost topics!

Nono man, you don't *get* it.
He wants to load a PHP script into a page that would then write 'this is working' to it, because his other site doesn't support it. Except, as you know, you can only run Javascript clientside, so you have to tag the loaded script as JS. Then, so the PHP file would be *really* sure it is actually Javascript, you need that 'Header' call there.
So then, he is trying to run either a raw PHP script or the string 'this is working' clientside, neither of which is fucking Javascript.

Just... leave him alone, you know? 8D

#ngprogramming at irc.freenode.net
haXe | Keel imperative | Spyro! | Thru you


None

Jon-86

Reply To Post Reply & Quote

Posted at: 3/26/09 04:20 PM

Jon-86 NEUTRAL LEVEL 13

Sign-Up: 01/30/07

Posts: 3,858

Its better to inform than misinform

Running Scripts from another Place

PHP Main :: C++ Main :: Java Main :: irc.freenode.net

BBS Signature

None

066pop

Reply To Post Reply & Quote

Posted at: 3/27/09 02:13 AM

066pop EVIL LEVEL 12

Sign-Up: 10/23/08

Posts: 1,044

...

Ok? No one gets where I am coming from... I want to run this script on the other server, then send the results to this free one (because it cant do the php, but the other one can). But I don't know how to it...

None of my attempts are working...

You know its a bit like when you put an image on somesite.com from anothesite.net:

Welcome to sometime.com!
<img src='anothersite.net/StealAnImage.jpg'>

Wagons: #1

BBS Signature

None

WoogieNoogie

Reply To Post Reply & Quote

Posted at: 3/27/09 04:03 AM

WoogieNoogie LIGHT LEVEL 14

Sign-Up: 06/26/05

Posts: 3,284

Let me see if I've got this...

You have site a. Site a can run PHP. You have site b. Site b can't.

You want to run something on site a, then be able to let site b know it's working through Javascript.

IF that's what you're looking for...that is IF, I'm still a bit confused...you could use site a to create/edit a Javascript file through PHP, then have site b run that Javascript file.


None

yhar

Reply To Post Reply & Quote

Posted at: 3/27/09 07:49 AM

yhar NEUTRAL LEVEL 03

Sign-Up: 04/02/08

Posts: 1,774

I've got what he wants:

I think so anyway

The same way you would embed an image, he wants to embed a php file. So, like, <php ("http://othersite.com/file.php"); php> and it would embed the file, with the output being shown, however it actually ran on the other server.

This is possible using JS (Take a look at how google adsense works). The best way would be to have PHP write the results to the js file and display that.

THIS IS CITRICSQUID POSTING


All times are Eastern Standard Time (GMT -5) | Current Time: 11:21 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!