Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Assign a Javascript variable to a PHP variable

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33470
    xyzoblivion
    Member

    Guys! i am stuck again :( …

    After a lot of searching i am now sure that we can not assign a Javascript variable to a PHP variable unless it resides on some other page and we use window.location.href technique. What i want to do might be done by some other trick.. here is what i want to do:

    I have a drop down menu and a table displaying some data. The drop down is populated with months. When i select any of the month it should reflect the changes in the table by querying the database. The query that i am passing use the selected date.

    Help me out please …

    #83286
    lyleyboy
    Member

    On the select just have an onclick with window.location.href but add in ?sort=ORDER BY Price DESC

    Then in the page using PHP get the $_GET variable and appending it to your database query string.

    #83206
    xyzoblivion
    Member

    GREAT ! .. it worked .. thanks !

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.