PHPBuilder - JavaScript -> PHP



RSS Twitter
Snippets Html

JavaScript -> PHP

by: Dean
|
November 17, 2003

Version: 1

Type: Sample Code (HOWTO)

Category: HTML

License: GNU General Public License

Description: Convert JavaScript variable to PHP variable.



<?php

    /*
    after this simple script content of PHP variable $s_wid will be
    JavaScript variable s_wid which is screen.width
    */

    ob_start("stat");
?>

<SCRIPT LANGUAGE="JavaScript">
    var s_wid = 0
    s_wid = screen.width
    document.write(s_wid);
</SCRIPT>

<?php
    $s_wid = ob_get_contents();
    ob_end_flush();
?>

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Dean

Comment:



Comment:

(Maximum characters: 1200). You have characters left.