1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

whats worng in my code ????

Discussion in 'PHP & Perl' started by Dexter6996, Oct 31, 2015.

  1. Dexter6996

    Dexter6996 Newbie

    Joined:
    Oct 13, 2015
    Messages:
    44
    Likes Received:
    1
    <?php

    $abc = 98 ;

    $xyz = 89;

    ?>

    <? php
    echo '$abc' ;

    ?>
     
  2. Stiletto

    Stiletto Jr. VIP Jr. VIP

    Joined:
    Nov 5, 2012
    Messages:
    1,070
    Likes Received:
    553
    Location:
    Balkans
    Home Page:
  3. iBrazilian

    iBrazilian Regular Member

    Joined:
    Oct 10, 2013
    Messages:
    492
    Likes Received:
    255
    $abc = "98";
    $xyz = "89";

    echo $abc;
     
  4. mantic0re

    mantic0re Junior Member

    Joined:
    May 29, 2015
    Messages:
    118
    Likes Received:
    9
    Hi,

    Simple questions such as these are perfectly answered in other sources, such as w3schools.
     
  5. ScarfaceMontana

    ScarfaceMontana Registered Member

    Joined:
    Mar 2, 2015
    Messages:
    84
    Likes Received:
    26
    Here is your mistake:

    echo '$abc' ;

    This is how its done:
    echo $abc ;
     
  6. Hawkster

    Hawkster Jr. VIP Jr. VIP

    Joined:
    Jun 22, 2013
    Messages:
    3,507
    Likes Received:
    3,721
    Gender:
    Male
    Occupation:
    Listen to everyone - Follow no-one
    Location:
    UK
    Home Page:
    Quoting so OP can see what you put

     
  7. Shirko

    Shirko Regular Member

    Joined:
    Aug 11, 2012
    Messages:
    200
    Likes Received:
    172
    Location:
    adding monkeys to my papal
    Last edited: Nov 1, 2015
  8. botsource

    botsource Newbie

    Joined:
    Nov 4, 2015
    Messages:
    2
    Likes Received:
    0
    Pay attention to that style of coding when you are creating sql queries. (sql injection)
     
  9. member8200

    member8200 Regular Member

    Joined:
    Aug 9, 2014
    Messages:
    475
    Likes Received:
    33

    <?php
    $abc = 98 ;
    $xyz = 89;

    echo $abc;
    ?>
    here's how it's done. when you put '$abc' you are stating a string and not the variable. :)
     
  10. revproxy

    revproxy BANNED BANNED Jr. VIP Premium Member

    Joined:
    Nov 20, 2015
    Messages:
    396
    Likes Received:
    100
    Gender:
    Male
    Its must be "$abc" or "{$abc}"... not '$abc'