Results 1 to 21 of 21

Thread: parse error, unexpected $ on line.. [HELP]

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Location
    Dallas, Texas
    Posts
    5

    parse error, unexpected $ on line.. [HELP]

    here is the line (174) where i am getting the error:
    PHP Code:
    $login_data="<body bgcolor='#FDDCBD'><table width='47%' border='0' cellspacing='0' cellpadding='0' height='118' align='center'> <tr valign='top' bgcolor='#FDCAB5'><td height= '21'><font face='Verdana, Arial, Helvetica, sans-serif, Webdings' size='2' color='#FFFFFF'><b><!--TITLE---></b></font></td></tr><tr valign='top' bgcolor='#FCBE96'> <td><p align='center'>&nbsp;</p><p align='center'><b><font face='Verdana, Arial, Helvetica, sans-serif, Webdings' size='2' color='#FFFFFF'>".$fd."</td></tr></tr>"
    when i take out the .$fd. i dont get the error, i have tried also not doing .$fd. but instead just all in quotes but still get the error i dont understand why!! can anyone help!

    thanks
    .oO ORB Oo.

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    So that you don't have one huge line of code, why don't you do this?:

    Code:
    $login_data = '<body bgcolor="#FDDCBD">
        <table width="47%" border="0" cellspacing="0" cellpadding="0" height="118" align="center">
            <tr valign="top" bgcolor="#FDCAB5">
                <td height= "21">
                    <font face="Verdana, Arial, Helvetica, sans-serif, Webdings" size="2" color="#FFFFFF"><b><!--TITLE---></b></font>
                </td>
            </tr>
            <tr valign="top" bgcolor="#FCBE96">
                <td>
                    <p align="center">&nbsp;</p>
                    <p align="center"><b><font face="Verdana, Arial, Helvetica, sans-serif, Webdings" size="2" color="#FFFFFF">' . $fd . '</td>
            </tr>
    </table>';
    And by the way, about 30% of your HTML code is deprecated or just not valid HTML...

    The <font> tag is deprecated. The align and bgcolor attributes are deprecated. height is not a valid table attribute. width cannot accept percentages as values.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Location
    Dallas, Texas
    Posts
    5
    my HTML code is working perfectly there is nothing wrong with it , it all works fine, when i take out those dang variables, but when i leave them in thats where i am getting into trouble. WIDTH DOES accept percentage , i am a webdesigner by trade don't you think by now i know my HTML , my HTML coding isnt an issue right now!

    oO Orb Oo

  4. #4
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Ask anyone else on these forums. Your HTML is deprecated or just invalid. Does it still work? In some browsers, yes. But the deprecated parts will cease to be supported in the future. So yes, there is something wrong with your HTML. If you are a webdesigner by trade, I suggest you hit the books ago or go to www.w3.org and relearn HTML as it's obvious you haven't been keeping yourself up to date.

    I find it hard to believe that somebody has a job as a webdesigner and can't even type in proper English.

    As for the one line of code you have presented, there is nothing wrong with it. Your error must lie elsewhere on the page.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  5. #5
    Addicted Member Phenix's Avatar
    Join Date
    Sep 2002
    Location
    Near A Cube
    Posts
    228

    Lightbulb Whitespace maybe?

    I tend to write this like so:

    $aString = "...blah blah >" . $fd . "</ blah blah...";

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Whitespaces make no difference in PHP.

    I even dropped his code word for word and it executed fine. The error is happening on that line, but the invalid syntax is elsewhere. Probably a missing } somewhere.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7
    Lively Member morrowasted's Avatar
    Join Date
    Aug 2003
    Location
    Houston, TX
    Posts
    118
    The <font> tag is deprecated. The align and bgcolor attributes are deprecated. height is not a valid table attribute. width cannot accept percentages as values.
    as is the valign tag, but are you sure about bgColor?

    im not much a a PHP Programmer, but you may be assuming the register all globals is ebabled, a mistake i often make.

    -morrowasted

  8. #8
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by morrowasted
    as is the valign tag, but are you sure about bgColor?

    im not much a a PHP Programmer, but you may be assuming the register all globals is ebabled, a mistake i often make.
    I'm fairly sure about bgcolor. I'll double check, though.

    If register_globals was off, he wouldn't get an error, just an empty variable.

    Seriously, errors that come out as unexpected $ usually mean something is missing above the line that the error was received on. And I bet it's a { or }.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  9. #9
    Lively Member morrowasted's Avatar
    Join Date
    Aug 2003
    Location
    Houston, TX
    Posts
    118
    as i said, im not much of a PHP programmer , i just make counters and little comment scripts, no real apps.

    -morrowasted

  10. #10
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Yeah, bgcolor is deprecated in HTML 4.01 (see here)
    My evil laugh has a squeak in it.

    kristopherwilson.com

  11. #11
    Lively Member morrowasted's Avatar
    Join Date
    Aug 2003
    Location
    Houston, TX
    Posts
    118
    okay then :-D

    be switching that to

    --------------------------------------------------------------
    <style type="text/css">
    BODY{
    Background-color:#FDDCBD;
    }
    </style>
    --------------------------------------------------------------

    -morrowasted

  12. #12
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by black_orb
    WIDTH DOES accept percentage
    Actually, width is also deprecated. So it doesn't matter.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  13. #13
    Addicted Member Phenix's Avatar
    Join Date
    Sep 2002
    Location
    Near A Cube
    Posts
    228

    Thumbs up

    Yeah, it's probably the $ in the $login_data that it is complaining about.

    And a forgotten } is a high probability culprit. Crimson Editor is pretty good for find the associated braces, brackets and parentheses.

    http://crimsoneditor.com/

  14. #14
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    black_orb, any luck on tracking it down?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  15. #15
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    why can't you just do this
    PHP Code:
    $login_data="<body bgcolor='#FDDCBD'>
    <table width='47%' border='0' cellspacing='0' cellpadding='0' height='118' align='center'> 
    <tr valign='top' bgcolor='#FDCAB5'>
    <td height= '21'><font face='Verdana, Arial, Helvetica, sans-serif, Webdings' size='2' color='#FFFFFF'><b><!--TITLE---></b></font></td></tr>
    <tr valign='top' bgcolor='#FCBE96'> <td><p align='center'>&nbsp;</p><p align='center'><b><font face='Verdana, Arial, Helvetica, sans-serif, Webdings' size='2' color='#FFFFFF'>
    $fd</td></tr></tr>"
    also what is the line above this one. most of the time the errored line is usually the one above it. what is teh exact error?

    also width and height both except percentages in css, as you have to use them there since the are deprecated any where else.

    a web designer by trade and he does this </td></tr></tr> just kidding Black_orb
    Last edited by phpman; Aug 3rd, 2003 at 02:07 AM.

  16. #16
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by phpman
    why can't you just do this
    He said he already tried it.

    I think this is one of those "never come back and let you know how it went" kinda threads...
    My evil laugh has a squeak in it.

    kristopherwilson.com

  17. #17
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    oh, I thought he said he just used quotes on it instead of the ".." thing.

    well geez he could use it this way also {$fd}

    but like it has been said, the error line is above that one I believe.

    I think this is one of those "never come back and let you know how it went" kinda threads...
    yeah, we've seen many of those huh

  18. #18

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Location
    Dallas, Texas
    Posts
    5

    no luck

    i have tried many different things and stilli have no luck this was my first real attempt at using cookie logins so it doesnt surprise me that i am having this much trouble, i think i am gonna make the login script seperate instead of using functions to combine it in one file, then maybe that will narrow the error down a little more . About the brackets i have checked over the file about 25 or 30 times and matched brackets using my PHP editor and i dont see where there are any misplaced brackets, i have not really been to worried about it latley i have other stuff to deal with but i think i am gonna try making two seperate files than at least i can see more of where the error is occuring and maybe be able to fix it.

    -Orb

  19. #19
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Why don't you post the whole file and perhaps one of us could find the error?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  20. #20
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    dude, 2 weeks later and you come back and say it doesn't work. what is your code you have now? and what error are you getting?

  21. #21

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Location
    Dallas, Texas
    Posts
    5
    sorry about not posting b4 but i have other stuff going on and this code really isnt that important to me, i am still learning php and there are other things i can learn , and more stuff i need to do than i can shake a stick out so i am not to worried about this program not working. I will post the whole thing today and maybe somone else can figure out where i am going wrong at i am gonna try some stuff to to fix it but i dont know what is really wrong yet. Like i said i am sorry for the delay i will post the code asap

    -orb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width