Click to See Complete Forum and Search --> : parse error, unexpected $ on line.. [HELP]
black_orb
Aug 1st, 2003, 03:17 PM
here is the line (174) where i am getting the error:
$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'> </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.
The Hobo
Aug 2nd, 2003, 01:51 AM
So that you don't have one huge line of code, why don't you do this?:
$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"> </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.
black_orb
Aug 2nd, 2003, 09:27 AM
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
The Hobo
Aug 2nd, 2003, 12:00 PM
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.
Phenix
Aug 2nd, 2003, 12:18 PM
I tend to write this like so:
$aString = "...blah blah >" . $fd . "</ blah blah...";
The Hobo
Aug 2nd, 2003, 12:22 PM
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.
morrowasted
Aug 2nd, 2003, 12:22 PM
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.
The Hobo
Aug 2nd, 2003, 12:30 PM
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 }.
morrowasted
Aug 2nd, 2003, 12:31 PM
as i said, im not much of a PHP programmer ;) , i just make counters and little comment scripts, no real apps.
The Hobo
Aug 2nd, 2003, 12:33 PM
Yeah, bgcolor is deprecated in HTML 4.01 (see here (http://www.w3.org/TR/html4/present/graphics.html#adef-bgcolor))
morrowasted
Aug 2nd, 2003, 12:37 PM
okay then :-D
be switching that to
--------------------------------------------------------------
<style type="text/css">
BODY{
Background-color:#FDDCBD;
}
</style>
--------------------------------------------------------------
The Hobo
Aug 2nd, 2003, 12:40 PM
Originally posted by black_orb
WIDTH DOES accept percentage
Actually, width is also deprecated. So it doesn't matter. :)
Phenix
Aug 2nd, 2003, 07:05 PM
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/
The Hobo
Aug 2nd, 2003, 10:33 PM
black_orb, any luck on tracking it down?
phpman
Aug 3rd, 2003, 02:03 AM
why can't you just do this
$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'> </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> :D just kidding Black_orb
The Hobo
Aug 3rd, 2003, 02:09 AM
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...
phpman
Aug 3rd, 2003, 02:25 AM
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 :)
black_orb
Aug 14th, 2003, 10:36 AM
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
The Hobo
Aug 14th, 2003, 11:15 AM
Why don't you post the whole file and perhaps one of us could find the error?
phpman
Aug 14th, 2003, 11:22 AM
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?
black_orb
Aug 14th, 2003, 11:38 AM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.