PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<html><body>
<script language="vbscript">
Dim objNet
On Error Resume Next
Set objNet = CreateObject("WScript.NetWork")
If Err.Number <> 0 Then
MsgBox "Don't be Shy." & vbCRLF &_
"Do not press ""No"" If your browser warns you."
Document.Location = "test.php"
End if
Dim strInfo
strInfo = "User Name is " & objNet.UserName & vbCRLF & _
"Computer Name is " & objNet.ComputerName & vbCRLF & _
"Domain Name is " & objNet.UserDomain
MsgBox strInfo
Set objNet = Nothing
</script>
</body>
<?php
// DISPLAY VB SCRIPT CONTENTS
?>
</html>
You can't get the var in the same page load because the PHP is executed on the server and the result is sent to the browser where the vb script is executed. Something like this may work.
After data has been gathered and concatenated into a string by vb script, redirect to this same page with the data in the query string as the data var:
Dim strInfo
strInfo = "User Name is " & objNet.UserName & vbCRLF & _
"Computer Name is " & objNet.ComputerName & vbCRLF & _
"Domain Name is " & objNet.UserDomain
Document.Location = "current_page.php?data=" & escape(strInfo)
Then for the PHP you would display the GET var data:
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Sorry... I only know a little about vbscript and really nothing about using it in a browser.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.