|
-
Aug 1st, 2003, 03:17 PM
#1
Thread Starter
New Member
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'> </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.
-
Aug 2nd, 2003, 01:51 AM
#2
Stuck in the 80s
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"> </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.
-
Aug 2nd, 2003, 09:27 AM
#3
Thread Starter
New Member
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
-
Aug 2nd, 2003, 12:00 PM
#4
Stuck in the 80s
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.
-
Aug 2nd, 2003, 12:18 PM
#5
Addicted Member
Whitespace maybe?
I tend to write this like so:
$aString = "...blah blah >" . $fd . "</ blah blah...";
-
Aug 2nd, 2003, 12:22 PM
#6
Stuck in the 80s
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.
-
Aug 2nd, 2003, 12:22 PM
#7
Lively Member
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
-
Aug 2nd, 2003, 12:30 PM
#8
Stuck in the 80s
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 }.
-
Aug 2nd, 2003, 12:31 PM
#9
Lively Member
as i said, im not much of a PHP programmer , i just make counters and little comment scripts, no real apps.

-morrowasted
-
Aug 2nd, 2003, 12:33 PM
#10
Stuck in the 80s
Yeah, bgcolor is deprecated in HTML 4.01 (see here)
-
Aug 2nd, 2003, 12:37 PM
#11
Lively Member
okay then :-D
be switching that to
--------------------------------------------------------------
<style type="text/css">
BODY{
Background-color:#FDDCBD;
}
</style>
--------------------------------------------------------------

-morrowasted
-
Aug 2nd, 2003, 12:40 PM
#12
Stuck in the 80s
Originally posted by black_orb
WIDTH DOES accept percentage
Actually, width is also deprecated. So it doesn't matter.
-
Aug 2nd, 2003, 07:05 PM
#13
Addicted Member
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/
-
Aug 2nd, 2003, 10:33 PM
#14
Stuck in the 80s
black_orb, any luck on tracking it down?
-
Aug 3rd, 2003, 02:03 AM
#15
Frenzied Member
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'> </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.
-
Aug 3rd, 2003, 02:09 AM
#16
Stuck in the 80s
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...
-
Aug 3rd, 2003, 02:25 AM
#17
Frenzied Member
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
-
Aug 14th, 2003, 10:36 AM
#18
Thread Starter
New Member
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
-
Aug 14th, 2003, 11:15 AM
#19
Stuck in the 80s
Why don't you post the whole file and perhaps one of us could find the error?
-
Aug 14th, 2003, 11:22 AM
#20
Frenzied Member
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?
-
Aug 14th, 2003, 11:38 AM
#21
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|