Page 1 of 1
What's wrong with this
Posted: Fri Jan 30, 2004 5:48 pm
by John Cartwright
Code: Select all
<?php
echo "<table align="center">\n"
."<tr>\n"
."<td>\n";
if (isset($moreinfo){ ?>
<a href="javascript:void(0)" onClick="javascript:window.open('news.php?id=<?php echo $id ?>','myWindow','width=500','height=500');">To get more information click</a>
<? }else{
echo "";
}
echo "</td>\n"
."</tr>\n"
."</table>\n"
."<br>\n";
?>
I been staring at code all day and I believe I have lost my mind
Plz help I am getting parse error ty
Posted: Fri Jan 30, 2004 5:52 pm
by pickle
I had a professor in university that would do this - give us some code, not tell us what it's supposed to do, and expect us to fix it. Ya, he wasn't a popular guy. Maybe if you gave us a little more info it'd be easier for us to help. (This is meant in jest..... the part about my professor, not the part about wanting more info).
Posted: Fri Jan 30, 2004 5:56 pm
by John Cartwright
May if you read the code you would know what it did
its a table
in 1 row is checks if $moreinfo is set -if it is shows a link
-if not does nothing
Not very hard to understand is it?
And I also said what my problem is... I'm getting a parse error.
TY... think before you type.
Posted: Fri Jan 30, 2004 5:56 pm
by Unipus
I agree with pickle, but I also don't see anything wrong with it, aside from the fact that your ELSE is totally extraneous. But that won't affect anything. View source.
Posted: Fri Jan 30, 2004 5:57 pm
by Unipus
Hey, here's a wacky idea... if you're getting a parse error, why don't you TELL US WHAT IT IS.
Posted: Fri Jan 30, 2004 5:59 pm
by John Cartwright
nvm in if (isset($moreinfo) I changed it to if (isset($moreinfo))
Posted: Fri Jan 30, 2004 6:00 pm
by John Cartwright
My parse error was
Parse Error: parse error.
problem solve no more talkig ty
Posted: Fri Jan 30, 2004 6:06 pm
by Unipus
Then you need to fix your error reporting. You should be getting plenty of information more than that, most especially LINE NUMBERS that would have shown you the problem right away.
Posted: Sat Jan 31, 2004 10:24 am
by twigletmac
You post a code snippet that looks fine, refuse to give the the full error and when you solve the problem don't bother saying what you did. Please read the posting guidelines (first link in my sig).
We are all volunteers here and you are not the only person who needs help, you have to help us help you. You too should think before you type.
Mac