glenelkins Posted May 8, 2009 Share Posted May 8, 2009 Hi I dont know why, but when i look at a web page i created in the browser, there is a random digit 1 appearing at the bottom of the page. In the actual XHTML code there is absolutely nothing to tell the browser to put a number 1 down there has anyone come accross this kind of thing before? Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/ Share on other sites More sharing options...
Maq Posted May 8, 2009 Share Posted May 8, 2009 Hi I dont know why, but when i look at a web page i created in the browser, there is a random digit 1 appearing at the bottom of the page. In the actual XHTML code there is absolutely nothing to tell the browser to put a number 1 down there has anyone come accross this kind of thing before? No, never experienced that before. There has to be something that outputs a '1'. Do you have any includes/requires? Is your page static HTML? Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829396 Share on other sites More sharing options...
JonnoTheDev Posted May 8, 2009 Share Posted May 8, 2009 Only ever seen characters appear when saving files with a unicode signature (BOM) but that is a wierd character that appears before any HTML is outputted. Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829433 Share on other sites More sharing options...
glenelkins Posted May 8, 2009 Author Share Posted May 8, 2009 hi nope there are no includes. its just a flat html file. this number 1 just randomly appears when viewed in browser Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829482 Share on other sites More sharing options...
Maq Posted May 8, 2009 Share Posted May 8, 2009 Post the code please. Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829490 Share on other sites More sharing options...
Mchl Posted May 8, 2009 Share Posted May 8, 2009 It means you have been selected. We will contact you soon. Trust no one. Are you hosting it on your computer, or with a hosting company? Might be something added by webserver. Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829494 Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted May 8, 2009 Share Posted May 8, 2009 Never see that before. Post the URL and .htaccess it can help. In .htaccess if configured properly you can add file like that : php_value auto_prepend_file "header.php" php_value auto_append_file "footer.php" Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829496 Share on other sites More sharing options...
Mchl Posted May 8, 2009 Share Posted May 8, 2009 These can also be defined in php.ini Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829500 Share on other sites More sharing options...
glenelkins Posted May 8, 2009 Author Share Posted May 8, 2009 hi actually yeh there is an include there, it just brings in a file called footer.php <?= require_once ( '../footer.php' ); ?> I have now found that for some strange reason this is causing the 1 digit appearing. If i take all the html from footer.php and put it into the file in question the number 1 vanishes! Strangest thing is, the footer is included in all pages on the site, and only makes the problem on 1 of them! There is absolutely nothing in the xhtml code to cause this stupid issue, and iv never seen a require function put a digit where i dont want it Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829513 Share on other sites More sharing options...
Ken2k7 Posted May 8, 2009 Share Posted May 8, 2009 Oh... read the man of require_once. It returns 1 on success. Get rid of the = and put php. Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829514 Share on other sites More sharing options...
glenelkins Posted May 8, 2009 Author Share Posted May 8, 2009 here is the file that is showing the 1. it appears at the end of the </div> on line: 158 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="css/main.css" /> <link rel="stylesheet" type="text/css" href="css/postcode.css" /> <link rel="stylesheet" type="text/css" href="css/theatre.css" /> <link rel="stylesheet" type="text/css" href="css/pantomime.css" /> <link rel="stylesheet" type="text/css" href="css/show.css" /> <title>QDOS Portal - Make a booking</title> <script type="text/javascript" src="lib/js/jquery.js"></script> <script type="text/javascript" src="lib/js/animatedcollapse.js"></script> <script src="lib/js/functions.js" type="text/javascript"></script> <script type="text/javascript"> animatedcollapse.addDiv('show_pantomimes', 'fade=5, speed=1000, hide=0'); animatedcollapse.addDiv('show_pantomime_theatres','fade=5,speed=1000,hide=1'); animatedcollapse.init(); </script> </head> <body> <div id="main_container"> <div id="inner_container"> <div id="header_container"> <div id="header"> <div id="header_left"> <div id="logo_area"><a href=""><img src="images/logo.png" alt="" /></a></div> </div> <div id="header_right"> <div id="header_right_top"> <div id="date_area"><?= date ( 'd F Y', time() ); ?></div> </div> <div id="nav_area"> <ul class="navigation"> <li class="home"><a href="../index.php">Home</a></li> <li class="tickets"><a href="index.php">Book Tickets</a></li> <li class="about"><a href="../about.php">About Qdos Group</a></li> <li class="news"><a href="../news.php">News</a></li> <li class="contact"><a href="../contact.php">Contact</a></li> <li class="careers"><a href="../careers.php">Careers</a></li> </ul> </div> </div> </div> </div> <div id="content_container"> <div id="content_top"></div> <div id="content_middle_container"> <div id="content_middle"> <h1>Ticket Search</h1> <p class="welcome_text">Please use the options below to search for tickets...</p> <div id="search_by_container"> <ul class="search_by"> <li class="postcode"><a href="javascript::void(0);" onClick="show_postcode();">Postcode Search</a></li> <li class="theatre"><a href="javascript::void(0);" onClick="show_theatre();">Theatre Search</a></li> <li class="pantomime"><a href="javascript::void(0);" onClick="show_pantomimes();">Pantomime Search</a></li> <li class="show"><a href="javascript::void(0);" onClick="show_productions();">Show Search</a></li> <li id="loading" class="loading" style="display: none;"><img src="images/loading2.gif"></li> </ul> </div> <!-- POSTCODE SEARCH BOX --> <div id="postcode_search" style="display:none;"> <form action="index.php" method="post" name="postcode_search_form"> <fieldset> <ul> <li><span>Enter your postcode:</span></li> <li><input type="text" name="postcode" /></li> <li><input type="submit" value="" class="go_button" /></li> </ul> <input type="hidden" name="action" value="show_map" /> </fieldset> </form> </div> <!-- /////////////////// --> <!-- List Of HQ Theatres --> <div id="show_theatre" style="display:none; padding: 16px 0px 10px 0px;"></div> <!-- /////////////////// --> <!-- List Of Pantomimes --> <div id="show_pantomimes" style="display: none; padding: 16px 0px 10px 0px;"></div> <!-- ////////////////// --> <!-- List Of Theatres Relating To Pantomimes --> <div id="show_pantomime_theatres" style="display: none; padding: 16px 0px 10px 0px;"></div> <!-- ////////////////// --> <!-- List Of Productions --> <div id="show_productions" style="display:none; padding: 16px 0px 10px 0px;"></div> <!-- /////////////////// --> <!-- GOOGLE MAP CODE --> <?php echo ( !empty ( $user_message ) ) ? '<div id="message" class="message" style="margin: 10px 0px 0px 22px;">' . $user_message . '</div>' : ''; ?> <!-- Container For Google Map --> <div id="map" style="display:none; width: 677px; height: 400px; margin: 10px 0px 0px 22px; padding:2px; border: 1px solid #d6d4d6;"></div> <!-- //////////////////////// --> <div id="key" style="display:none; margin: 10px 0px 0px 0px; text-align:center;"><img src="images/key.png" alt="Map Key" /></div> <!-- Actual Map Points Working Out Code --> <?php require_once ( 'google_map.php' ); ?> <!-- ///////////////////////////////// --> </div> </div> <div id="content_bottom"></div> </div> <?= require_once( '../footer.php' ); ?> </div> </div> </body> </html> and here is footer.php <div id="footer_container"> <div id="footer"> <div id="footer_logo"><img src="images/footerlogo.png" alt="" /><br />© Qdos Entertainment PLC <?= date ( 'Y', time() ); ?></div> <div id="footer_navigation"> <div class="float_left"> <ul> <li><a href="../index.php">Home</a></li> <li><a href="../company-page/hqtheatres.php">HQ Theatres</a></li> <li><a href="../company-page/hqhospitality.php">HQ Hospitality</a></li> <li><a href="../company-page/qdosmediasolutions.php">Adverset Media Solutions</a></li> <li><a href="../company-page/qdospantomimes.php">Pantomimes Division</a></li> </ul> </div> <div class="float_left" style="margin-left: 17px; padding-left: 17px; background: url('images/divider.gif') repeat-y;"> <ul> <li><a href="../company-page/qdosproductions.php">Productions Division</a></li> <li><a href="../company-page/theentertainmentdepartment.php">TED</a></li> <li><a href="../company-page/qdoshiredepartment.php">Production Hires</a></li> <li><a href="../company-page/tedav.php">TED AV</a></li> <li><a href="../company-page/inernationalartistes.php">International Artistes</a></li> </ul> </div> <div class="float_left" style="margin-left: 17px; padding-left: 17px; background: url('images/divider.gif') repeat-y;"> <ul> <li><a href="../company-page/qvoice.php">Qvoice</a></li> <li><a href="../booking-page/index.php">Book Tickets</a></li> <li><a href="../about.php">About Qdos Group</a></li> <li><a href="../news.php">News</a></li> <li><a href="../contact.php">Contact</a></li> <li><a href="../careers.php">Careers</a></li> <!--<li><a href="../company-page/qdoscars.php">Executive Cars</a></li>--> </ul> </div> </div> </div> </div> and here is the raw html from the web browser source...see the number 1 at the bottom?? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="css/main.css" /> <link rel="stylesheet" type="text/css" href="css/postcode.css" /> <link rel="stylesheet" type="text/css" href="css/theatre.css" /> <link rel="stylesheet" type="text/css" href="css/pantomime.css" /> <link rel="stylesheet" type="text/css" href="css/show.css" /> <title>QDOS Portal - Make a booking</title> <script type="text/javascript" src="lib/js/jquery.js"></script> <script type="text/javascript" src="lib/js/animatedcollapse.js"></script> <script src="lib/js/functions.js" type="text/javascript"></script> <script type="text/javascript"> animatedcollapse.addDiv('show_pantomimes', 'fade=5, speed=1000, hide=0'); animatedcollapse.addDiv('show_pantomime_theatres','fade=5,speed=1000,hide=1'); animatedcollapse.init(); </script> </head> <body> <div id="main_container"> <div id="inner_container"> <div id="header_container"> <div id="header"> <div id="header_left"> <div id="logo_area"><a href=""><img src="images/logo.png" alt="" /></a></div> </div> <div id="header_right"> <div id="header_right_top"> <div id="date_area">08 May 2009</div> </div> <div id="nav_area"> <ul class="navigation"> <li class="home"><a href="../index.php">Home</a></li> <li class="tickets"><a href="index.php">Book Tickets</a></li> <li class="about"><a href="../about.php">About Qdos Group</a></li> <li class="news"><a href="../news.php">News</a></li> <li class="contact"><a href="../contact.php">Contact</a></li> <li class="careers"><a href="../careers.php">Careers</a></li> </ul> </div> </div> </div> </div> <div id="content_container"> <div id="content_top"></div> <div id="content_middle_container"> <div id="content_middle"> <h1>Ticket Search</h1> <p class="welcome_text">Please use the options below to search for tickets...</p> <div id="search_by_container"> <ul class="search_by"> <li class="postcode"><a href="javascript::void(0);" onClick="show_postcode();">Postcode Search</a></li> <li class="theatre"><a href="javascript::void(0);" onClick="show_theatre();">Theatre Search</a></li> <li class="pantomime"><a href="javascript::void(0);" onClick="show_pantomimes();">Pantomime Search</a></li> <li class="show"><a href="javascript::void(0);" onClick="show_productions();">Show Search</a></li> <li id="loading" class="loading" style="display: none;"><img src="images/loading2.gif"></li> </ul> </div> <!-- POSTCODE SEARCH BOX --> <div id="postcode_search" style="display:none;"> <form action="index.php" method="post" name="postcode_search_form"> <fieldset> <ul> <li><span>Enter your postcode:</span></li> <li><input type="text" name="postcode" /></li> <li><input type="submit" value="" class="go_button" /></li> </ul> <input type="hidden" name="action" value="show_map" /> </fieldset> </form> </div> <!-- /////////////////// --> <!-- List Of HQ Theatres --> <div id="show_theatre" style="display:none; padding: 16px 0px 10px 0px;"></div> <!-- /////////////////// --> <!-- List Of Pantomimes --> <div id="show_pantomimes" style="display: none; padding: 16px 0px 10px 0px;"></div> <!-- ////////////////// --> <!-- List Of Theatres Relating To Pantomimes --> <div id="show_pantomime_theatres" style="display: none; padding: 16px 0px 10px 0px;"></div> <!-- ////////////////// --> <!-- List Of Productions --> <div id="show_productions" style="display:none; padding: 16px 0px 10px 0px;"></div> <!-- /////////////////// --> <!-- GOOGLE MAP CODE --> <!-- Container For Google Map --> <div id="map" style="display:none; width: 677px; height: 400px; margin: 10px 0px 0px 22px; padding:2px; border: 1px solid #d6d4d6;"></div> <!-- //////////////////////// --> <div id="key" style="display:none; margin: 10px 0px 0px 0px; text-align:center;"><img src="images/key.png" alt="Map Key" /></div> <!-- Actual Map Points Working Out Code --> <!-- ///////////////////////////////// --> </div> </div> <div id="content_bottom"></div> </div> <div id="footer_container"> <div id="footer"> <div id="footer_logo"><img src="images/footerlogo.png" alt="" /><br />© Qdos Entertainment PLC 2009</div> <div id="footer_navigation"> <div class="float_left"> <ul> <li><a href="../index.php">Home</a></li> <li><a href="../company-page/hqtheatres.php">HQ Theatres</a></li> <li><a href="../company-page/hqhospitality.php">HQ Hospitality</a></li> <li><a href="../company-page/qdosmediasolutions.php">Adverset Media Solutions</a></li> <li><a href="../company-page/qdospantomimes.php">Pantomimes Division</a></li> </ul> </div> <div class="float_left" style="margin-left: 17px; padding-left: 17px; background: url('images/divider.gif') repeat-y;"> <ul> <li><a href="../company-page/qdosproductions.php">Productions Division</a></li> <li><a href="../company-page/theentertainmentdepartment.php">TED</a></li> <li><a href="../company-page/qdoshiredepartment.php">Production Hires</a></li> <li><a href="../company-page/tedav.php">TED AV</a></li> <li><a href="../company-page/inernationalartistes.php">International Artistes</a></li> </ul> </div> <div class="float_left" style="margin-left: 17px; padding-left: 17px; background: url('images/divider.gif') repeat-y;"> <ul> <li><a href="../company-page/qvoice.php">Qvoice</a></li> <li><a href="../booking-page/index.php">Book Tickets</a></li> <li><a href="../about.php">About Qdos Group</a></li> <li><a href="../news.php">News</a></li> <li><a href="../contact.php">Contact</a></li> <li><a href="../careers.php">Careers</a></li> <!--<li><a href="../company-page/qdoscars.php">Executive Cars</a></li>--> </ul> </div> </div> </div> </div>1 </div> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829516 Share on other sites More sharing options...
glenelkins Posted May 8, 2009 Author Share Posted May 8, 2009 Ken2k7 good point! let me try that. the wierd thing is, only happens on 1 page Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829517 Share on other sites More sharing options...
Mchl Posted May 8, 2009 Share Posted May 8, 2009 <?= is shortcut for <?php echo That's why it displays return value from require Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829518 Share on other sites More sharing options...
glenelkins Posted May 8, 2009 Author Share Posted May 8, 2009 Ken2k7 you are a star!! wierdly enough only happening on that 1 page. Its always something really small and stupid you spend hours looking for and gives you head ache thanks! Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829520 Share on other sites More sharing options...
glenelkins Posted May 8, 2009 Author Share Posted May 8, 2009 Mchl ...i know! iv been programming years...i just overlooked that require returns 1 Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829525 Share on other sites More sharing options...
JonnoTheDev Posted May 8, 2009 Share Posted May 8, 2009 Mchl ...i know! iv been programming years...i just overlooked that require returns 1 ooooohhhh If you have been programming for years then you should know that this is bad practice <?= Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829529 Share on other sites More sharing options...
Maq Posted May 8, 2009 Share Posted May 8, 2009 I asked you if you had any requires and you said no... Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829535 Share on other sites More sharing options...
Ken2k7 Posted May 8, 2009 Share Posted May 8, 2009 hi nope there are no includes. its just a flat html file. this number 1 just randomly appears when viewed in browser Maq, it's true you asked if he had any include and or requires, but his answer isn't wrong either. Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829552 Share on other sites More sharing options...
Maq Posted May 8, 2009 Share Posted May 8, 2009 hi nope there are no includes. its just a flat html file. this number 1 just randomly appears when viewed in browser Maq, it's true you asked if he had any include and or requires, but his answer isn't wrong either. I just re-read and realized he only specifically said 'no' to includes. But I was assuming he meant both... Quote Link to comment https://forums.phpfreaks.com/topic/157348-anyone-ever-got-a-random-number-1-in-their-page/#findComment-829564 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.