...

View Full Version : VBscript and PHP



stophon4
04-24-2004, 03:18 PM
Is it possible to mix the two? For example if the person hits OK in a MsgBox in VB can it trigger something in php? Is this possible?

Nightfire
04-24-2004, 03:25 PM
Just remember that php is parsed before the browser gets to vbscript, so all you can do is launch a new php page

stophon4
04-24-2004, 05:54 PM
oh, I can use the same page right, I could just start a function with php, like test.php?function=function1 that could be started with VBscript right?

mordred
04-24-2004, 07:50 PM
Not quite... if I understood you correctly.

You need to issue a HTTP request to your PHP script, and retrieve the response, and parse it for your needs. If you don't want to reload the page you're currently viewing, you need to let this happen in a container of some kind. I don't know if that's doable with VBScript, in JavaScript you can use the XmlHTTPRequest object for this purpose, though it's not exactly an easy ride and only supported by newer browsers.

Maybe you provide us a with a little more info what you're actually trying to achieve, and in which context VBScript should be used... in a web page, desktop application, etc...

stophon4
04-24-2004, 08:24 PM
Well actually I just wanted to do the yes/no questions and other stuff that VBscript supports that javascript doesn't (the MsgBox function) and that is all I really wanted to do. I guess a new php page might work though...

raf
04-24-2004, 10:04 PM
Well actually I just wanted to do the yes/no questions and other stuff that VBscript supports that javascript doesn't (the MsgBox function) and that is all I really wanted to do. I guess a new php page might work though...
Realy. So Javascript doesn't support dialogscreens like alerts, promps and comfirmaion boxes? I suppose that 281,000 sites must be wrong
http://www.google.be/search?q=javascript+dialog&ie=UTF-8&oe=UTF-8&hl=nl&meta=
About all dialogs you've seen on webpages, were javascript. Clientside vbscript is hardly used. It's almost onlu used as scripting language for ASP or inside desktop-applications (more frequently it's then VBA)

It goes wthout saying that PHP and javascript or client side VBscript doen't interact. But they can work 'together'.
You can create jabvascript or vbscript or whatever other scriptinglanguage with PHP and then send it to the browser. And you can use clientsided scripting before the client requests a page, or use clientside scripting to request a PHP page, or even generate some values with clientside scripting that are then sent along with the pagerequest (in the querystring or a posted form) and are then further processed with PHP.
Maybe think of the data interchange like this : everything i can hardcode in an editor, can be automatically/dynamically generated with PHP. Every kind of userinput can be generated and sent to the server with clientside scripting.

stophon4
04-25-2004, 02:28 PM
Realy. So Javascript doesn't support dialogscreens like alerts, promps and comfirmaion boxes? I suppose that 281,000 sites must be wrong

No, I am yet to see an alert, prompt, confirm have the buttons saying yes, no and cancel. Oh well. I guess a new php page will work. And no need to be rude (well it wasn't rude, but not polite either :thumbsup: )



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum