Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Mar 2004
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBscript and PHP

    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?

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Just remember that php is parsed before the browser gets to vbscript, so all you can do is launch a new php page

  • #3
    Regular Coder
    Join Date
    Mar 2004
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...
    De gustibus non est disputandum.

  • #5
    Regular Coder
    Join Date
    Mar 2004
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...

  • #6
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by stophon4
    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=javasc...-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.
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #7
    Regular Coder
    Join Date
    Mar 2004
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by raf
    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 )


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •