NameSilo

Blogger Workarounds?

Spaceship Spaceship
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
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
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
•••
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
•••
A borderless iframe would work. I don't know why the javascript isn't loading. :S
 
0
•••
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
•••
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
•••
Oh okay :) Thanks - I got it working and I'll style it and tweak it now. Many thanks both of you!
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back