NameSilo

Blogger Workarounds?

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

user-7256

VIP Member
Impact
111
Hey all,

Is there anyway to use a PHP script on a blogger page?

Don't try to convince me to not use Blogger. I will not appreciate it and will leave negative rep. I'm sick of people trying to press their point when it is off-topic.

Maybe if I used a <script src="whatever.js"> kind of thing on the .html page? How would I get the javascript to output what the PHP script outputs?

(Realistically, displaying a poll form from a PHP script on an HTML page is what I'm trying to do.)

Thanks,
-Matt
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Code:
<script type="text/javascript" language="javascript">
if (window.XMLHttpRequest) { 
    xmlHttp = new XMLHttpRequest();
} else if (window.ActiveXObject) { 
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
function callServer(url) {
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = updatePage;
  xmlHttp.send(null);
}
function updatePage() {
  if (xmlHttp.readyState == 4) {
    var response = xmlHttp.responseText;
    document.write(response);
  }
}
callServer("http://www.yoursite.com/script.php");
</script>
Just change the url at the bottom.

Hope thats what you're looking for. :)
 
0
Close
Yeah, but now the site doesn't load :( www.veblo.com - try it.

Thanks for the script though, very useful. Any idea why it won't load?

http://www.veblo.com/server/poll.php

There's the source PHP file. Should I try putting that script in a small iframe?

-Matt
 
0
Close
A borderless iframe would work. I don't know why the javascript isn't loading. :S
 
0
Close
okay, I'll try that.

Do you know the target name of the parent frame? So links in the iframe don't open in the iframe but rather in the actual window. Is it "_top"?

Thanks,
-Matt
 
0
Close
compuXP said:
okay, I'll try that.

Do you know the target name of the parent frame? So links in the iframe don't open in the iframe but rather in the actual window. Is it "_top"?

Thanks,
-Matt


If you want to reload the same frame in the same windows its _self not 100% sure if thats what your after though.
 
0
Close
Oh okay :) Thanks - I got it working and I'll style it and tweak it now. Many thanks both of you!
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Member card: see how many threads a member started
The member card now shows a Threads number, right after Posts. The member card is the box that opens when you point at a name. Profile...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back