#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    Australia
    Posts
    52
    Rep Power
    13

    Unhappy Modify the style sheet by JavaScript + PHP?


    Hi, everyone

    I've an idea, if I want to handle the style sheet change by JavaScript, then access JavaScript variable(is the style attribute & its value) by PHP (in fact, pass JavaScript variable to PHP), then using PHP to manipulate the file access and modification?
    can I? how?
    anybody can help? thank!

    Kind regard,
    Jacky =)
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1100
    You can have JavaScript put the information in the URL and then you can use PHP to retrieve it, but it requires another load of the page.
    Code:
    <script language="javascript"><!--
    var passThis = 'bar';
    window.location.replace('/filename.php?foo='+passThis);
    //--></script>
    PHP Code:
    echo $_GET['foo']; // prints `bar` 
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.

IMN logo majestic logo threadwatch logo seochat tools logo