Jump to content

PHP and Javascript method /function


geaddict

Recommended Posts

I need to be able to use php to do exactly the following that I now do in Java -

 

<script type="text/javascript">

if(window.print) <act on a true response and display a question on the screen or some other crap>;

</script>

 

Basically what I am after is either running this small script on a 'whatever.php' page by calling it somehow or doing it in php direct to verfiy only that the function window.print() is available on the client and then branching to a series of actions. I am very new to both Java and PHP so the simpler the explanation the better. Also is there an ifnot type directive in Java for easily reversed logic?

 

Thanks,

 

::)

Link to comment
https://forums.phpfreaks.com/topic/111168-php-and-javascript-method-function/
Share on other sites

Now I better understand the differences between the two.

 

Ok how could I use getbrowser() to extract the operating system type so that I can restrict users of windows based equipment to better guess which will have window.print() support in java?

 

How can I simply return and test for OS type in php?

 

Thanks,

 

::)

Well, honestly, you can easily fake User Agent strings.  I can make my browser be uhh....a "Superdog 9000 with extra ketchup".  So don't rely on it.  Why don't you just test in Javascript?

 

P.S: It's Javascript, not Java.  HUGE difference.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.