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

    Join Date
    May 2000
    Posts
    65
    Rep Power
    15
    Hi, i am trying to get a value(variable setted in javascript) and during server side process, i need to use php the process that value... can i do that...
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    36
    Rep Power
    15
    I had a hell of a time with the same prob. In the end, I just passed the variable in th e url. You can also use cookies.

    ------------------
    -Gabe
    "Save trees, eat beaver."
    "y!php3++?"
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    24
    Rep Power
    0
    Why not make a php function to write that section of your javascript?

    <script language="JavaScript">

    <?
    echo("var myVar = $someVar;");
    >?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    36
    Rep Power
    15
    The problem relies in the fact that php gets parsed and writes all the hard code <I>then</I> JavaScript takes control on the client side. The only way for this to work would be from more than one page so php can get a value.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    65
    Rep Power
    15
    I javaScript, how to pass a variable value to the url like
    www.testing.com/my?option1=yes,option2=no,option3=yes.....

Similar Threads

  1. Odd problem with a hash and foreach loop
    By quantumechanix in forum Perl Programming
    Replies: 7
    Last Post: December 15th, 2003, 05:06 PM
  2. making javascript code into php function
    By paCkeTroUTer in forum JavaScript Development
    Replies: 2
    Last Post: June 17th, 2003, 03:26 AM
  3. Replies: 1
    Last Post: April 3rd, 2003, 03:41 PM
  4. JavaScript code generated using Php problem..
    By amrgo in forum JavaScript Development
    Replies: 0
    Last Post: April 1st, 2003, 01:07 AM
  5. Nice PHP code layout
    By enigmatrix in forum PHP Development
    Replies: 13
    Last Post: September 18th, 2001, 04:49 PM

IMN logo majestic logo threadwatch logo seochat tools logo