Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder thindrakhya's Avatar
    Join Date
    Jun 2007
    Posts
    90
    Thanks
    8
    Thanked 0 Times in 0 Posts

    passing variable through javascript in PHP

    hi all

    i am changing the variable value through javascript button click eg

    function setMode()
    {
    document.FrmMaster.hidEditVariable.value='DC';

    document.FrmMaster.submit();
    }


    this works fine when i am using on localt host using apache
    now i have uploaded the files on godaddy and my variables like
    hideditvariable is not chnaged when i click on the buttons
    i don't know what setting needs to be changed for webserver as it works on loal host

    one thing more ,
    initially i was using variables like $abc on php
    but this did'nt work on godaddy i had to use $_GET["abc"] to work on godaddy
    i dont' know why?

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Quote Originally Posted by thindrakhya View Post
    hi all

    i am changing the variable value through javascript button click eg

    function setMode()
    {
    document.FrmMaster.hidEditVariable.value='DC';

    document.FrmMaster.submit();
    }


    this works fine when i am using on localt host using apache
    now i have uploaded the files on godaddy and my variables like
    hideditvariable is not chnaged when i click on the buttons
    i don't know what setting needs to be changed for webserver as it works on loal host
    Javascript is client-side so it should be the same regardless of the server software/setup. And this belongs in the Javascript forum.
    Quote Originally Posted by thindrakhya View Post
    one thing more ,
    initially i was using variables like $abc on php
    but this did'nt work on godaddy i had to use $_GET["abc"] to work on godaddy
    i dont' know why?
    Because they have register globals off. You should be using superglobals anyway. $_GET, $_POST, $_COOKIE, $_SESSION, etc.


  •  

    Posting Permissions

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