The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 16, 2019, 09:58:08 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: External javascript in a PHP file  (Read 3813 times)
thedarkness
Lifer
*****
Offline Offline

Posts: 585



View Profile
« on: May 06, 2007, 01:40:32 AM »

This has very interesting possibilities;

http:// www.javascriptkit.com/javatutors/externalphp.shtml

Or does it? I must be tired............  Need Help

Cheers,
td
Logged

"I want to be the guy my dog thinks I am."
 - Unknown
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: May 06, 2007, 11:57:40 AM »

Actually a nice article describing what I do a lot of... in no documentation does it describe that JS files must end in JS, or images must end in .gif or jpg, or css files must end in css... what if they all were .php files and you had the IP address of the surfer... what if rather than cloaking an entire page, for example, you only cloaked portions of the JS or CSS files or even the images...?
What kind of trickiness could be had there?  Devilish Mobster

And back to nonBH stuff...
I started using this technique in early 2000 when I had trouble getting a "Please Wait" page to come up with an animated GIF while I processed a transaction. The problem was that if I POSTed something (so that I could start the transaction) the GIF stopped moving in IE... bastards. So my final fix was to jump to a page with an animated GIF that called for a JS src... but THAT was the actual transactor. The page continued to animate but IE held on for as long as it needed to for the "javascript source" to come down... well, as soon as my processing was done the only javascript that it got was "top.location='/thankYouForProcession.html'" ... so the user had the experience of "something's happening" (the animated GIF) while I worked and the moment I was done the site moved on.

/p
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
dirk
Global Moderator
Expert
*****
Offline Offline

Posts: 416


View Profile
« Reply #2 on: May 06, 2007, 03:22:37 PM »

Just tested it with a CGI script which is also working.

The script is called by external JavaScript:

Code:
<script type="text/javascript" src="external-js.cgi"></script>

external-js.cgi:

Code:
#!/usr/bin/perl

use strict;
use warnings;

my $remote_addr = $ENV{'REMOTE_ADDR'};

print "Content-type: application/x-javascript\n\n";

print "document.write(\"Your IP address is: $remote_addr\")";

exit;
Logged
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #3 on: May 06, 2007, 05:23:04 PM »

Actually a nice article describing what I do a lot of... in no documentation does it describe that JS files must end in JS, or images must end in .gif or jpg, or css files must end in css... what if they all were .php files and you had the IP address of the surfer... what if rather than cloaking an entire page, for example, you only cloaked portions of the JS or CSS files or even the images...?
What kind of trickiness could be had there?  Devilish Mobster
My son has this science fair project which is on a webserver that forbid .js files.
but if i he put the javascript in like .txt files .......
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #4 on: May 06, 2007, 08:37:34 PM »

 Devilish Mary's and my Our kids' science projects are always fun
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
thedarkness
Lifer
*****
Offline Offline

Posts: 585



View Profile
« Reply #5 on: May 06, 2007, 09:20:00 PM »

On this note I'm doing a small project for my kid's school and I was thinking of doing most of it in js/AJAX and I thought maybe I could get you guys to do all the work we could do it as a collaborative project? I can post some prelim stuff I've done and we could see how it progresses from there. Seriously I'm happy to do most/all of the work but I'd appreciate some feedback to get the design and implementation right.

Let me know what you think,
td
Logged

"I want to be the guy my dog thinks I am."
 - Unknown
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #6 on: May 08, 2007, 05:42:25 PM »

Prolly be a great exercise, love to help if I can.

/p
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #7 on: May 08, 2007, 08:39:35 PM »

On this note I'm doing a small project for my kid's school and I was thinking of doing most of it in js/AJAX and I thought maybe I could get you guys to do all the work we could do it as a collaborative project? I can post some prelim stuff I've done and we could see how it progresses from there. Seriously I'm happy to do most/all of the work but I'd appreciate some feedback to get the design and implementation right.
I will provide my standard useless pointless remark  ROFLMAO
yes the project would be much simpler if you would use a language like squirrel http://squirrel-lang.org/default.aspx

Also will attempt to get topics sidetracked as much as possible Tongue
Logged
thedarkness
Lifer
*****
Offline Offline

Posts: 585



View Profile
« Reply #8 on: May 08, 2007, 10:11:00 PM »


yes the project would be much simpler if you would use a language like squirrel http://squirrel-lang.org/default.aspx


Or perhaps some other rodent based language like Gerbil?

Since it's in the Javascript forum I'm gonna go with..... hmmmmm...... javascript!

I believe the squirell forum is still under construction......  Violin

Cheers,
td
Logged

"I want to be the guy my dog thinks I am."
 - Unknown
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!