Results 1 to 6 of 6

Thread: Passing a Javascript variable to a PHP script

  1. #1
    SG Enthusiast Kyle's Avatar
    Join Date
    Sep 2002
    Location
    Seattle, WA
    Posts
    4,851

    Passing a Javascript variable to a PHP script

    .
    Last edited by Kyle; 10-08-10 at 05:15 PM.

  2. #2
    Elite Member TonyT's Avatar
    Join Date
    Jan 2000
    Location
    Fairfax, VA
    Posts
    10,336
    No one has any right to force data on you
    and command you to believe it or else.
    If it is not true for you, it isn't true.

    LRH

  3. #3
    SG Enthusiast Kyle's Avatar
    Join Date
    Sep 2002
    Location
    Seattle, WA
    Posts
    4,851
    Cool beans, thanks alot Tony!

  4. #4
    SG Enthusiast Kyle's Avatar
    Join Date
    Sep 2002
    Location
    Seattle, WA
    Posts
    4,851
    Worked LIKE A CHARM! Thanks again!!

  5. #5
    Junior Member
    Join Date
    May 2007
    Posts
    1

    Exclamation Passing a Javascript variable to a PHP script

    Hi

    I have this js code:

    function getContent(content, subMenu){
    .......
    url="myFile.php?q="+subMenu
    ......
    }
    and i have this myFile.php that has a conditional php code.

    <?
    if ($_GET['q']=="1"){
    ?>
    <table width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <th scope="row">Menu1</th>
    </tr>
    </table>

    <?
    }
    else
    {
    if ($_GET['q'] == "2"){
    ?>

    <?
    }
    else
    {
    ?>
    <table width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <th scope="row">Menu6</th>
    </tr>
    </table>

    <?
    }
    }
    ?>
    this code running good in firefox but in IE gives me:

    Your browser sent a request that this server could not understand.

    Apache/2.2.3 (CentOS) Server at xxx.yyy. z.w Port 80


    Help me pleaseeeeeeeeeeeeeee!!!!!!!


    Dianix

  6. #6
    no. no, No. NO, NO... NO! stevebakh's Avatar
    Join Date
    Aug 2002
    Posts
    3,228
    You're not showing us the code where you actually make the call to myFile.php

Similar Threads

  1. php empty variable
    By Jeremy in forum Programming Forum
    Replies: 8
    Last Post: 02-19-04, 02:56 AM
  2. members & auto dealer PHP script
    By gmarik in forum Programming Forum
    Replies: 1
    Last Post: 03-04-03, 03:06 AM
  3. php vulnerability
    By denolth2 in forum Network Security
    Replies: 0
    Last Post: 07-23-02, 04:54 PM
  4. how to call PHP script from HTML
    By catngo in forum Programming Forum
    Replies: 2
    Last Post: 02-09-02, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •