Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. How to get value on variable ?

How to get value on variable ?

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
comtutorialquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    udch
    wrote on last edited by
    #1

    hhtp://abc.com/12?ud=504132 ..........<? echo $_GET['ud'] ?>........; I want to do like this $us=<? echo $_GET['ud'] ?>; if($us==504132) {    $us='Hi'; }else       {             $us='Bye';       } $echo 'I want to say you:'<? echo $_GET['us'] ?>; But it is not working what to do now ? <code></code><pre></pre>

    F 1 Reply Last reply
    0
    • U udch

      hhtp://abc.com/12?ud=504132 ..........<? echo $_GET['ud'] ?>........; I want to do like this $us=<? echo $_GET['ud'] ?>; if($us==504132) {    $us='Hi'; }else       {             $us='Bye';       } $echo 'I want to say you:'<? echo $_GET['us'] ?>; But it is not working what to do now ? <code></code><pre></pre>

      F Offline
      F Offline
      fly904
      wrote on last edited by
      #2

      udch wrote:

      $us=<? echo $_GET['ud'] ?>;

      Why are you opening new PHP tags when you are already in some? <? $us = **<?** ... It's just not necessary. Check if ud is set, otherwise it is 0.

      $us = isset($_GET['ud']) ? $_GET['ud'] : 0 ;

      udch wrote:

      $echo 'I want to say you:'<? echo $_GET['us'] ?>;

      $echo is just wrong; echo is not a variable but a language construct. Read the documentation[^] to learn more. And again with the opening of more PHP tags.

      echo '$ud = ' . $us;

      If at first you don't succeed, you're not Chuck Norris.

      U 1 Reply Last reply
      0
      • F fly904

        udch wrote:

        $us=<? echo $_GET['ud'] ?>;

        Why are you opening new PHP tags when you are already in some? <? $us = **<?** ... It's just not necessary. Check if ud is set, otherwise it is 0.

        $us = isset($_GET['ud']) ? $_GET['ud'] : 0 ;

        udch wrote:

        $echo 'I want to say you:'<? echo $_GET['us'] ?>;

        $echo is just wrong; echo is not a variable but a language construct. Read the documentation[^] to learn more. And again with the opening of more PHP tags.

        echo '$ud = ' . $us;

        If at first you don't succeed, you're not Chuck Norris.

        U Offline
        U Offline
        udch
        wrote on last edited by
        #3

        I am getting value from an url Like http://abc.com/data.php?ud=567878 Now i am passing this value to an iframe of HTML exmple:- <Body> <Html> <iframe frameborder=0 src="http://www.es.com/ifr?url=http://anc.com/wow.xml&amp;amp;up\_k1=<? echo $_GET['ud'] ?>&up_interval=60&amp;synd=open&amp;w=362&amp;h=350&amp;" width=284 height=120 scrolling="no"></iframe> </Body> </Html> I have to write value like up_k1=567878 and it can not take value from any variable. My problem is and i want to do is checking value like if($ud==567878) {    $ud='love all humans'; } and then write it in iframe like up_k1=love all humans Now tell me brother can i do this ?

        F 1 Reply Last reply
        0
        • U udch

          I am getting value from an url Like http://abc.com/data.php?ud=567878 Now i am passing this value to an iframe of HTML exmple:- <Body> <Html> <iframe frameborder=0 src="http://www.es.com/ifr?url=http://anc.com/wow.xml&amp;amp;up\_k1=<? echo $_GET['ud'] ?>&up_interval=60&amp;synd=open&amp;w=362&amp;h=350&amp;" width=284 height=120 scrolling="no"></iframe> </Body> </Html> I have to write value like up_k1=567878 and it can not take value from any variable. My problem is and i want to do is checking value like if($ud==567878) {    $ud='love all humans'; } and then write it in iframe like up_k1=love all humans Now tell me brother can i do this ?

          F Offline
          F Offline
          fly904
          wrote on last edited by
          #4

          Please engage your brain. <? echo $ud ?> instead of <? echo $_GET['ud'] ?>

          If at first you don't succeed, you're not Chuck Norris.

          U 1 Reply Last reply
          0
          • F fly904

            Please engage your brain. <? echo $ud ?> instead of <? echo $_GET['ud'] ?>

            If at first you don't succeed, you're not Chuck Norris.

            U Offline
            U Offline
            udch
            wrote on last edited by
            #5

            Thank you very much for all your help code is working good now.Thanks again my brother.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups