#native_company# #native_desc#
#native_cta#

JavaScript -> PHP

By Dean
on 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();
?>