Java To PHP

Discussion in 'PHP' started by astrazone, Sep 1, 2009.

  1. #1
    My friend needed a special calculator to count the service his offering..
    I created him the calculator with JS but now he needs the result to be transfered to other pages. best is to get the result in a php string.
    I tried making a file with the result and then read them with php but it didnt work...

    can anyone come up with something I didnt think of?

    Thanks.
     
    astrazone, Sep 1, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    First of all, it's javascript, not java like your title says.

    Second, simply set a cookie in javascript and then it will transfer over to all php files. Alternatively, you could send an ajax request to a php page as well.
     
    premiumscripts, Sep 1, 2009 IP
  3. astrazone

    astrazone Member

    Messages:
    358
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #3
    yes sorry I know, I wanted to write JavaScript but then I didnt for some reason...
    and I tried to add a cookie but it never worked..
    ill try again now.

    the only problem is that I need it to create a cookie when you click step 2, not every time I make a new calculation.
    but the script cant see the varible there.
     
    Last edited: Sep 1, 2009
    astrazone, Sep 1, 2009 IP
  4. dukeofism

    dukeofism Peon

    Messages:
    739
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    it will be easier for people to help you out if you display your code. You can also find many PHP scripts online that will do the simple "hit counter" - like feature you are looking for. A simple google search should help you out: like here
     
    dukeofism, Sep 1, 2009 IP