Results 1 to 4 of 4

Thread: JavaScript value into PHP variable

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    266

    Question JavaScript value into PHP variable

    Hello,

    Please let me know how to retrieve javascript value into a php variable and use it normally like other php variable.

    DATABASE NAME: crc

    I zipped and attach the folder.

    Please help.

    Thanks & Regards.
    Attached Files Attached Files

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: JavaScript value into PHP variable

    alright -- please stop posting your entire project. instead, make a post asking how to do what you want to do (with details); it's a lot more convenient for anyone trying to help you.

    either way, I saw what you were trying to do in sub1.php:
    PHP Code:
    <?php $temp ?>=document.write(document.f.getElementById('txtCountry').value);<?php ?>;
    this is something that you can never do. you can't assign a PHP variable to a JavaScript value -- period. there has to be some sort of interaction between the client and the server for PHP to get involved. this could be by submitting a form, or this could be by using AJAX. what you're trying to do, however, is not possible.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    266

    Question Re: JavaScript value into PHP variable

    Hello kows. Can you please tell me how to do the same ?

  4. #4
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: JavaScript value into PHP variable

    .. I said that it's not possible to do what you're trying to do. :/

Posting Permissions

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



Click Here to Expand Forum to Full Width