porko2004 Posted August 31, 2011 Share Posted August 31, 2011 <?php if ($News_1_Status=="Y") echo <div class="newstitle" align="left"><?php echo $News_1_Date;?> <a href="<?php echo $News_1_URL;?>"><?php echo $News_1_Name;?></a></div><br>; else echo "Have a nice day!"; ?> how do i get the above script working any clue? Quote Link to comment https://forums.phpfreaks.com/topic/246077-little-question/ Share on other sites More sharing options...
KevinM1 Posted August 31, 2011 Share Posted August 31, 2011 Howabout giving us your definition of 'working' along with more than a handful of lines of code that is bereft of context? Quote Link to comment https://forums.phpfreaks.com/topic/246077-little-question/#findComment-1263765 Share on other sites More sharing options...
porko2004 Posted August 31, 2011 Author Share Posted August 31, 2011 so how should i do it? Quote Link to comment https://forums.phpfreaks.com/topic/246077-little-question/#findComment-1263766 Share on other sites More sharing options...
KevinM1 Posted August 31, 2011 Share Posted August 31, 2011 Reread what I wrote. Quote Link to comment https://forums.phpfreaks.com/topic/246077-little-question/#findComment-1263767 Share on other sites More sharing options...
Rifts Posted August 31, 2011 Share Posted August 31, 2011 I feel like some } and { would help Quote Link to comment https://forums.phpfreaks.com/topic/246077-little-question/#findComment-1263768 Share on other sites More sharing options...
KevinM1 Posted August 31, 2011 Share Posted August 31, 2011 I feel like some } and { would help Not necessary if there's only one statement in a clause, as is the case here. He did forget to quote his output in the first clause. That said there's no telling exactly what he wants solved as his question sucked. Quote Link to comment https://forums.phpfreaks.com/topic/246077-little-question/#findComment-1263772 Share on other sites More sharing options...
porko2004 Posted August 31, 2011 Author Share Posted August 31, 2011 sorry i was trying to say error is here <div class="newstitle" align="left"><?php echo $News_1_Date;?> <a href="<?php echo $News_1_URL;?>"><?php echo $News_1_Name;?></a></div><br> this doesnt appear its between " " Have a nice day! works fine but. Quote Link to comment https://forums.phpfreaks.com/topic/246077-little-question/#findComment-1263773 Share on other sites More sharing options...
thewooleymammoth Posted August 31, 2011 Share Posted August 31, 2011 I think this is what your looking for... <?php if ($News_1_Status=="Y"){ ?>//removed echo and added this. <div class="newstitle" align="left"><?php echo $News_1_Date;?> <a href="<?php echo $News_1_URL;?>"><?php echo $News_1_Name;?></a></div><br>; <?php }else echo "Have a nice day!"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/246077-little-question/#findComment-1263774 Share on other sites More sharing options...
porko2004 Posted August 31, 2011 Author Share Posted August 31, 2011 no that doesn't work correctly. It shows 00-00 New_1_Name ; else echo "Have a nice day!"; ?> i only want it to show one of them. Quote Link to comment https://forums.phpfreaks.com/topic/246077-little-question/#findComment-1263775 Share on other sites More sharing options...
thewooleymammoth Posted August 31, 2011 Share Posted August 31, 2011 http://w3schools.com/php/default.asp I dont think there is anything wrong with that code. I would make sure your knowledge of basic php is up to snuff. If that is not runnign right you might have to post more of the code so i can see what else is going on that could be screwing it up. Quote Link to comment https://forums.phpfreaks.com/topic/246077-little-question/#findComment-1263778 Share on other sites More sharing options...
porko2004 Posted August 31, 2011 Author Share Posted August 31, 2011 ty thewooleymammoth Quote Link to comment https://forums.phpfreaks.com/topic/246077-little-question/#findComment-1263779 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.