Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VB code with PHP Session Variable

Status
Not open for further replies.

BadChough

Programmer
Dec 20, 2007
137
GB
I have successfully used the following snippet of code to launch printers on a php webpage, and to close the page when the printing is done.

<object id=WBControl width=0 height=0 classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2></object>
<script language=VBScript><!-- //
Sub VBPrint() On Error Resume Next
WBControl.ExecWB 6,1
End Sub
//--></script>

<script language=JavaScript><!-- //
if (window.print) self.print();
else if (navigator.appName.indexOf('Microsoft') !=-1) VBPrint()
setTimeout('self.close()',3000);
//--></script>

However, when I add a php Session Variable at the start of the page the printer will still launch when requested, but the page fails to self-close.
I there a way around this problem?
 
Please ignore the drivel above.
I don't understand what was going wrong, but it's sorted now.
Sorry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top