Flare Sci-fi Forums
Flare Sci-Fi Forums Post New Topic  New Poll  Post A Reply
my profile | directory login | search | faq | forum home

  next oldest topic   next newest topic
» Flare Sci-Fi Forums » Community » Officers' Lounge » JavaScript Query String help request

   
Author Topic: JavaScript Query String help request
bX
Stopped. Smelling flowers.
Member # 419

 - posted      Profile for bX     Send New Private Message       Edit/Delete Post   Reply With Quote 
Is there a JavaScript guru in the house?

I'm updating my website and in so doing, giving the portfolio a Flash interface. Unfortunately Flash sucks donkey at displaying, say, movies, so I want to be able to pop-up windows to display movies and higher-rez images. And the method I want to do this uses the GET method to pass the URL of the content in question to an HTML (or PHP) document template which would then parse the Query String to display the correct content.

So I can get Flash to spit out, say:

http://www.furioso.com/test/video_display.php?moviefile=video%2FDick2%2DTrailer%2D300Kbps%2Emp4

but then I don't know how to make the video_display.php file to display the correct content.

I'll probably make a separate template for JPGs, but I'm guessing the code would be similar. Any help would be greatly appreciated.

Registered: Sep 2000  |  IP: Logged
Cartman
just made by the Presbyterian Church
Member # 256

 - posted      Profile for Cartman     Send New Private Message       Edit/Delete Post   Reply With Quote 
*scratches head*

Waitwaitwaitwaitwait, you want to write a pure PHP-script to display video files a la YouTube? Even though YT (and indeed almost every other video-sharing portal) itself uses embedded Flash because trying to do anything video in PHP is sheer madness? Or am I misinterpreting your intentions?

Registered: Nov 1999  |  IP: Logged
Jason Abbadon
Rolls with the punches.
Member # 882

 - posted      Profile for Jason Abbadon     Send New Private Message       Edit/Delete Post   Reply With Quote 
You could just post all your video on Y-Tube and hotlink it- just to be an ass, of course.

--------------------
Justice inclines her scales so that wisdom comes at the price of suffering.
-Aeschylus, Agamemnon

Registered: Aug 2002  |  IP: Logged
Charles Capps
We appreciate your concern.
It is noted and stupid.
Member # 9

 - posted      Profile for Charles Capps     Send New Private Message       Edit/Delete Post   Reply With Quote 
... if you're going to pass a query string to the PHP file to begin with, why do you want to use Javascript alone to write the URL and what have you?

Overcomplicated.

But if you insist, you can find the query string as: document.location.search

You'll still need to parse it, of course.

Or are you asking how to use PHP to read the query string? If so, you must learn PHP. Or the simple answer is to look in $_GET, but learning all the side effects would be smarter.

Registered: Mar 1999  |  IP: Logged
bX
Stopped. Smelling flowers.
Member # 419

 - posted      Profile for bX     Send New Private Message       Edit/Delete Post   Reply With Quote 
Sorry, I guess I wasn't clear. This is all a bit over my head I'm afraid. Anyway I think I've got it sorted. What I needed was the "document.write" syntax. (I should put in a JS switch to detect whether a visitor has the QuickTime plugin.)

Such that (so long as you have QuickTime installed) this:

http://www.furioso.com/test/display_video.html?SpinozaFlyby_MPG400.mp4

works now. For those uncomfortable with the View Source option, basically there's a JavaScript function at the top of the "display_video.html" page which puts everything in the URL after the question mark into a variable. (An admittedly more elegant solution would be to parse different variables out of the document.location.search string.) Meanwhile partway down the page, document.write adds an embed tag with the URL of the content to be displayed.

So this:

http://www.furioso.com/test/display_video.html?SadGirl_MPG400.mp4

will work.

For those too proud to install QT, how do you play back MP4 content and for what plugin would I need to look up player embed tags?

The rough version (in Flash which throws the html files as popups using JS) is visitable at:

http://www.furioso.com/test/test.html

in the examples section.

Registered: Sep 2000  |  IP: Logged
   

Quick Reply
Message:

HTML is enabled.
UBB Code™ is enabled.

Instant Graemlins
   


Post New Topic  New Poll  Post A Reply Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


© 1999-2024 Charles Capps

Powered by UBB.classic™ 6.7.3