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 June 12th, 2003, 01:37 PM
raviram80 raviram80 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 58 raviram80 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 sec
Reputation Power: 6
php and vbscript interaction

hii there

I am planning to insert a particular php variable in an access database using adodb which i haev to use as part of a bigger application. this is test code which is not running. can anyone tell me how to correct this code. thanks



<html>

<body>

<?

$id=5;

?>

</body>

</html>


<script language="VBScript">

dim conn
dim rs
dim connStr
dim qry
Set conn = createObject("ADODB.Connection")
conn.CursorLocation = 3
set rs = createObject("adodb.recordset")
conn.Open "Nihmonitor"


qry = "Insert into q2(id) values (<? $id ?> )"
conn.execute qry

conn.close
set rs = nothing
set conn = nothing



</script>


Ravi

Reply With Quote
  #2  
Old October 3rd, 2003, 10:01 PM
ianstar ianstar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Mass
Posts: 39 ianstar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to ianstar
I don't think you can pass a variable like that between two different languages. I'm not exactly sure about VBScript but php is run on the server so when it sees your page with:

<html>
<body>
<?
$id=5;
?>
</body>
</html>

the actual output the browser sees would just be:

<html>
<body>
</body>
</html>

unless you do something with the $id while still in php.

You could try using a hidden element in a form like so:

<input type="hidden" name="id" value="<?php echo $id; ?>

Then read the that value with your VBScript.

Your post is a little old so you could have figured this out a while ago, but if not I hope I helped.

Ian

Reply With Quote
  #3  
Old October 6th, 2003, 07:57 AM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,179 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 10 h 3 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
Well.. here's one thing that catches my eye. VBScript is not a serverside language by default. ASP is a serverside technology which can be implemented using VBScript, as well as C# and JavaScript. When you are running this page, there is nothing to tell the server that you are executing the code at the server - so the VBScript code should be sent to the client to run on their machine. If you want to create a ServerSide Script, then you need to add the "RunAt=Server" in your <Script> Tag, or just change the page to an ASP page. I agree with ravi, though. It is very difficult to pass variables to other languages. Most people I've heard of do it by assigning the calculated values to hidden text fields on the page... good luck... but I think I'd find some way to do it all in one language.
__________________
Fisherman

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > php and vbscript interaction


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 5 hosted by Hostway
Stay green...Green IT