Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 30th, 2004, 04:18 PM
Alicia Alicia is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 15 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 13 sec
Reputation Power: 0
send variables from html to external file

I'm new to VBscript and I'm having problems.

I want to make a flash sniffer, but I'm having trouble sending variables from my html file to an external vbscript file (I want to have a generic vbscript that can be used by different files with different vairables).

This is my html:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Flash</title>

<script type="text/vbscript">
<![CDATA[
Dim w=300
Dim h=200
Dim file="movie.swf"
Dim dir=""
Dim color="#ffffff"
Dim version=6
Dim alturl="http://www.macromedia.com/go/getflashplayer"
Dim altimage="noflash.gif"
' ]]>
</script>
</head>
<body>
<script type="text/vbscript" src="vbflash.vbs"></script>

</body>
</html>

And vbflash.vbs processes the information, but when I try to run it, I get an error message (unterminated statement, or smething like that...

I've also tried to put the variables inside the script tags, but then I don't get the error message, but nothing happens...

This is the script:
Code:
//check for Flash Player X
//script for IE on Win32 systems
on error resume next

Dim checkForFlash6

checkForFlash6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash."& version)))

if checkForFlash6 = true then
document.write("<object data="""&file&""" classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" type=""application/x-shockwave-flash"" codebase="""&dir&""" width="""&w&""" height="""&h&"""><param name=""movie"" value="""&dir&"/"&file&""" /><param name=""menu"" value=""false"" /><param name=""quality"" value=""high"" /><param name=""bgcolor"" value="""&color&""" /></object>")
else
document.write("<a href="""&alturl&"""><img src="""&altimage&""" alt=""Sorry, no flash for you!"" /></a> ")
end If

Reply With Quote
  #2  
Old January 30th, 2004, 06:27 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 13th Plane (11000 - 11499 posts)
 
Join Date: Jun 2003
Posts: 11,148 Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 17 h 54 m 3 sec
Reputation Power: 857
I suspect this may be more an xml issue than a script issue. I don't know the answer for you, sorry.

Reply With Quote
  #3  
Old January 30th, 2004, 07:02 PM
Alicia Alicia is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 15 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 13 sec
Reputation Power: 0
I did a similar thing with Javascript, and it works fine, but it doesn't seem to recognize the variables in the html with vbscript.

I must add that when I hardcode those variables into the vbscript source code, the script works fine. It just doesn't pass the variables from the html to the script.

What is the scope of variables declared in the head of the document with vbscript, does anyone know?

Last edited by Alicia : January 30th, 2004 at 07:45 PM.

Reply With Quote
  #4  
Old January 31st, 2004, 10:35 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
If u change the vbs file to a included file with extended filename "inc" in a asp page..It will work fine..

Reply With Quote
  #5  
Old January 31st, 2004, 01:08 PM
Alicia Alicia is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 15 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 13 sec
Reputation Power: 0
Thanks, but I don't want to have to use asp. I want this script to be able to be used anywhere, whether they have asp in the server or not...

Reply With Quote
  #6  
Old January 31st, 2004, 10:46 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
U build your html and vbs..And i get the result disply in the IE:Sorry, no flash for you!..Do u think it works fine?

Reply With Quote
  #7  
Old February 1st, 2004, 12:12 PM
Alicia Alicia is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 15 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 13 sec
Reputation Power: 0
Thsnk for trying, but that's what happens when it doesn't recognize the variables. If you make a MsgBox showing the html code that it's generating, you'll see that the values for alturl and altimage are emtpy (they should be a link to macromedia and noflash.gif).

It's so simple to do this in javascript, but I need the vbscript version to detect flash in older ie browsers.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > send variables from html to external file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT