PHP help please

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GiantGnome
    Confirmed User
    • Jan 2004
    • 4344

    #1

    PHP help please

    heres the error
    Parse error: parse error, unexpected T_ECHO, expecting ',' or ';'

    and here is the line
    "Free ", $myTxt[$pick], " E&middot;Zine</span></a>\n";

    how do i fix it?
    Thank you
    NOOOOOOOOOOOOOOOOOOOOOOO-Darth Vader
  • Steen2
    Confirmed User
    • Feb 2004
    • 7662

    #2
    CTR + ALT + DEL


    Does this work still?
    ICQ: 2262.73945

    Comment

    • d00t
      Confirmed User
      • Sep 2002
      • 3766

      #3
      google it..

      Comment

      • FlexxAeon
        Confirmed User
        • May 2003
        • 3765

        #4
        i think it needs to be "Free ". $myTxt[$pick]. " E&middot;Zine</span></a>\n";

        but i'm still an intermediate on PHP so i could be wrong
        flexx [dot] aeon [at] gmail

        Comment

        • Cogitator
          Confirmed User
          • Feb 2002
          • 672

          #5


          You have to show the lines before and after it. No one can tell what you're trying to do in that one line.
          - this space intentionally left blank -

          Comment

          • GiantGnome
            Confirmed User
            • Jan 2004
            • 4344

            #6
            Originally posted by Cogitator


            You have to show the lines before and after it. No one can tell what you're trying to do in that one line.
            fine, heres before and after.

            echo "<span style=\"font-size: 16pt; line-height: 120%; font-family: Times New Roman, Arial, Courier, sans-serif\">\n"
            echo "Free ", $myTxt[$pick], " E&middot;Zine</span></a>\n";
            echo "</div>\n";
            NOOOOOOOOOOOOOOOOOOOOOOO-Darth Vader

            Comment

            • Damian_Maxcash
              So Fucking Banned
              • Oct 2002
              • 12745

              #7
              echo "<span style=\"font-size: 16pt; line-height: 120%; font-family: Times New Roman, Arial, Courier, sans-serif\">\n";
              echo "Free ", $myTxt[$pick], " E&middot;Zine</span></a>\n";
              echo "</div>\n";

              Comment

              • StuartD
                Sofa King Band
                • Jul 2002
                • 29903

                #8
                echo "<span style=\"font-size: 16pt; line-height: 120%; font-family: Times New Roman, Arial, Courier, sans-serif\">\n";
                echo "Free ", $myTxt[$pick], " E&middot;Zine</span></a>\n";
                echo "</div>\n";

                You're missing the ; after the first line.
                This is me on facebook
                This is me on twitter

                Comment

                • GiantGnome
                  Confirmed User
                  • Jan 2004
                  • 4344

                  #9
                  Thank you damian and Stuart.
                  NOOOOOOOOOOOOOOOOOOOOOOO-Darth Vader

                  Comment

                  • Cogitator
                    Confirmed User
                    • Feb 2002
                    • 672

                    #10
                    didn't mean to be rude. but it is helpful to see more than just one line. glad the problem is fixed
                    - this space intentionally left blank -

                    Comment

                    • GiantGnome
                      Confirmed User
                      • Jan 2004
                      • 4344

                      #11
                      Originally posted by Cogitator
                      didn't mean to be rude. but it is helpful to see more than just one line. glad the problem is fixed
                      Thats ok. I didnt think you were rude.
                      NOOOOOOOOOOOOOOOOOOOOOOO-Darth Vader

                      Comment

                      • Azlord
                        Confirmed User
                        • Dec 2003
                        • 2651

                        #12
                        It's easier and a lot cleaner to break out of the php and then use short hand for echoing it out

                        <?=$blah?>
                        That way you don't have to escape a ton of " marks.

                        <span style="font-size: 16pt; line-height: 120%; font-family: Times New Roman, Arial, Courier, sans-serif">
                        Free <?=$myTxt[$pick]?> E&middot;Zine</span></a>
                        </div>

                        Comment

                        • Linguist
                          Confirmed User
                          • Apr 2004
                          • 1706

                          #13
                          Originally posted by NichePay - StuartD
                          echo "<span style=\"font-size: 16pt; line-height: 120%; font-family: Times New Roman, Arial, Courier, sans-serif\">\n";
                          echo "Free ", $myTxt[$pick], " E&middot;Zine</span></a>\n";
                          echo "</div>\n";

                          You're missing the ; after the first line.
                          You don't need the ; cause echo can span several lines

                          Try this as was suggested above:

                          echo "Free ".$myTxt[$pick]."E&middot;Zine</span></a>\n";
                          315-310

                          Comment

                          • Varius
                            Confirmed User
                            • Jun 2004
                            • 6890

                            #14
                            Forget echoing html ever again. Start doing this NOW, you'll thank me in the future

                            Use Smarty - a templating engine for PHP.

                            http://smarty.php.net/
                            Skype variuscr - Email varius AT gmail

                            Comment

                            • GiantGnome
                              Confirmed User
                              • Jan 2004
                              • 4344

                              #15
                              what about this one?

                              if (stristr($_SERVER["SERVER_SOFTWARE"], "apache") !hahahaha false)
                              include( "http://" . $_SERVER["SERVER_NAME"] . "/scripts/febfpa2link.html" );

                              ?>
                              NOOOOOOOOOOOOOOOOOOOOOOO-Darth Vader

                              Comment

                              • StuartD
                                Sofa King Band
                                • Jul 2002
                                • 29903

                                #16
                                Originally posted by GiantGnome
                                what about this one?

                                if (stristr($_SERVER["SERVER_SOFTWARE"], "apache") !hahahaha false)
                                include( "http://" . $_SERVER["SERVER_NAME"] . "/scripts/febfpa2link.html" );

                                ?>
                                I'm asuming you have a double equal sign after that !

                                Don't... it's just !=

                                example:

                                Code:
                                if (stristr($_SERVER["SERVER_SOFTWARE"], "apache") != false)
                                        include( "http://" . $_SERVER["SERVER_NAME"] . "/scripts/febfpa2link.html" );
                                This is me on facebook
                                This is me on twitter

                                Comment

                                • Dalai lama
                                  Strength and Honor
                                  • Jul 2004
                                  • 16540

                                  #17
                                  alt + 4 should work

                                  A program you can trust.
                                  Gallerybooster Run multiply TGPs of 1 script

                                  Comment

                                  • GiantGnome
                                    Confirmed User
                                    • Jan 2004
                                    • 4344

                                    #18
                                    Originally posted by NichePay - StuartD
                                    I'm asuming you have a double equal sign after that !

                                    Don't... it's just !=

                                    example:

                                    Code:
                                    if (stristr($_SERVER["SERVER_SOFTWARE"], "apache") != false)
                                            include( "http://" . $_SERVER["SERVER_NAME"] . "/scripts/febfpa2link.html" );
                                    Thanks again!
                                    NOOOOOOOOOOOOOOOOOOOOOOO-Darth Vader

                                    Comment

                                    • GiantGnome
                                      Confirmed User
                                      • Jan 2004
                                      • 4344

                                      #19
                                      Hey Stuart, please icq me if you can. 172768566
                                      NOOOOOOOOOOOOOOOOOOOOOOO-Darth Vader

                                      Comment

                                      • StuartD
                                        Sofa King Band
                                        • Jul 2002
                                        • 29903

                                        #20
                                        Originally posted by GiantGnome
                                        Hey Stuart, please icq me if you can. 172768566
                                        uh oh.. I get the feeling I'll be doing php support in the very near future

                                        ICQ sent
                                        This is me on facebook
                                        This is me on twitter

                                        Comment

                                        Working...