Could somebody transform a JS code into a php code ?

Discussion in 'PHP' started by Enigma28, Dec 29, 2008.

  1. #1
    this is the code.
    Thank you
    <script language="Javascript" src="http://gd.geobytes.com/gd?after=-1&variables=GeobytesLocationCode,GeobytesCode,GeobytesInternet"></script>
        <script language="Javascript">
        if(typeof(sGeobytesLocationCode)=="undefined"
           ||typeof(sGeobytesCode)=="undefined"
           ||typeof(sGeobytesInternet)=="undefined")
        {
           // Something has gone wrong with the variables, so set them to some default value,
           // maybe set a error flag to check for later on.
           var sGeobytesLocationCode="unknown";
           var sGeobytesCode="unknown";
           var sGeobytesInternet="unknown";
        }
         if(sGeobytesInternet=="FR")
        {   
    	document.write( you are from france );    
        }else{
       document.write( you are not from france); 
    
    	}
    	
        </script>
       
    
    HTML:

     
    Enigma28, Dec 29, 2008 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    You simply can't use this in PHP! why? variables can't send to php
     
    EricBruggema, Jan 2, 2009 IP
  3. fairuz.ismail

    fairuz.ismail Peon

    Messages:
    232
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i think he just want the equivalent of this code in php.

    btw Eric, you can use XML or JSON to communicate between jscript and php
     
    fairuz.ismail, Jan 2, 2009 IP
  4. atlantaazfinest

    atlantaazfinest Peon

    Messages:
    389
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yea the best way to do it is ajax just pass variables to php because javascript is client side
     
    atlantaazfinest, Jan 2, 2009 IP
  5. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
  6. justinlorder

    justinlorder Peon

    Messages:
    4,160
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #6
    justinlorder, Jan 2, 2009 IP
  7. kwijibo

    kwijibo Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    awesome, i love that letmegooglethatforyou URL.
     
    kwijibo, Jan 2, 2009 IP