ecabrera Posted August 20, 2011 Share Posted August 20, 2011 when i upload this code and refresh the page nothing shows up the only thing htat shows up is HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. plz helop <?php $title = "Home"; ?> <?php require("styles/top.php"); ?> <?php if ($username){ echo "<table> </div></td> </tr> <tr> <td width="244" valign="top"><br /> <form id="form1" name="form1" method="post" action="search_results.php" style="margin-left:20px;"> <input name="var" type="text" class="size12" id="var" style="width:124px; background-color: #A4D1FF;" /> <input name="button" type="submit" class="size11" id="button" value="Search" /> </form> <br /> <div id="leftNav" style="margin-left:22px;"> <!-- Start tv --> <strong><font color="#FFFFFF"><span class="size16">TV</span></font></strong><br /> <a href="tv.php?c=tv&sc=cartoons">Cartoons <font size="-3" color="#FFFFFF"></font></a><br /><a href="tv.php?c=tv&sc=news">News <font size="-3" color="#FFFFFF"></font></a><br /><a href="tv.php?c=tv&sc=adventures">Adventures <font size="-3" color="#FFFFFF"></font></a><br /><a href="tv.php?c=tv&sc=horror">Horror<font size="-3" color="#FFFFFF"></font></a><br /><a href="tv.php?c=tv&sc=Drama">Drama<font size="-3" color="#FFFFFF"></font></a><br><br /> //End TV --> // Start Videos --> <strong><font color="#FFFFFF"><span class="size16">Videos</span></font></strong><br /> <a href="videos.php?c=videoss&sc=children">Children <font size="-3" color="#FFFFFF"></font></a><br /><a href="videos.php?c=videos&sc=music">Music<font size="-3" color="#FFFFFF"></font></a><br /><a href="videos.php?c=videos&sc=comedy">Comedy<font size="-3" color="#FFFFFF"></font></a><br /><a href="videos.php?c=videos&sc=youtubemovies">Youtube Movies <font size="-3" color="#FFFFFF"></font></a><br /><a href="videos.php?c=videos&sc=sports">Sports <font size="-3" color="#FFFFFF"></font></a><br /> <br> <!-- End videos--> <!-- Start Movies --> <strong><font color="#FFFFFF"><span class="size16">Movies</span></font></strong><br /> <a href="movies.php?c=movies&sc=comedy">Comedy <font size="-3" color="#FFFFFF"></font></a><br /> <a href="movies.php?c=movies&sc=action">Action <font size="-3" color="#FFFFFF"></font></a><br /><a href="movies.php?c=movies&sc=adventure">Adventures <font size="-3" color="#FFFFFF"></font></a> <a href="movies.php?c=movies&sc=horror">horror <font size="-3" color="#FFFFFF"></font></a><br /> <a href="movies.php?c=movies&sc=drama">Drama<font size="-3" color="#FFFFFF"></font></a><br /><br /> <br /> //End Movies </div> </table>"; } else echo "<h2><font color='red'>You must be logged view this Part.</font></h2>"; ?> <?php require("styles/bottom.php"); ?> Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/ Share on other sites More sharing options...
codefossa Posted August 20, 2011 Share Posted August 20, 2011 When you use a " for an echo, you gotta either use ' or \" inside it. You're escaping and rejoining the echo in the middle of the HTML many times. You also didn't close your if statement. Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/#findComment-1259694 Share on other sites More sharing options...
codefossa Posted August 20, 2011 Share Posted August 20, 2011 Messy but here's your code workin' .. <?php $title = "Home"; require("styles/top.php"); if ($username){ echo '<table> </div></td> </tr> <tr> <td width="244" valign="top"><br /> <form id="form1" name="form1" method="post" action="search_results.php" style="margin-left:20px;"> <input name="var" type="text" class="size12" id="var" style="width:124px; background-color: #A4D1FF;" /> <input name="button" type="submit" class="size11" id="button" value="Search" /> </form> <br /> <div id="leftNav" style="margin-left:22px;"> <!-- Start tv --> <strong><font color="#FFFFFF"><span class="size16">TV</span></font></strong><br /> <a href="tv.php?c=tv&sc=cartoons">Cartoons <font size="-3" color="#FFFFFF"></font></a><br /><a href="tv.php?c=tv&sc=news">News <font size="-3" color="#FFFFFF"></font></a><br /><a href="tv.php?c=tv&sc=adventures">Adventures <font size="-3" color="#FFFFFF"></font></a><br /><a href="tv.php?c=tv&sc=horror">Horror<font size="-3" color="#FFFFFF"></font></a><br /><a href="tv.php?c=tv&sc=Drama">Drama<font size="-3" color="#FFFFFF"></font></a><br><br /> //End TV --> // Start Videos --> <strong><font color="#FFFFFF"><span class="size16">Videos</span></font></strong><br /> <a href="videos.php?c=videoss&sc=children">Children <font size="-3" color="#FFFFFF"></font></a><br /><a href="videos.php?c=videos&sc=music">Music<font size="-3" color="#FFFFFF"></font></a><br /><a href="videos.php?c=videos&sc=comedy">Comedy<font size="-3" color="#FFFFFF"></font></a><br /><a href="videos.php?c=videos&sc=youtubemovies">Youtube Movies <font size="-3" color="#FFFFFF"></font></a><br /><a href="videos.php?c=videos&sc=sports">Sports <font size="-3" color="#FFFFFF"></font></a><br /> <br> <!-- End videos--> <!-- Start Movies --> <strong><font color="#FFFFFF"><span class="size16">Movies</span></font></strong><br /> <a href="movies.php?c=movies&sc=comedy">Comedy <font size="-3" color="#FFFFFF"></font></a><br /> <a href="movies.php?c=movies&sc=action">Action <font size="-3" color="#FFFFFF"></font></a><br /><a href="movies.php?c=movies&sc=adventure">Adventures <font size="-3" color="#FFFFFF"></font></a> <a href="movies.php?c=movies&sc=horror">horror <font size="-3" color="#FFFFFF"></font></a><br /> <a href="movies.php?c=movies&sc=drama">Drama<font size="-3" color="#FFFFFF"></font></a><br /><br /> <br /> //End Movies </div> </table>"; } else echo "<h2><font color="red">You must be logged view this Part.</font></h2>'; } require("styles/bottom.php"); ?> Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/#findComment-1259697 Share on other sites More sharing options...
ecabrera Posted August 20, 2011 Author Share Posted August 20, 2011 but its not doing what i want it to do i want my users that or not login to see "<h2><font color="red">You must be logged view this Part.</font></h2>" but instead it is showing everything altogether Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/#findComment-1259698 Share on other sites More sharing options...
codefossa Posted August 20, 2011 Share Posted August 20, 2011 Didn't see that part because your formatting is horrid. Sorry. <?php $title = "Home"; require("styles/top.php"); if ($username){ echo '<table> </div></td> </tr> <tr> <td width="244" valign="top"><br /> <form id="form1" name="form1" method="post" action="search_results.php" style="margin-left:20px;"> <input name="var" type="text" class="size12" id="var" style="width:124px; background-color: #A4D1FF;" /> <input name="button" type="submit" class="size11" id="button" value="Search" /> </form> <br /> <div id="leftNav" style="margin-left:22px;"> <!-- Start tv --> <strong><font color="#FFFFFF"><span class="size16">TV</span></font></strong><br /> <a href="tv.php?c=tv&sc=cartoons">Cartoons <font size="-3" color="#FFFFFF"></font></a><br /><a href="tv.php?c=tv&sc=news">News <font size="-3" color="#FFFFFF"></font></a><br /><a href="tv.php?c=tv&sc=adventures">Adventures <font size="-3" color="#FFFFFF"></font></a><br /><a href="tv.php?c=tv&sc=horror">Horror<font size="-3" color="#FFFFFF"></font></a><br /><a href="tv.php?c=tv&sc=Drama">Drama<font size="-3" color="#FFFFFF"></font></a><br><br /> //End TV --> // Start Videos --> <strong><font color="#FFFFFF"><span class="size16">Videos</span></font></strong><br /> <a href="videos.php?c=videoss&sc=children">Children <font size="-3" color="#FFFFFF"></font></a><br /><a href="videos.php?c=videos&sc=music">Music<font size="-3" color="#FFFFFF"></font></a><br /><a href="videos.php?c=videos&sc=comedy">Comedy<font size="-3" color="#FFFFFF"></font></a><br /><a href="videos.php?c=videos&sc=youtubemovies">Youtube Movies <font size="-3" color="#FFFFFF"></font></a><br /><a href="videos.php?c=videos&sc=sports">Sports <font size="-3" color="#FFFFFF"></font></a><br /> <br> <!-- End videos--> <!-- Start Movies --> <strong><font color="#FFFFFF"><span class="size16">Movies</span></font></strong><br /> <a href="movies.php?c=movies&sc=comedy">Comedy <font size="-3" color="#FFFFFF"></font></a><br /> <a href="movies.php?c=movies&sc=action">Action <font size="-3" color="#FFFFFF"></font></a><br /><a href="movies.php?c=movies&sc=adventure">Adventures <font size="-3" color="#FFFFFF"></font></a> <a href="movies.php?c=movies&sc=horror">horror <font size="-3" color="#FFFFFF"></font></a><br /> <a href="movies.php?c=movies&sc=drama">Drama<font size="-3" color="#FFFFFF"></font></a><br /><br /> <br /> //End Movies </div> </table>'; } else echo '<h2><font color="red">You must be logged view this Part.</font></h2>'; } require("styles/bottom.php"); ?> Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/#findComment-1259702 Share on other sites More sharing options...
ecabrera Posted August 20, 2011 Author Share Posted August 20, 2011 gives me HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/#findComment-1259703 Share on other sites More sharing options...
darkfreaks Posted August 20, 2011 Share Posted August 20, 2011 your missing a bracket after ELSE Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/#findComment-1259706 Share on other sites More sharing options...
ecabrera Posted August 20, 2011 Author Share Posted August 20, 2011 nope still doesnt work Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/#findComment-1259709 Share on other sites More sharing options...
darkfreaks Posted August 20, 2011 Share Posted August 20, 2011 i condensed your html using EOF then echo <?php $title = "Home"; require("styles/top.php"); if (isset($username)){ $html=<<<EOF <table> <tr> <td width="244" valign="top"><br /> <form id="form1" name="form1" method="post" action="search_results.php" style= "margin-left:20px;"><input name="var" type="text" class="size12" id="var" style= "width:124px; background-color: #A4D1FF;" /> <input name="button" type="submit" class= "size11" id="button" value="Search" /></form> <br /> <div id="leftNav" style="margin-left:22px;"><!-- Start tv --><strong><font color= "#FFFFFF"><span class="size16">TV</span></font></strong><br /> <a href="tv.php?c=tv&sc=cartoons">Cartoons </a><br /> <a href="tv.php?c=tv&sc=news">News </a><br /> <a href="tv.php?c=tv&sc=adventures">Adventures </a><br /> <a href="tv.php?c=tv&sc=horror">Horror</a><br /> <a href="tv.php?c=tv&sc=Drama">Drama</a><br /> <br /> //End TV --> // Start Videos --> <strong><font color="#FFFFFF"><span class= "size16">Videos</span></font></strong><br /> <a href="videos.php?c=videoss&sc=children">Children </a><br /> <a href="videos.php?c=videos&sc=music">Music</a><br /> <a href="videos.php?c=videos&sc=comedy">Comedy</a><br /> <a href="videos.php?c=videos&sc=youtubemovies">Youtube Movies </a><br /> <a href="videos.php?c=videos&sc=sports">Sports </a><br /> <br /> <!-- End videos--> <!-- Start Movies --> <strong><font color="#FFFFFF"><span class= "size16">Movies</span></font></strong><br /> <a href="movies.php?c=movies&sc=comedy">Comedy </a><br /> <a href="movies.php?c=movies&sc=action">Action </a><br /> <a href="movies.php?c=movies&sc=adventure">Adventures</a> <a href= "movies.php?c=movies&sc=horror">horror </a><br /> <a href="movies.php?c=movies&sc=drama">Drama</a><br /> <br /> <br /> //End Movies</div> </td> </tr> </table><table> <tr> <td width="244" valign="top"><br /> <form id="form1" name="form1" method="post" action="search_results.php" style= "margin-left:20px;"><input name="var" type="text" class="size12" id="var" style= "width:124px; background-color: #A4D1FF;" /> <input name="button" type="submit" class= "size11" id="button" value="Search" /></form> <br /> <div id="leftNav" style="margin-left:22px;"><!-- Start tv --><strong><font color= "#FFFFFF"><span class="size16">TV</span></font></strong><br /> <a href="tv.php?c=tv&sc=cartoons">Cartoons </a><br /> <a href="tv.php?c=tv&sc=news">News </a><br /> <a href="tv.php?c=tv&sc=adventures">Adventures </a><br /> <a href="tv.php?c=tv&sc=horror">Horror</a><br /> <a href="tv.php?c=tv&sc=Drama">Drama</a><br /> <br /> //End TV --> // Start Videos --> <strong><font color="#FFFFFF"><span class= "size16">Videos</span></font></strong><br /> <a href="videos.php?c=videoss&sc=children">Children </a><br /> <a href="videos.php?c=videos&sc=music">Music</a><br /> <a href="videos.php?c=videos&sc=comedy">Comedy</a><br /> <a href="videos.php?c=videos&sc=youtubemovies">Youtube Movies </a><br /> <a href="videos.php?c=videos&sc=sports">Sports </a><br /> <br /> <!-- End videos--> <!-- Start Movies --> <strong><font color="#FFFFFF"><span class= "size16">Movies</span></font></strong><br /> <a href="movies.php?c=movies&sc=comedy">Comedy </a><br /> <a href="movies.php?c=movies&sc=action">Action </a><br /> <a href="movies.php?c=movies&sc=adventure">Adventures</a> <a href= "movies.php?c=movies&sc=horror">horror </a><br /> <a href="movies.php?c=movies&sc=drama">Drama</a><br /> <br /> <br /> //End Movies</div> </td> </tr> </table> EOF; } else{ echo '<h2><font color="red">You must be logged in to view this Part.</font></h2>'; } require("styles/bottom.php"); ?> also where is title supposed to go? it seems kind of useless.... Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/#findComment-1259716 Share on other sites More sharing options...
darkfreaks Posted August 20, 2011 Share Posted August 20, 2011 oh i left something out after the $html part echo it out or it won't work Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/#findComment-1259718 Share on other sites More sharing options...
ecabrera Posted August 20, 2011 Author Share Posted August 20, 2011 do you mean like this rt wat $html=<<<EOF echo "<table> <tr> <td width="244" valign="top"><br /> <form id="form1" name="form1" method="post" action="search_results.php" style= "margin-left:20px;"><input name="var" type="text" class="size12" id="var" style= "width:124px; background-color: #A4D1FF;" /> <input name="button" type="submit" class= "size11" id="button" value="Search" /></form> <br /> <div id="leftNav" style="margin-left:22px;"><!-- Start tv --><strong><font color= "#FFFFFF"><span class="size16">TV</span></font></strong><br /> <a href="tv.php?c=tv&sc=cartoons">Cartoons </a><br /> <a href="tv.php?c=tv&sc=news">News </a><br /> <a href="tv.php?c=tv&sc=adventures">Adventures </a><br /> <a href="tv.php?c=tv&sc=horror">Horror</a><br /> <a href="tv.php?c=tv&sc=Drama">Drama</a><br /> <br /> //End TV --> // Start Videos --> <strong><font color="#FFFFFF"><span class= "size16">Videos</span></font></strong><br /> <a href="videos.php?c=videoss&sc=children">Children </a><br /> <a href="videos.php?c=videos&sc=music">Music</a><br /> <a href="videos.php?c=videos&sc=comedy">Comedy</a><br /> <a href="videos.php?c=videos&sc=youtubemovies">Youtube Movies </a><br /> <a href="videos.php?c=videos&sc=sports">Sports </a><br /> <br /> <!-- End videos--> <!-- Start Movies --> <strong><font color="#FFFFFF"><span class= "size16">Movies</span></font></strong><br /> <a href="movies.php?c=movies&sc=comedy">Comedy </a><br /> <a href="movies.php?c=movies&sc=action">Action </a><br /> <a href="movies.php?c=movies&sc=adventure">Adventures</a> <a href= "movies.php?c=movies&sc=horror">horror </a><br /> <a href="movies.php?c=movies&sc=drama">Drama</a><br /> <br /> <br /> //End Movies</div> </td> </tr> </table><table> <tr> <td width="244" valign="top"><br /> <form id="form1" name="form1" method="post" action="search_results.php" style= "margin-left:20px;"><input name="var" type="text" class="size12" id="var" style= "width:124px; background-color: #A4D1FF;" /> <input name="button" type="submit" class= "size11" id="button" value="Search" /></form> <br /> <div id="leftNav" style="margin-left:22px;"><!-- Start tv --><strong><font color= "#FFFFFF"><span class="size16">TV</span></font></strong><br /> <a href="tv.php?c=tv&sc=cartoons">Cartoons </a><br /> <a href="tv.php?c=tv&sc=news">News </a><br /> <a href="tv.php?c=tv&sc=adventures">Adventures </a><br /> <a href="tv.php?c=tv&sc=horror">Horror</a><br /> <a href="tv.php?c=tv&sc=Drama">Drama</a><br /> <br /> //End TV --> // Start Videos --> <strong><font color="#FFFFFF"><span class= "size16">Videos</span></font></strong><br /> <a href="videos.php?c=videoss&sc=children">Children </a><br /> <a href="videos.php?c=videos&sc=music">Music</a><br /> <a href="videos.php?c=videos&sc=comedy">Comedy</a><br /> <a href="videos.php?c=videos&sc=youtubemovies">Youtube Movies </a><br /> <a href="videos.php?c=videos&sc=sports">Sports </a><br /> <br /> <!-- End videos--> <!-- Start Movies --> <strong><font color="#FFFFFF"><span class= "size16">Movies</span></font></strong><br /> <a href="movies.php?c=movies&sc=comedy">Comedy </a><br /> <a href="movies.php?c=movies&sc=action">Action </a><br /> <a href="movies.php?c=movies&sc=adventure">Adventures</a> <a href= "movies.php?c=movies&sc=horror">horror </a><br /> <a href="movies.php?c=movies&sc=drama">Drama</a><br /> <br /> <br /> //End Movies</div> </td> </tr> </table>" EOF; Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/#findComment-1259729 Share on other sites More sharing options...
Username: Posted August 20, 2011 Share Posted August 20, 2011 gives me HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. This code runs fine on my server. <?php $title = "Home"; $username = "user"; if(file_exists("styles/top.php")) { require("styles/top.php"); } else { echo "styles/top.php is missing"; } if (isset($username) && strlen(trim($username)) >= 1) { echo "<br>Welcome $username!"; echo " <table> </div> </td> </tr> <tr> <td width='244' valign='top'><br /> <form id='form1' name='form1' method='post' action='search_results.php' style='margin-left:20px;'> <input name='var' type='text' class='size12' id='var' style='width:124px; background-color: #A4D1FF;' /> <input name='button' type='submit' class='size11' id='button' value='Search' /> </form> <br /> <div id='leftNav' style='margin-left:22px;'> <!-- Start tv --> <strong> <font color='#FFFFFF'><span class='size16'>TV</span></font></strong><br /> <a href='tv.php?c=tv&sc=cartoons'>Cartoons <font size='-3' color='#FFFFFF'></font></a><br /><a href='tv.php?c=tv&sc=news'>News <font size='-3' color='#FFFFFF'></font></a><br /><a href='tv.php?c=tv&sc=adventures'>Adventures <font size='-3' color='#FFFFFF'></font></a><br /><a href='tv.php?c=tv&sc=horror'>Horror<font size='-3' color='#FFFFFF'></font></a><br /><a href='tv.php?c=tv&sc=Drama'>Drama<font size='-3' color='#FFFFFF'></font></a><br><br /> <!-- End TV --> <!-- Start Videos --> <strong> <font color='#FFFFFF'><span class='size16'>Videos</span></font></strong><br /> <a href='videos.php?c=videoss&sc=children'>Children <font size='-3' color='#FFFFFF'></font></a><br /><a href='videos.php?c=videos&sc=music'>Music<font size='-3' color='#FFFFFF'></font></a><br /><a href='videos.php?c=videos&sc=comedy'>Comedy<font size='-3' color='#FFFFFF'></font></a><br /><a href='videos.php?c=videos&sc=youtubemovies'>Youtube Movies <font size='-3' color='#FFFFFF'></font></a><br /><a href='videos.php?c=videos&sc=sports'>Sports <font size='-3' color='#FFFFFF'></font></a><br /> <br> <!-- End videos--> <!-- Start Movies --> <strong><font color='#FFFFFF'><span class='size16'>Movies</span></font></strong><br /> <a href='movies.php?c=movies&sc=comedy'>Comedy <font size='-3' color='#FFFFFF'></font></a><br /> <a href='movies.php?c=movies&sc=action'>Action <font size='-3' color='#FFFFFF'></font></a><br /><a href='movies.php?c=movies&sc=adventure'>Adventures <font size='-3' color='#FFFFFF'></font></a> <a href='movies.php?c=movies&sc=horror'>horror <font size='-3' color='#FFFFFF'></font></a><br /> <a href='movies.php?c=movies&sc=drama'>Drama<font size='-3' color='#FFFFFF'></font></a><br /><br /> <br /> <!-- End Movies --> </div> </table>"; } else { echo "<h2><font color='red'>You must be logged view this Part.</font></h2>"; } if(file_exists("styles/bottom.php")) { require("styles/bottom.php"); } else { echo "styles/bottom.php is missing"; } ?> Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/#findComment-1259757 Share on other sites More sharing options...
ecabrera Posted August 20, 2011 Author Share Posted August 20, 2011 thanks works fine Link to comment https://forums.phpfreaks.com/topic/245266-http-error-500/#findComment-1259770 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.