PHP - Weird Space Appearing On The Right
Howdy,
I am trying to create my website responsive. So far so good, but I got this weird white space on the right of my website and the user that is on a device smaller for 800px get a weird scroll bar. You can see it for yourself here, if you shrink the viewport to 800px or less - http://dyulgerova.in...ile_dyulgerova/
Here is my responsive CSS
/* For 800 pixels wide screens, MAX WIDTH. For example, tablets */ @media all and (max-width: 800px){ /* All images */ img {width:15vw;} /* The header */ #header{ background: #ff0000; width:100vw; } #section{ width:100vw; } #SkypeButton_Call_age_of_empires3_1_paraElement{ display:none; } #header_contact{ position: absolute; top: 120px; left: 394px; } #logo{ margin-top:20px; margin-left:0; } .langs{ margin-top:54px; margin-right:50px; } /* The nav bar */ #header #navigation{ width:100vw; height: 6.5vw; position:fixed; top:-15px; background: #000; height:10; } #header #navigation a{ border-left:1px solid #ff0000; } /* Below the header */ #main_div{ width:80vw; } footer{ width:80vw; } }And here is my NON-RESPONSIVE CSS * {margin: 0px; padding: 0px; } body { color: #E0E0E0; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; background: #9C1C6B; background: -webkit-radial-gradient(center top, circle, rgba(0,0,0,.2), rgba(0,0,0,.4)) fixed no-repeat, -webkit-linear-gradient(#9C1C6B, #CA278C) fixed no-repeat; background: -moz-radial-gradient(center top, circle, rgba(0,0,0,1), rgba(0,0,0,1)) fixed no-repeat, -moz-linear-gradient(#9C1C6B, #CA278C) fixed no-repeat; background: -o-radial-gradient(center top, circle, rgba(0,0,0,1), rgba(0,0,0,1)) fixed no-repeat, -o-linear-gradient(#9C1C6B, #CA278C) fixed no-repeat; background: radial-gradient(center top, circle, rgba(0,0,0,1), rgba(0,0,0,1)) fixed no-repeat, linear-gradient(#9C1C6B, #CA278C) fixed no-repeat; background-size:contain, contain; } a, a:active, a:visited, a:hover{ color: #FFE9E8; } h3 { margin-bottom:20px; } #header a, #header a:active, #header a:visited, #header a:hover{ color: #000; text-decoration:none; } #header{ width:100%; height:100%; background-color:#FFF; border-bottom:#F00 3px ridge; margin-bottom:50px; background-color:#FFF; background: -webkit-linear-gradient(#F3F3F3, #f6f5f3); background: -moz-linear-gradient(#F3F3F3, #f6f5f3); background: -o-linear-gradient(#F3F3F3, #f6f5f3); background: linear-gradient(#F3F3F3, #f6f5f3); } #logo{ margin-left:200px; } #header #section{ color:#000; margin:auto; } #header #navigation{ width:1000px; height:40px; margin:auto; clear:both; } #header #navigation li a{ color:#999; border-bottom:rgba(0,0,0,0) 3px ridge; width:90px; line-height:40px; float:left; text-align:center; font-style:bold; font-weight:bold; transition:all .3s; -webkit-transition:all .3s; } #header #navigation li a:hover{ color:#222; border-bottom:#000 3px ridge; } /* Makes a navigation item bigger when applied the class */ .long_nav{ width: 176px; } footer a, footer a:active, footer a:visited, footer a:hover{ color: #FFF; text-decoration:none; } figure{ width:200px; height:133px; padding:10px; margin:10px; color:#000; text-align:left; font-size:12px; float:left; background: -webkit-radial-gradient(center top, circle, #FFFFFF, #DFDFDF); background: -moz-radial-gradient(center top, circle, #FFFFFF, #F3F3F3); background: -o-radial-gradient(center top, circle, #FFFFFF, #F3F3F3); background: radial-gradient(center top, circle, #FFFFFF, #DFDFDF); } ul { list-style-type: none; } ol { list-style-type: none; } li { margin-top: 10px; } hgroup{ color:#FFF; padding:5px; border-left: #E47297 3px solid; } p { line-height: 180%; } fieldset { border: 0px currentColor; } img { border:0; max-width: 100%; height: auto; / width: 100%; /* Resizes automatically on any devise. */ } input { margin: 10px; padding: 10px; border-radius: 20px; border: 0px currentColor; width: 300px; height: 30px; } textarea { padding: 10px; border-radius: 10px; border: 0px currentColor; margin-top: 5px; } #main_div { background-color:rgba(0,0,0,.01); margin:auto; width:1000px; padding:10px; clear:both; background: -webkit-linear-gradient(rgba(0,0,0,.0), rgba(0,0,0,.02)); background: -moz-linear-gradient(rgba(0,0,0,.0), #f6f5f3); background: -o-linear-gradient(rgba(0,0,0,.0), #f6f5f3); background: linear-gradient(rgba(0,0,0,.0), rgba(0,0,0,.02)); } footer{ color:#CA278C; padding:10px; border-top:#FFF 2px solid; margin-top:20px; width:725px; padding:20px 23%; overflow:hidden; background-color:#000; height:100%; } footer #navigation{ clear:both; } #bgDeco1{ background-color:#000; position:absolute; bottom:30px; right:10px; width:150px; height:150px; border-radius:50% 50%; opacity:.4; transition:all 1s; -webkit-transition:all 1s; } #bgDeco2{ background-color:#000; position:absolute; bottom:145px; right:25px; width:100px; height:100px; border-radius:50% 50%; opacity:.3; transition:all 1.5s; -webkit-transition:all 1.5s; } #bgDeco3{ background-color:#000; position:absolute; bottom:210px; right:75px; width:80px; height:80px; border-radius:50% 50%; opacity:.2; transition:all 2s; -webkit-transition:all 2s; } #bgDeco4{ background-color:#000; position:absolute; bottom:250px; right:75px; width:50px; height:50px; border-radius:50% 50%; opacity:.1; transition:all 2.5s; -webkit-transition:all 2.5s; } #bgDeco5{ background-color:#000; position:absolute; bottom:250px; right:75px; width:75px; height:75px; border-radius:50% 50%; opacity:.25; transition:all 2.5s; -webkit-transition:all 2.5s; } #bgDeco6{ background-color:#000; position:absolute; bottom:250px; right:75px; width:55px; height:55px; border-radius:50% 50%; opacity:.35; transition:all 2.5s; -webkit-transition:all 2.5s; } #SkypeButton_Call_age_of_empires3_1 { float: right; } #div_main { width: 590px; } #skills { font-size: 19px; margin-top: 40px; margin-bottom: 40px; } .portfolio { padding:14px; margin:14px 0; min-height:200px; border-left:#E47297 2px solid; clear:both; cursor:pointer; transition:all .3s; -webkit-transition:all .7s; } .portfolio:hover{ background-color:rgba(255,255,255,.05); } #menu input{ width: 149px; height: 16px; } #menu input[type="submit"]{ padding-bottom: 25px; } #menu form{ height:300px; border:1px solid red; } #menu { margin: 10px; padding: 10px; width: 200px; float: left; } #menu a { font-size: 18px; font-weight: bold; margin-top: 10px; margin-right: 10px; display: block; } #calendar_div { border: 1px solid black; width: 245px; float: left; overflow:hidden; } .buttons { padding-right: 10px; float: right; } #calendar { width: 210px; float: left; overflow:hidden; } #calendar tr > th { color: rgb(0, 0, 0); padding-right: 20px; } #article { padding: 10px; width: 490px; float: left; margin-bottom:40px; border-bottom:2px solid red; } #article p { text-indent: 20px; } #article h1 { border-left:#FFF 2px solid; color:#FFF; background-color:rgba(255,255,255,.15); padding:5px; padding-left:10px; margin:10px 0; } #article h4 { margin: 10px; color: pink; } #comment_form { margin: auto; width: 500px; overflow: hidden; } .comment { background: rgb(167, 211, 241); margin: 10px auto 30px; padding: 10px; border-radius: 10px; border: 1px solid red; width: 500px; height: auto; color: rgb(0, 0, 0); overflow: hidden; } h3.commentator { text-align: left; } #links { width: 400px; margin:auto; } #links li { padding-top: 10px; } .about { width: 1000px; overflow: hidden; } .about img { margin: 10px; overflow: hidden; float: left; } .about p { padding: 10px; } #contact_picture { width:500px; float:right; } #contact_info { float: right; } .red { margin: 10px; padding: 10px; width: 500px; height: auto; overflow: hidden; float: left; } #contact_form { padding: 10px; width: 477px; overflow: hidden; } .secret { display: none; } #uploading { padding: 10px; border: 1px solid red; width: 500px; } .wrong_answer { background: red; padding: 10px; border: 1px solid green; color: white; } .correct_answer { background: green; border: 1px solid orange; } label { display: block; } #secret{ display:none; } /********************************** Blog ***********************************/ #category{ float:right; margin:10px; } /* the class for the flags */ .langs{ float:right; margin:15px; box-shadow: 6px 6px 15px #545454; -webkit-box-shadow: 6px 6px 15px #545454; /* Support for Chrome, Safari, iOS, Android */ -moz-box-shadow: 6px 6px 15px #545454; /* Support for Mozilla -13 */ } /************************************* WP Plugins **************************************/ #single_plugin{ width:590px; margin:10px; border-bottom: 1px solid orange; }And here is my HTML structure for the index.php file <?php include 'html/header.php'; ?> <!-- This ID holds the entire inner container for this page --> <div id="main_div"> <h1>Hello World!</h1> <h3>My name is Stefany and I am from Bulgaria. I am a computer programmer and I create websites and web applications.</h3> <p id="skills"> <strong>Programming languages:</strong> PHP, Perl 5, JavaScript <br /> <strong>Front - end:</strong> HTML5, XHTML, CSS <br /> <strong>Databases:</strong> MySQL, SQLite, MariaDB, MSSQL <br /> <strong>Frameworks:</strong> CodeIgniter <br /> <strong>E-commerce Platforms:</strong> osCommerce, UniqueFree <br /> <strong>Other:</strong> XML, AJAX, JSON <br /> <strong>Web Services:</strong> REST, SOAP <br /> <strong>Content Management Systems:</strong> WordPress, Joomla <br /> I can create forums, blogs, social networks, E - stores, portfolios, WordPress themes, plugin and pretty much any type of website you can think of. <br /> Please take a look at my portfolio below and if you are interested to hire me, please don't hesitate to <a href="contact">contact me!</a> </p> <h2>Portfolio</h2> <div class="portfolio"> <h3><a href="http://tarsis-bg.com/" target="_blank"> Tarsis </a></h3> <a href="http://tarsis-bg.com/" target="_blank"><img src="images/project23.png" width="200" height="133" alt="Company website for selling flats" /></a> <p> Tarsis is a company that builds and sells flats in Sunny Beach, Bulgaria and I made their website on WordPress, including a custom made plugin that was used to build a separate CMS within WP for management of the flats that are for sale. <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL, WordPress </p> </div> <div class="portfolio"> <h3><a href="http://ungerne.dk/" target="_blank"> Ungerne </a></h3> <a href="http://ungerne.dk/" target="_blank"><img src="images/project22.png" width="200" height="133" alt="Web-shop for selling kids' clothes" /></a> <p> Danish web-shop for selling kids' clothes, built on osCommerce. I made major core modifications, such as fixes on the coupon, mail, search, shipping, product and shopping systems. <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL, osCommerce </p> </div> <div class="portfolio"> <h3><a href="http://www.br-electronic.dk/" target="_blank"> Bramming Electronic </a></h3> <a href="http://www.br-electronic.dk/" target="_blank"><img src="images/project21.png" width="200" height="133" alt="Web-shop for selling electronics" /></a> <p> UniqueFree built Danish web-shop for selling electronics. Made core modifications in the shipping system. <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL, UniqueFree </p> </div> <div class="portfolio"> <h3><a href="http://babyfryd.dk/" target="_blank"> BabyFryd </a></h3> <a href="http://babyfryd.dk//" target="_blank"><img src="images/project20.png" width="200" height="133" alt="BabyFryd web-shop for selling kids' clothes" /></a> <p> Another Danish web-shop for selling children's clothes build on UniqueFree <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL, UniqueFree </p> </div> <div class="portfolio"> <h3><a href="http://iskampak.com" target="_blank"> Iskam Pak </a></h3> <a href="http://iskampak.com/" target="_blank"><img src="images/project19.png" width="200" height="133" alt="A website about Angry Birds" /></a> <p> Dating website made entirely from scratch without any frameworks with a custom CMS build into it. <br /> It is currently a work in progress. <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL </p> </div> <div class="portfolio"> <h3><a href="http://angrybirds.me/" target="_blank">Angry Birds </a></h3> <a href="http://angrybirds.me/" target="_blank"><img src="images/project18.png" width="200" height="133" alt="A website about Angry Birds" /></a> <p> A website where you can play the legendary game Angry Birds for free. <br /> I made it with WordPress by tweaking a theme and installing plugins. <br /> Technologies used: XHTML, CSS, WordPress, PHP </p> </div> <div class="portfolio"> <h3><a href="http://dyulgerova.info/nc/index.php" target="_blank"> Wallace & Hull LLP</a></h3> <a href="http://dyulgerova.info/nc/index.php" target="_blank"><img src="images/project17.png" width="200" height="133" alt="Project 12" /></a> <p> The homepage of <strong>"Wallace and Hull LLP"</strong> lawyer firm from Oregon, Washington. It's part of a WordPress theme I made. <br /> Technologies used: HTML5, CSS3, WordPress </p> </div> <div class="portfolio"> <h3><a href="http://www.automirrorsexpress.com/" target="_blank"> Auto Mirrors Express</a></h3> <a href="http://www.automirrorsexpress.com/" target="_blank"><img src="images/project15.jpg" width="200" height="133" alt="Project 12" /></a> <p> E - shop for car mirrors. Created a tag cloud, fixed many DB issues and configured the server. <br /> Technologies used: XHTML, CSS, PHP, JavaScript, Perl, osCommerce </p> </div> <div class="portfolio"> <h3><a href="http://www.autolightcenter.com/index.php" target="_blank"> Auto Lights Center</a></h3> <a href="http://www.autolightcenter.com/index.php" target="_blank"><img src="images/project14.jpg" width="200" height="133" alt="Project 12" /></a> <p> E - shop for car lights. Made some grand changes with the design, the entire back end code and the DB. Greatly increased the security. <br /> Technologies used: XHTML, CSS, PHP, JavaScript, Perl, osCommerce </p> </div> <div class="portfolio"> <h3><a href="http://radiosean.co.uk/"> Radio Sean</a></h3> <a href="http://radiosean.co.uk/"><img src="images/project13.jpg" width="200" height="133" alt="Project 12" /></a> <p> Homepage of a British radio station. I created the search engine of the website. <br /> Technologies used: XHTML, PHP </p> </div> <div class="portfolio"> <h3><a href="/portfolio/otto" target="_blank"> Otto Steininger</a></h3> <a href="http://www.ottosteininger.com/" target="_blank"><img src="images/project12.jpg" width="200" height="133" alt="Project 12" /></a> <p> Coming soon page for the website of an animator/illustrator professional. <br /> Technologies used: XHTML, CSS, Javascript </p> </div> <div class="portfolio"> <h3><a href="http://freepic.eu/" target="_blank"> FreePic</a></h3> <a href="http://freepic.eu/" target="_blank"><img src="images/project11.png" width="200" height="133" alt="Project 11" /></a> <p> Free image hosting website. I created the GIF category, the admin panel and increased the security of the website. <br /> Technologies used: XHTML, CSS, PHP, MySQL, GD </p> </div> <div class="portfolio"> <h3><a href="http://studyingthepast.com/" target="_blank"> Studying The Past</a></h3> <a href="http://studyingthepast.com/" target="_blank"><img src="images/project10.png" width="200" height="133" alt="Project 10" /></a> <p> A website about history. 100% XHTML 1.0 and CSS valid. <br /> Technologies used: XHTML, CSS, PHP, SQLite </p> </div> <!-- The "portfolio" class is a div that holds one website at a time. That's why there are so many declarations of that div --> <div class="portfolio"> <!-- The name of the website in a header element with a link to it --> <h3><a href="http://sundaygolessons.com/" target="_blank">Sunday Go Lessons</a></h3> <!-- And a picture of the website again with a link to it because it's cool to also have a screenshot beside just a super boring link, WOW --> <a href="http://sundaygolessons.com/" target="_blank"><img src="images/project9.png" width="200" height="133" alt="Project 9" /></a> <!-- And a litte explanation as to what the website is the hell about. --> <p> A webshop for selling and renting <a href="https://www.usgo.org/what-go">Go</a> related books and videos, with integrated PayPal payment system. <br /> Technologies used: XHTML, CSS, PHP, MySQL, PayPal </p> </div> <!-- End of the previous website and now it's the turn of the next. The bragging continues... --> <div class="portfolio"> <h3><a href="http://code-forums.info/" target="_blank"> PHP Forum</a></h3> <a href="http://code-forums.info/" target="_blank"><img src="images/project7.png" width="200" height="133" alt="Project 7" /></a> <p> A programming forum coded from scratch, without using any PHP frameworks or ready made stuff. <a href="http://github.com/Stefany93/PHP-Forum">Source code.</a> <br /> Technologies used: XHTML, CSS, PHP, MySQL, JavaScript </p> </div> <div class="portfolio"> <h3><a href="http://dyulgerova.info/project_blog/" target="_blank">Bulgarian newspapper</a></h3> <a href="http://dyulgerova.info/project_blog/" target="_blank"><img src="images/project6.png" width="200" height="133" alt="Project 2" /></a> <p> This project has been made half way and it is currently frozen. <br /> Technologies used: XHTML, CSS, PHP, MySQL, JavaScript </p> </div> <div class="portfolio"> <h3><a href="http://www.bettercitiesforum.com/" target="_blank"> WordPress website about improving neighbourhoods</a></h3> <a href="http://www.bettercitiesforum.com/" target="_blank"><img src="images/project5.png" width="200" height="133" alt="Project 2" /></a> <p> I installed a Simple Machines Forum and made some tweaks on the source code as well on the site. <br /> Technologies used: WordPress, PHP </p> </div> <div class="portfolio"> <h3><a href="big_images/project4.png" target="_blank">Social Network</a></h3> <a href="big_images/project4.png" target="_blank"><img src="images/project4.png" width="200" height="133" alt="Project 2" /></a> <p> Including a forum, an individual learning module and an event calendar. The social network is private for the residents anesthesiologists of the Texas Tech University <br /> and therefore not in the public domain. I created it in twenty days from scratch. <br /> Technologies used: HTML5, CSS, PHP, MySQL, JavaScript. </p> </div> <div class="portfolio"> <h3><a href="http://chrisshilts.com/" target="_blank">Portfolio for a web designer.</a></h3> <a href="http://chrisshilts.com/" target="_blank"><img src="images/project3.jpg" width="200" height="133" alt="Project 2" /></a> <p> Basically I made the blog page with a custom Content Management System including an Admin panel. <br /> Technologies used: PHP, MySQL, JavaScript. </p> </div> <div class="portfolio"> <h3><a href="http://www.borsp.com/sandh/dazer/" target="_blank"> E - Shop</a></h3> <a href="http://www.borsp.com/sandh/dazer/" target="_blank"><img src="images/project2.jpg" width="200" height="133" alt="Project 2" /></a> <p> I made the front - end and my colleague made the back - end. It's in a process of being uploaded. <br /> Techologies used: XHTML, CSS, JavaScript. </p> </div> </div> <?php include 'html/footer.php'; ?>Please help me! I managed to fix the problem with "overflow-x:hidden" property of "body" in CSS, but I do believe this is way too wrong. Edited by Stefany93, 17 June 2014 - 11:06 AM. Similar TutorialsI have a table with postcodes in it. At some point some of the codes will be entered with spaces (LA12 5TH) and some without (LA17HU) what i need is a function to check if there is a space, if not - count back 3 characters from the end of the string and insert a space. I don't know which string function to use - looked at pad but that seems to be for either end of string and not the middle - any ideas? i have field like this <form method="POST" enctype="multipart/form-data"> <input type="file" name="photo" id="photo"> <button type="button" id="uploaad">upload</button> </form>
<pre> <?php //my validation code $errors=[]; $data=[];
if(empty($_FILES["photo"]["name"])) {
if(count($errors) !== 0) { ?> </pre> The Error appearing not at first, but when I submit an empty field the error appear, again even if image is selected the error still appearing why not disappearing
This URL works fine: http://www.adodarts.com/calendarandresults/ This URL works fine: http://www.adodarts.com/calendarandresults/?year=2010®ion=&state= If I select 2009, it does not work: http://www.adodarts.com/calendarandresults/?year=2009®ion=&state= Here is the code: <script type="text/JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } function poptastic(url) { newwindow=window.open(url,'name','height=400,width=525,scrollbars=yes,resizable=yes'); if (window.focus) {newwindow.focus()} } function poptastic1(url) { newwindow=window.open(url,'name','height=550,width=650,scrollbars=yes,resizable=yes'); if (window.focus) {newwindow.focus()} } //--> </script> <div align=center style="background-color:#66CCFF; font-size:18px; font-weight:bolder;"><a href="http://www.adodarts.com/files/ADOPlayoffInformation2010.pdf" target="_blank">Click here for 2010 ADO Playoff Information</a></div> <br> <div align=center style="background-color:#FFCC66; font-size:18px; font-weight:bolder;">Click below for 2010 ADO Regional Results</div> <div align=center style="background-color:#FFCC66; font-size:14px; font-weight:bolder;"><a href="2010-masters">MASTERS</a> - <a href="2010-all-stars">ALL-STARS</a> - <a href="2010-us-team"">US Team</a> - <a href="2010-cricket">Cricket</a></div> <table height=30> <tr><td> </td></td> </table> <form name="form1"> <table align=center> <tr> <td><select name="year" > <option value="">Year</option> <option value="2011">2011</option> <option value="2010">2010</option> <option value="2009">2009</option> </select> </td><td><select name="region"> <option value="">Region</option> <option value="">All Regions</option> <option value="1-1">Region 1-1</option> <option value="1-2">Region 1-2</option> <option value="1-3">Region 1-3</option> <option value="1-4">Region 1-4</option> <option value="1-5">Region 1-5</option> <option value="2-1">Region 2-1</option> <option value="2-2">Region 2-2</option> <option value="2-3">Region 2-3</option> <option value="2-4">Region 2-4</option> <option value="2-5">Region 2-5</option> <option value="3-1">Region 3-1</option> <option value="3-2">Region 3-2</option> <option value="3-3">Region 3-3</option> <option value="3-4">Region 3-4</option> <option value="3-5">Region 3-5</option> <option value="4-1">Region 4-1</option> <option value="4-2">Region 4-2</option> <option value="4-3">Region 4-3</option> <option value="4-4">Region 4-4</option> <option value="4-5">Region 4-5</option> <option value="4-6">Region 4-6</option> <option value="5-1">Region 5-1</option> <option value="5-2">Region 5-2</option> <option value="5-3">Region 5-3</option> <option value="5-4">Region 5-4</option> <option value="5-5">Region 5-5</option> <option value="6-1">Region 6-1</option> <option value="6-2">Region 6-2</option> <option value="6-3">Region 6-3</option> <option value="6-4">Region 6-4</option> <option value="6-5">Region 6-5</option> </select> </td><td><select name="state"> <option value="">State</option> <option value="">All States</option> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connectictut</option> <option value="DE">Delaware</option> <option value="FL">Florida</option> <option value="GA">Georgia</option> <option value="HI">Hawaii</option> <option value="ID">Idaho</option> <option value="IL">Illinois</option> <option value="IN">Indiana</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Ketucky</option> <option value="LA">Louisiana</option> <option value="ME">Maine</option> <option value="MD">Maryland</option> <option value="MA">Massachusetts</option> <option value="MI">Michigan</option> <option value="MN">Minnesota</option> <option value="MS">Mississippi</option> <option value="MO">Missouri</option> <option value="MT">Montana</option> <option value="NE">Nebraska</option> <option value="NV">Nevada</option> <option value="NH">New Hampshire</option> <option value="NJ">New Jersey</option> <option value="NM">New Mexico</option> <option value="NY">New York</option> <option value="NC">North Carolina</option> <option value="ND">North Dakota</option> <option value="OH">Ohio</option> <option value="OK">Oklahoma</option> <option value="OR">Oregon</option> <option value="PA">Pennsylvania</option> <option value="RI">Rhode Island</option> <option value="SC">South Carolina</option> <option value="SD">South Dakota</option> <option value="TN">Tennessee</option> <option value="TX">Texas</option> <option value="UT">Utah</option> <option value="VT">Vermont</option> <option value="VA">Virginia</option> <option value="WA">Washington</option> <option value="WV">West virginia</option> <option value="WI">Wisconsin</option> <option value="WY">Wyoming</option> </select> </td><td> <input type="submit" value="Filter" onClick="MM_jumpMenu('parent',this,0)"> </td></tr> </table> <strong><em>*Note: Unsanctioned tournaments will not have links</em></strong> </form> <?php $year = $_GET['year']; $region = $_GET['region']; $state = $_GET['state']; if($year == 0) { $year = '2010'; } $dbh=mysql_connect ("localhost", "database", "password") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("adodarts_TournamentCalendar"); $y = "`sdate` >= '2010-01-01' AND `sdate` <= '2010-12-31'"; $r = ""; $s = ""; if($year == 2009) { $y = "`sdate` >= '2009-01-01' AND `sdate` <= '2009-12-31'"; } if($region != "") { $r = " and `region` = '" . $region . "'"; } if($state != "") { $s = " and `state` = '" . $state . "'"; } $query = "SELECT * FROM `ADOSanctionedTournaments` WHERE " . $y . $r . $s . " ORDER BY `sdate`"; $result = mysql_query($query,$dbh) or die(mysql_error()); ?> <table width=100% align=center> <?php while($row = mysql_fetch_array($result)) { $rrn = $row[rrn]; if(substr($row['sdate'],5,2) == 1) { $alphamonth = 'January'; } elseif(substr($row['sdate'],5,2) == 2) { $alphamonth = 'February'; } elseif(substr($row['sdate'],5,2) == 3) { $alphamonth = 'March'; } elseif(substr($row['sdate'],5,2) == 4) { $alphamonth = 'April'; } elseif(substr($row['sdate'],5,2) == 5) { $alphamonth = 'May'; } elseif(substr($row['sdate'],5,2) == 6) { $alphamonth = 'June'; } elseif(substr($row['sdate'],5,2) == 7) { $alphamonth = 'July'; } elseif(substr($row['sdate'],5,2) == 8) { $alphamonth = 'August'; } elseif(substr($row['sdate'],5,2) == 9) { $alphamonth = 'September'; } elseif(substr($row['sdate'],5,2) == 10) { $alphamonth = 'October'; } elseif(substr($row['sdate'],5,2) == 11) { $alphamonth = 'November'; } elseif(substr($row['sdate'],5,2) == 12) { $alphamonth = 'December'; } if($alphamonth != $alphamonthhold) { echo "<tr><td colspan=5 align=center bgcolor=#CCCCCC>"; echo '<div style="color:#0000CC; font-size:14px; font-weight:bold">' . $alphamonth . '</div>'; echo "</td></tr>"; } echo "<tr><td align=center>"; echo substr($row['sdate'],8,2); if(substr($row['sdate'],8,2) != substr($row['edate'],8,2)) { echo "-" . substr($row['edate'],8,2) . " "; } echo "</td><td>"; if($row['filename'] != "" & $row['tournamentdirector'] == ""){ echo "<a href=\"javascript:poptastic1('http://www.adodarts.com/calendar/tournament.php?rrn=$rrn');\">"; echo $row['tournament']; echo "</a>"; } elseif($row['filename'] != "" & $row['tournamentdirector'] != "" & $row['paymentreceived'] == "Y" & $row['adoapproved'] == "Y"){ echo "<a href=\"javascript:poptastic1('http://www.adodarts.com/calendar/tournament.php?rrn=$rrn');\">"; echo $row['tournament']; echo "</a>"; } elseif($row['filename'] == "" & $row['tournamentdirector'] == "" & $row['paymentreceived'] == "Y" & $row['adoapproved'] == "Y"){ echo "<a href=\"javascript:poptastic1('http://www.adodarts.com/calendar/tournament.php?rrn=$rrn');\">"; echo $row['tournament']; echo "</a>"; } else { echo $row['tournament']; } echo "<font color=white>" . $row[rrn] . "</font>"; echo "</td><td align=right>"; echo "$" . number_format($row['purse']); echo "</td><td>"; echo $row['state']; echo "</td><td>"; if($row['results'] != "Y") { echo " "; } else { echo "<a href=\"javascript:poptastic1('http://www.adodarts.com/calendar/results.php?rrn=$rrn&year=$year');\">results</a>"; } echo "</td>"; $alphamonthhold = $alphamonth; } echo "</tr></table>"; ?> </td> </tr> </table> Hello, I have been wrestling with the code below for most of this week and cannot see what I have done wrong. I would like the user to be able to "claim" their business by clicking on a link. I can get the correct business uploaded but then the form for changing the details does not populate. (I think it is referring to another database table but do not see why as it is not referenced. The top half of the code below works showing the required data. Why does this data not replicate in the lower half of the code? Any help greatly appreciated code: Code: [Select] <?php session_start(); ?> <?php require_once('appvars.php'); require_once('connectvars1.php'); // Connect to the database $dbc = mysqli_connect(DB_Host, DB_User, DB_Password, DB_Name); if (!isset($_GET['user_id'])) { $query = "SELECT * FROM antique WHERE user_id = '" . $_SESSION['user_id'] . "'"; } else { $query = "SELECT * FROM antique WHERE user_id = '" . $_GET['user_id'] . "'"; } $data = mysqli_query($dbc, $query); if (mysqli_num_rows($data) == 1) { // The user row was found so display the user data $row = mysqli_fetch_array($data); echo '<table>'; if (!empty($row['name'])) { echo '<tr><td class="label">Name:</td><td>' . $row['name'] . '</td></tr>'; } if (!empty($row['phone'])) { echo '<tr><td class="label">Phone:</td><td>' . $row['phone'] . ' </td></tr>'; } if (!empty($row['address1'])) { echo '<tr><td class="label">Address1:</td><td>' . $row['address1'] . ' </td></tr>'; } if (!empty($row['address2'])) { echo '<tr><td class="label">Address2:</td><td>' . $row['address2'] . ' </td></tr>'; } if (!empty($row['postcode'])) { echo '<tr><td class="label">Postcode:</td><td>' . $row['postcode'] . ' </td></tr>'; } if (!empty($row['webadd'])) { echo '<tr><td class="label">Web address:</td><td>' . $row['webadd'] . ' </td></tr>'; } if (!empty($row['username'])) { echo '<tr><td class="label">Username:</td><td>' . $row['username'] . ' </td></tr>'; } echo '</table>'; echo '<class = "label">USER ID: ' . $row['user_id'] . ''; if (!isset($_GET['user_id']) || ($_SESSION['user_id'] == $_GET['user_id'])) { echo '<p>Would you like to <a href="index5.php">Go to Homepage</a>?</p>'; } } // End of check for a single row of user results else { echo '<p class="error">There was a problem accessing your profile.</p>'; } ?> <hr> <?php if (isset($_POST['submit'])) { // Grab the profile data from the POST $name = mysqli_real_escape_string($dbc, trim($_POST['name'])); $phone = mysqli_real_escape_string($dbc, trim($_POST['phone'])); $address1 = mysqli_real_escape_string($dbc, trim($_POST['address1'])); $address2 = mysqli_real_escape_string($dbc, trim($_POST['address2'])); $postcode = mysqli_real_escape_string($dbc, trim($_POST['postcode'])); $webadd = mysqli_real_escape_string($dbc, trim($_POST['webadd'])); $email = mysqli_real_escape_string($dbc, trim($_POST['email'])); $old_picture = mysqli_real_escape_string($dbc, trim($_POST['old_picture'])); $new_picture = mysqli_real_escape_string($dbc, trim($_FILES['new_picture']['name'])); $new_picture_type = $_FILES['new_picture']['type']; $new_picture_size = $_FILES['new_picture']['size']; $username = mysqli_real_escape_string($dbc, trim($_POST['username'])); $user_id = mysqli_real_escape_string($dbc, trim($_POST['user_id'])); if (!empty($_FILES['new_picture']['tmp_name'])) {list($new_picture_width, $new_picture_height) = getimagesize($_FILES['new_picture']['tmp_name']); } //list($new_picture_width, $new_picture_height) = getimagesize($_FILES['new_picture']['tmp_name']); $error = false; // Validate and move the uploaded picture file, if necessary if (!empty($new_picture)) { if ((($new_picture_type == 'image/gif') || ($new_picture_type == 'image/jpeg') || ($new_picture_type == 'image/pjpeg') || ($new_picture_type == 'image/png')) && ($new_picture_size > 0) && ($new_picture_size <= MM_MAXFILESIZE) && ($new_picture_width <= MM_MAXIMGWIDTH) && ($new_picture_height <= MM_MAXIMGHEIGHT)) { if ($_FILES['new_picture']['error'] == 0) { // Move the file to the target upload folder $target = MM_UPLOADPATH . basename($new_picture); if (move_uploaded_file($_FILES['new_picture']['tmp_name'], $target)) { // The new picture file move was successful, now make sure any old picture is deleted if (!empty($old_picture) && ($old_picture != $new_picture)) { } } else { // The new picture file move failed, so delete the temporary file and set the error flag @unlink($_FILES['new_picture']['tmp_name']); $error = true; echo '<p class="error">Sorry, there was a problem uploading your picture.</p>'; } } } else { // The new picture file is not valid, so delete the temporary file and set the error flag @unlink($_FILES['new_picture']['tmp_name']); $error = true; echo '<p class="error">Your picture must be a GIF, JPEG, or PNG image file no greater than ' . (MM_MAXFILESIZE / 1024) . ' KB and ' . MM_MAXIMGWIDTH . 'x' . MM_MAXIMGHEIGHT . ' pixels in size.</p>'; } } $error = false; // Update the profile data in the database if (!$error) { if (!empty($name) && !empty($phone) && !empty($address1) && !empty($address2) && !empty($postcode)) { // Only set the picture column if there is a new picture // Only set the password in there is a new one if (!empty($new_picture)) { // if (!empty($age)) { $query = "UPDATE antique SET name = '$name', phone = '$phone', address1 = '$address1', address2 = '$address2', postcode = '$postcode', " . " email = '$email', webadd = '$webadd', picture = '$new_picture', username = '$username' WHERE username = '" . $_SESSION['username'] . "'"; }} else { $query = "UPDATE antique SET name = '$name', phone = '$phone', address1 = '$address1', address2 = '$address2', postcode = '$postcode', " . " email = '$email', webadd = '$webadd', username = '$username' WHERE username = '" . $_SESSION['username'] . "'"; } // mysqli_query($dbc, $query) or die("<br>Query $query<br>Failed with error: " . mysqli_error($dbc) . '<br>On line: ' . __LINE__); // Confirm success with the user echo '<p>Your profile has been successfully updated. Would you like to <a href="viewprofile4.php">view your profile</a>?</p>'; mysqli_close($dbc); exit(); } else { echo '<p class="error">You must enter all of the profile data (the picture is optional).</p>'; } } // End of check for form submission else { // Grab the profile data from the database $query="SELECT * FROM antique WHERE user_id= '" . $_SESSION['user_id'] . "'"; $data = mysqli_query($dbc, $query); $row = mysqli_fetch_array($data); if ($row != NULL) { $name = $row['name']; $phone = $row['phone']; $address1 = $row['address1']; $address2 = $row['address2']; $postcode = $row['postcode']; $email = $row['email']; $webadd = $row['webadd']; $old_picture = $row['picture']; $username = $row['username']; $user_id = $row['user_id']; } else { echo '<p class="error">There was a problem accessing your profile.</p>'; } } mysqli_close($dbc); ?> <form enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo MM_MAXFILESIZE; ?>" /> <fieldset> <legend>Personal Information</legend> <label for="name">Name:</label> <input type="text" id="name" name="name" value="<?php if (!empty($name)) echo $name; ?>" /><br /> <label for="phone">Phone:</label> <input type="text" id="phone" name="phone" value="<?php if (!empty($phone)) echo $phone; ?>" /><br /> <label for="address1">Address1:</label> <input type="text" id="address1" name="address1" value="<?php if (!empty($address1)) echo $address1; ?>" /><br /> <label for="address2">Address2:</label> <input type="text" id="address2" name="address2" value="<?php if (!empty($address2)) echo $address2; ?>" /><br /> <label for="postcode">Postcode:</label> <input type="text" id="postcode" name="postcode" value="<?php if (!empty($postcode)) echo $postcode; ?>" /><br /> <label for="email">Email:</label> <input type="text" id="email" name="email" value="<?php if (!empty($email)) echo $email; ?>" /><br /> <label for="webadd">Web address:</label> <input type="text" id="webadd" name="webadd" value="<?php if (!empty($email)) echo $webadd; ?>" /><br /> <input type="hidden" name="old_picture" value="<?php if (!empty($old_picture)) echo $old_picture; ?>" /> <label for="new_picture">Pictu </label> <input type="file" id="new_picture" name="new_picture" /> <?php if (!empty($old_picture)) { echo '<img class="profile" src="' . MM_UPLOADPATH . $old_picture . '" alt="Profile Picture"style="max-width:150px; max-height:110px" />';} ?> <br /> <label for="username">Username:</label> <input type="text" id="username" name="username" value="<?php if (!empty($username)) echo $username; ?>" /><br /> <label for="user_id">User ID:</label> <input type="text" id="user_id" name="user_id" value="<?php if (!empty($user_id)) echo $user_id; ?>" /><br /> </fieldset> <input type="submit" value="Save Profile" name="submit" /> </form> <?php echo('<p class="login">You are logged in as ' . $_SESSION['username'] . '. <a href="logout3.php">Log out</a>.</p>'); echo '<class = "label">USER ID: ' . $row['user_id'] . ''; ?> <p><a href="index.php">Return to homepage</a></p> <?php require_once('footer.php'); ?> </body> </html> Hi all, I have an issue on a form that when it gets submitted a slash '/' appears before every quote symbol. I had help solving the issue on one of the fields (the name field), but then later it was discovered that the slashes appear in all the fields whenever a quote was used (agreed, poor testing). Can someone be so good to help me solve this? My php knowledge is not so great which is exactly why I'm asking here Please see my code below. If this problem can be solved in the same manner as the name field was solved, then there are 2 files which will need the edits. They are below: (some trivial information purposely removed for security reasons) preview.php <div id="card"> <img id="logo" src="logo.jpg" /> <div id="card1"><?php echo stripslashes($_REQUEST['text1']); ?> </div> <div id="card2"><?php echo $_REQUEST['text2']; ?> </div> <div id="card3"><?php echo $_REQUEST['text3']; ?> </div> <?php if($_REQUEST['text4'] != '' && $_REQUEST['text5'] != '') $text = $_REQUEST['text4'].' • '.$_REQUEST['text5']; else $text = $_REQUEST['text4'].$_REQUEST['text5']; ?> <div id="card4"><?php echo $text; ?> </div> <div id="card5"><?php echo $_REQUEST['text6']; ?> </div> </div> second_form.php <?php session_start(); $db_host = 'localhost'; $db_name = ''; $db_user = ''; $db_pass = ''; $admin_email = "admin@aserver.com"; if(isset($_REQUEST['text1'])) $_REQUEST['text1'] = stripslashes($_REQUEST['text1']); $from = 'orders@mycompany.com'; if($_REQUEST['count'] != '50' && $_REQUEST['count'] != '100') { header( 'Location: order.php' ); die(); } $card_number = trim($_REQUEST['card_number']); $card_security = $_REQUEST['card_security']; $card_exp_m = sprintf("%02d",((int)$_REQUEST['car_exm_m'])%100); $card_exp_y = sprintf("%02d",((int)$_REQUEST['car_exm_y'])%100); $count = $_REQUEST['count']; $shipping = 8.65; $price = $shipping; switch($count) { case 50: $price += 25; break; case 100: $price += 38; break; } //$price = 0.01; //$shipping = 0.01; $price = sprintf("%0.2f",$price); $fd_xsd = 'http://***'; $v1_xsd = 'http://***'; $a1_xsd = 'https://***'; //$email_rep = str_replace('@','[at]',$_REQUEST['text4']); $soap = <<<SOAP <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header /> <SOAP-ENV:Body> <fdggwsapi:FDGGWSApiOrderRequest xmlns:fdggwsapi="$fd_xsd" xmlns:v1="$v1_xsd"> <v1:Transaction> <v1:CreditCardTxType> <v1:Type>sale</v1:Type> </v1:CreditCardTxType> <v1:CreditCardData> <v1:CardNumber>$card_number</v1:CardNumber> <v1:ExpMonth>$card_exp_m</v1:ExpMonth> <v1:ExpYear>$card_exp_y</v1:ExpYear> </v1:CreditCardData> <v1:Payment> <v1:ChargeTotal>$price</v1:ChargeTotal> <v1:Shipping>$shipping</v1:Shipping> </v1:Payment> <v1:Billing> <v1:Name>{$_REQUEST['text1']} - {$_REQUEST['text2']} - {$_REQUEST['text3']}</v1:Name> <v1:Email>{$_REQUEST['text4']}</v1:Email> <v1:Phone>{$_REQUEST['text5']}</v1:Phone> <v1:Address2>{$_REQUEST['text5']}</v1:Address2> <v1:Address1>{$_REQUEST['text6']}</v1:Address1> </v1:Billing> <v1:Shipping> <v1:Name>{$_REQUEST['info_name']}</v1:Name> <v1:Address1>{$_REQUEST['info_street']} {$_REQUEST['info_APT']}</v1:Address1> <v1:City>{$_REQUEST['info_city']}</v1:City> <v1:State>{$_REQUEST['info_state']}</v1:State> <v1:Zip>{$_REQUEST['info_zip']}</v1:Zip> </v1:Shipping> </v1:Transaction> </fdggwsapi:XXXApiOrderRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope> SOAP; // echo htmlentities($soap); $link = "https://ws.firstdataglobalgateway.com/****"; $store_id = "***"; $user_id = "***"; $pass = "***"; $key_pass = "***"; $uss_pass = ('WS'.$store_id.'***:'.$pass); $path = "/home/hoster/ssl_firstdata/"; $pem_path = $path . "***.pem"; $key_path = $path. "***_.1.key"; $ch = curl_init($link); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml") ); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);curl_setopt($ch, CURLOPT_USERPWD, $uss_pass); curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, $soap); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSLCERT, $pem_path);//pem file curl_setopt($ch, CURLOPT_SSLKEY, $key_path); // crt file curl_setopt($ch, CURLOPT_SSLKEYPASSWD, $key_pass); $res = curl_exec($ch); //$xml = simplexml_load_string('<?xml version="1.0" encoding="UTF-8"? >'.$res); $xml = simplexml_load_string('<?xml version="1.0" encoding="UTF-8"?>'.$res); $ch = $xml->children('SOAP-ENV',true);$ch = $ch[1];$ch = $ch->children('fdggwsapi',true);$response = $ch[0]; $orderId = trim((string)$response->OrderId); mysql_connect($db_host , $db_user, $db_pass); if(!mysql_select_db($db_name)) { echo "Create the database please"; exit; } $result = array( 'Order Number' => $orderId, 'errorMessage' => (string)$response->ErrorMessage, 'response' => $res, "\n\nv_name" => $_REQUEST['text1'], 'v_degree' => $_REQUEST['text2'], 'v_graduation' => $_REQUEST['text3'], 'v_email' => $_REQUEST['text4'], 'v_phone' => $_REQUEST['text5'], 'v_address' => $_REQUEST['text6'], "\n\nOrder Details" => "\n", 'v_quantity' => $_REQUEST['count'], 'cost' => ($_REQUEST['count'] == '50' ? '$25.00' : '$38.00'), 'shipping and handling' => '$8.65', 'total price' => ($_REQUEST['count'] == '50' ? '$33.65' : '$46.65'), "\n\nShipping Information" => "\n", 'name' => $_REQUEST['info_name'], 'street' => $_REQUEST['info_street'], 'apt' => $_REQUEST['info_APT'], 'city' => $_REQUEST['info_city'], 'state' => $_REQUEST['info_state'], 'zip' => $_REQUEST['info_zip'] ); if(strlen($orderId) != 0 && strpos((string)$response->ErrorMessage,'database error') === false)//success { $result['success'] = 1; $link = 'order.php?step=3'; $subject = "order submitted"; } else { $result['success'] = 0; $link = 'order.php?step=-3'; $subject = "Error occured while creating order"; } $_SESSION['data'] = $result; $into = array(); $values = array(); foreach($result as $key => $val) { $into[] = "`$key`"; if($key == 'v_quantity') $values[] = addslashes ($val); else $values[] = "'".addslashes($val)."'"; } $query = "INSERT INTO `***`.`orders` (".implode(', ',$into).") VALUES (".implode(', ',$values).");"; require_once "send_mail.php"; $sendTo = array($admin_email,$result['v_email']); send_mails($sendTo,$from,$subject,$result); mysql_query($query); header('Location: '.$link); exit; function render() { global $res,$xml; // var_dump($_REQUEST); // echo $res; // echo htmlentities($res); /* */ var_dump($xml); } ?> Hey I am trying to write to a csv file with the data in my database. My problem I am having is that when I echo out to the browser everything is fine, but when I try writing to the file I get a lot of line breaks and that throws everything off for the csv file. Here's my code: Code: [Select] $query = "SELECT * FROM $table"; $result = mysql_query($query); $numcolumns = mysql_num_fields($result); $numrows = mysql_num_rows($result); $file = "testFile.csv"; $fh = fopen($file, 'w') or die("can't open file"); while($row = mysql_fetch_array($result)) { for($i = 0; $i <= ($numcolumns - 1); $i++) { if($i < ($numcolumns - 1)) { $string = $row[$i] . ","; echo $string; fwrite($fh, $string); } else { $string = $row[$i]; echo $string; fwrite($fh, $string); } } $string = "\n"; echo "<br />"; fwrite($fh, $string); } fclose($fh); My output to the browser looks like this for one record.. which is how it should look: (Had to edit the content a bit for confidential reasons) Code: [Select] ######,12/31/99 ,123 Drive,City,TX ,##### ,County And here is what I get in the csv file when I open it up on notepad: Code: [Select] ######,12/31/99 ,123 Drive ,City ,TX ,##### ,County Any idea where these line breaks are coming from? Is it because the data is being pulled from a database? Any help on how to fix this would be great!! Thanks. Hey guys, I know nothing of PHP so please bare with me as I try to explain my problem. My company collects sales leads that are emailed through to a CRM system (GoldMine). We are currently in the process of moving our website from a shared windows server to a dedicated linux server and it seems to be causing a problem with the form, or at least PHP behind it. The guy who handed the initial set up has mysteriously disapeared so we're in a bit of a fix. I'm not specifically looking for a solution, more of an idea of where to go from here. I'm not sure wether the problem lies in the PHP itself or something else.. like the server for example. I was hoping someone here might be able to point me in the right direction somewhat. Anyway, the problem is that while testing the form on the new server the email is sent and our CRM picks it up but cannot read because a newly appeared line has been inserted at the top of the body. This does not appear when filling in the form currently live on our site (windows server). the line is: Code: [Select] Content-Type: text/x-gm-impdata As far as I'm aware this content-type is necessary for our CMR to recognize and read the email, but it shouldn't be showing up in the body of the mail. The full on send PHP is: Code: [Select] <?php $redirectURL = "http://www.website.co.uk/confirmation_page.htm"; function Decode($strValueIn) { //Do not modify this function! $intX = 0; $intY = 0; $Temp = ""; $Mod = ""; $intMod =0; $intTemp = 0; $ValueOut = ""; $intY = 1; $strValueOut=""; for ($intX=1; $intX<=((strlen($strValueIn)/2)/2); $intX=$intX+1) { $strTemp=""; $strMod=""; if (($intX % 2)==0) { $strMod=substr(substr($strValueIn,$intY-1,4),0,2); $strTemp=substr(substr($strValueIn,$intY-1,4),strlen(substr($strValueIn,$intY-1,4))-(2)); } else { $strMod=substr(substr($strValueIn,$intY-1,4),strlen(substr($strValueIn,$intY-1,4))-(2)); $strTemp=substr(substr($strValueIn,$intY-1,4),0,2); } $intMod=hexdec($strMod); $intTemp=hexdec($strTemp); $intTemp=$intTemp-$intMod; $strValueOut=$strValueOut.chr($intTemp); $intY=$intY+4; } return $strValueOut; } if ($_POST["GMsubmit"]!="") { $Body = ""; $Notes = ""; $SendToEmail = Decode($_POST["SendToEmail"]); //$SMTP = Decode($_POST["SMTP"]); //Your SMTP data may have to be set set on the Apache Server, and this variable is not used. $OnNewSendGMEmail = $_POST["OnNewSendGMEmail"]; if ($OnNewSendGMEmail!="") {$OnNewSendGMEmail = Decode($OnNewSendGMEmail);} else {$OnNewSendGMEmail = "";} if ($_POST["OnDUPSendGMEmail"]!="") {$OnDUPSendGMEmail = Decode($_POST["OnDUPSendGMEmail"]);} else {$OnDUPSendGMEmail = "";} if ($_POST["OnNewAttachTrack"]!="") {$OnNewAttachTrack = Decode($_POST["OnNewAttachTrack"]);} else {$OnNewAttachTrack = "";} if ($_POST["OnDupAttachTrack"]!="") {$OnDupAttachTrack = Decode($_POST["OnDupAttachTrack"]);} else {$OnDupAttachTrack = "";} if ($_POST["Word"]!="") {$Password = Decode($_POST["Word"]);} else {$Password = "";} if ($_POST["DupLogic"]!="") {$DupLogic = Decode($_POST["DupLogic"]);} else {$DupLogic = "";} $OutputAs = $_POST["OutPutAs"]; $DuplicateCount=0; $XML = "<gmdata>"; if ($_POST["DuplicateCount"]!="") { $DuplicateCount =intval($_POST["DuplicateCount"]); } if ($DuplicateCount >0 || $OnNewSendGMEmail!="" || $OnDUPSendGMEmail!="" || $OnNewAttachTrack!="" || $OnDupAttachTrack!="") { $Body = $Body."[Instructions]\r\n"; $XML = $XML."<Instructions>"; if ($DuplicateCount > 0) { for($counter=0; $counter < $DuplicateCount; $counter++) { $RealCount=$counter+1; $str = "DuplicateChecking$RealCount"; eval("\$str = \"$str\";"); $Body = $Body."DupCheck".$RealCount."=".$_POST[$str]."\r\n"; //print($str.":".$_POST[$str].";"); $tempVal = $_POST[$str]; if ($tempVal==="EMAIL") { $XML = $XML."<DupCheck>EA1</DupCheck>"; } else { if ($tempVal==="WEBSITE") { $XML = $XML."<DupCheck>WS1</DupCheck>"; } else { $XML = $XML."<DupCheck>".htmlspecialchars($_POST[$str])."</DupCheck>"; } } } if ($DupLogic !="") {$Body = $Body."DupLogic=OR\r\n";} } if ($OnNewSendGMEmail!="") { $Body = $Body."OnNewSendGMEmail=".$OnNewSendGMEmail."\r\n"; $XML = $XML."<OnNewSendGMEmail>".htmlspecialchars($OnNewSendGMEmail)."</OnNewSendGMEmail>"; } if ($OnDUPSendGMEmail!="") { $Body = $Body."OnDUPSendGMEmail=".$OnDUPSendGMEmail."\r\n"; $XML = $XML."<OnDupSendGMEmail>".htmlspecialchars($OnDUPSendGMEmail)."</OnDupSendGMEmail>"; } if ($OnNewAttachTrack!="") { $comma =strpos($OnNewAttachTrack, ","); $Body = $Body."OnNewAttachTrack=".$OnNewAttachTrack."\r\n"; if ($comma =="") { $XML = $XML."<OnNewAttachTrack>".htmlspecialchars($OnNewAttachTrack)."</OnNewAttachTrack>"; } else { list($track, $user) = split(',', $OnNewAttachTrack,2); $XML = $XML."<OnNewAttachTrack User=".chr(34).htmlspecialchars($user).chr(34).">".htmlspecialchars($track)."</OnNewAttachTrack>"; } } if ($OnDupAttachTrack!="") { $comma =strpos($OnDupAttachTrack, ","); $Body = $Body."OnDupAttachTrack=".$OnDupAttachTrack."\r\n"; if ($comma =="") { $XML = $XML."<OnDupAttachTrack>".htmlspecialchars($OnDupAttachTrack)."</OnDupAttachTrack>"; } else { list($track, $user) = split(',', $OnDupAttachTrack,2); $XML = $XML."<OnDupAttachTrack User=".chr(34).htmlspecialchars($user).chr(34).">".htmlspecialchars($track)."</OnDupAttachTrack>"; } } if ($Password!="") { $Body = $Body."Password=".$Password."\r\n"; $XML = $XML."<Password>".htmlspecialchars($Password)."</Password>"; } if ($DupLogic!="") { $XML = $XML."<DupLogic>OR</DupLogic>"; } else { $XML = $XML."<DupLogic>AND</DupLogic>"; } $XML = $XML."</Instructions>"; } $Body = $Body."[Data]\r\n"; $XML = $XML."<accounts><account>"; $Phone = ""; $EA = ""; $WS = ""; $PR = ""; while(list($key,$value)= each($_POST)) { eval("$\$key = \"$value\";"); { if ($key!="GMsubmit" && $key!="SMTP" && $key!="OnNewSendGMEmail" && $key!="OnDUPSendGMEmail" && $key!="OnNewAttachTrack" && $key!="OnDupAttachTrack" && $key!="SendToEmail" && $key!="DuplicateCount" && $key!="Word" && strpos($key, "DuplicateChecking") === false && $key!="OutPutAs" && $key!="DupLogic" && strpos($key, "pretty_") === false) { if($value!="") { if ($key=="UHCUSTDESC" || $key=="UHDESCGOOD" || $key=="UHPI") { $value = str_replace("\r\n","<br/>",$value); $NoteHeader = ""; if ($key=="UHCUSTDESC") { $NoteHeader = "<strong>Customer Description</strong><br/><br/>"; } if ($key=="UHDESCGOOD") { $NoteHeader = "<strong>Descriptions of Goods</strong><br/><br/>"; } if ($key=="UHPI") { $NoteHeader = "<strong>Packing Information</strong><br/><br/>"; } $Notes = $Notes.$NoteHeader.$value."<br/><br/>"; } $Body = $Body.$key."=".$value."\r\n"; if (substr($key,0,5)!="PHONE" && substr($key,0,3)!="FAX" && substr($key, 0, 5)!="EMAIL" && substr($key,0, 7)!="WEBSITE") { $PR = $PR."<property name=".chr(34).$key.chr(34)." db_name=".chr(34).$key.chr(34).">"; $PR = $PR."<property_string>".htmlspecialchars($value)."</property_string>"; $PR = $PR."</property>"; } else { if(substr($key,0,5)=="PHONE") { $Phone = $Phone."<phone international=".chr(34)."0".chr(34)." type=".chr(34).$key.chr(34)." source_fld=".chr(34).$key.chr(34).">"; $Phone = $Phone."<properties><property name=".chr(34)."phone_number".chr(34)."><property_string>".$value."</property_string></property></properties>"; $Phone = $Phone."</phone>"; } elseif(substr($key,0,3)=="FAX") { $Phone = $Phone."<phone international=".chr(34)."0".chr(34)." type=".chr(34).$key.chr(34)." source_fld=".chr(34).$key.chr(34).">"; $Phone = $Phone."<properties><property name=".chr(34)."phone_number".chr(34)."><property_string>".$value."</property_string></property></properties>"; $Phone = $Phone."</phone>"; } elseif(substr($key,0,7)=="WEBSITE") { $WS = $WS."<website primary=".chr(34)."1".chr(34)." id=".chr(34)."WS1".chr(34).">"; $WS = $WS."<properties><property name=".chr(34)."web_site".chr(34)."><property_string>".$value."</property_string></property></properties>"; $WS = $WS."</website>"; } elseif(substr($key,0,5)=="EMAIL") { $EA = $EA."<email primary=".chr(34)."1".chr(34)." id=".chr(34)."EA1".chr(34).">"; $EA = $EA."<properties><property name=".chr(34)."email_address".chr(34)."><property_string>".$value."</property_string></property></properties>"; $EA = $EA."</email>"; } } } } } } if ($PR !="") {$XML = $XML."<properties>".$PR."</properties>";} if($Phone!="") { $XML = $XML."<phone_numbers>".$Phone."</phone_numbers>"; } if($EA!="") { $XML = $XML."<emails>".$EA."</emails>"; } if($WS!="") { $XML = $XML."<websites>".$WS."</websites>"; } $XML = $XML."</account></accounts></gmdata>"; $ToSubject="Web Import"; //The PHP built in function mail() will not raise or cause errors if it fails - so be sure that your PHP server is setup correctly! if( $OutputAs!="INI") { $Body = $XML; } //ini_set("SMTP", Decode($SMTP)); $Body = $Body."UHSUBDATE=".date("d/m/Y")."\r\n"; $Body = $Body."NOTES=".$Notes; if(mail(Decode($SendToEmail), $ToSubject, $Body, "From: GoldMine WebImport <no-reply@frontrange.com>\r\n\r\nContent-Type: text/x-gm-impdata\r\n\r\n" )) { //print "Your data has been recorded successfully!\r\n\r\n<!--\r\n".Decode($SendToEmail)."\r\n".$ToSubject."\r\n".$Body."\r\n\r\n".$OutputAs."\r\n\r\n-->"; header("location: ".$redirectURL); } else { print("There was a mailer failure.\r\n\r\n<!--\r\n".$Body."\r\n\r\n-->");} } else { echo "There was no form data passed."; } ?> Line 294 contains the text that's appearing in the email. Any ideas would be very, very much appreciated. i think because of my code used to send the mail, on my site, its appearing in the spam folder of most of my clients PLUS myself is their a way to eradicate this? correct headers? etc? Dear all, I updated my versions of php/MySQL and OS to Windows 7 Professional and weird "Warnings and Notices:" started popping up. E.g. Code: [Select] "Notice: Undefined index: page in C:\Server\htdocs\domain\index.php on line 25 " Code: [Select] Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for '-4.0/DST' instead in C:\Server\htdocs\domain\index.php on line 12 " I don't know what is going on. Unless I enter these following functions (error_reporting(0);, session_start() with their parameters these warnings display. Can anyone offer any advice? Any assistance is appreciated. this works Code: [Select] <form action="" method="post"> <input name="DepartureDate" type="text"> <input name="" type="submit"></form> <?php $DepartureDate=$_POST['DepartureDate']; echo $DepartureDate = stripslashes($DepartureDate); // sql inject clean $regex = "/^[a-z]+$/"; if (!preg_match($regex, $DepartureDate)){ echo 'CAPS BABY!';} else {echo 'OK!';} ?> this doesnt Code: [Select] if (!preg_match($regex, $DepartureDate)) { mail($to, $subject, $message, $headers); echo $url_success = "confirmation.php"; //echo("<meta http-equiv = refresh content=0;url=".$url_success.">"); } else { exit(); } Hey guys, how are you. I have an odd problem and I am not sure what is causing it. I recently finished my form system, with PHP validation that sends the inputted information via email. Now, everything is working fine on my end with absolutely no issues, but it is not working on any other computers, even though my computer is in no way hosting the files. Now, the issue other computers are getting is when the form is filled out it doesn't redirect to the success page, it redirects back to the form page with nothing filled out and it doesn't display the errors on the page. Any idea on what might be causing this? Again, EVERYTHING works flawlessly on my end, that being, the display of any errors, the proper redirect, everything. Thanks!!! tore the forum apart looking for a solution to this one. for some reason, this is generating an 'unexpected $end' error. this is ALL the code. in entirety. i was just messing around getting familiar with filesystem stuff. no short tags. no curly brackets. so... Code: [Select] <?php $fileHandler = fopen("someFile.txt", 'w') or die ("could not create file"); $text = <<<_END drop some text and some stuff plus this stuff some other stuff _END; fwrite($fileHandler, $text) or die ("could not write to file"); fclose($fileHandler); echo "File 'someFile.txt' written successfully"; ?> thanks people. this has be stumped. not like its complicated, eh? and as you can see, screws up the colour coding as well... but WHY!?!? WR! How can you prevent your browser from caching a page? I think that my news feed is being cached and is causing new posts to not be displayed even after a refresh. Eventually, the posts will show up after about 20 refreshes. I know my query is right so I didn't know if there was a way to stop page caching. I don't really know if it is a caching issue though. I'm starting to think I just have some weird bug in my code because sometimes on refresh news feed items get removed then i'll refresh again and some will get added back in then i'll refresh again and they'll all be there. Ever heard of this happening? Okay, so basically my news-like site is supposed to print out article data saved in the database. It does that quite alright, except on the 3rd article (number 2 in SQL rows or columns. whichever it is. I have my counter subtract 1 from the start article to compensate for MySQL) My code: Code: [Select] <?php print "<div class = 'menu' align='center'>Newest Stories</div>"; if (isset($_REQUEST['mstart'])) { $start=$_REQUEST['mstart']; } else { $start=1; } if ($start) { $start=1; } $start--; $end=$start+5; $stories = mysql_query("SELECT * FROM stories ORDER BY id DESC LIMIT $start, $end") or die(mysql_error()); $num = mysql_num_rows($stories); $start++; if ($num > 0) { if ($num<$end) { $end = $end-(5-$num); } print "<b><i>Showing stories $start to $end</i></b>"; for ($count=0; $count<$num; $count++) { print "<hr>"; $story = mysql_fetch_array($stories,$count); $id = $story['id']; $headline = $story['headline']; $author = $story['author']; $desc = $story['description']; $content = $story['content']; print "COUNT: $count OF $num ($id)<br>"; print "<a href='index.php?request=story&mstart=$start&story=$id' class='headlinelink'>$headline</a><br>"; print "<div class='author'>Posted by: <a href='index.php?request=author&mstart=$start&author=$author' class='author'>$author</a>.</div>"; print "<div class='desc'>$desc</div><br>"; } } else { print "Error. No stories found. :("; } ?> Output: (The COUNT x OF y was to help me figure out what is wrong. In the () by it is the id number of the corresponding MySQL row/column. I even deleted one of the articles to see if it was a specific article error. No luck.) Quote Newest Stories Showing stories 1 to 5 ---------------- COUNT: 0 OF 5 (6) Y U NO STAY Posted by: craigory83. GRRR ---------------- COUNT: 1 OF 5 (5) h-l! Posted by: craigory83. desc ---------------- Notice: Undefined index: id in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dba\menu.php on line 37 Notice: Undefined index: headline in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dba\menu.php on line 38 Notice: Undefined index: author in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dba\menu.php on line 39 Notice: Undefined index: description in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dba\menu.php on line 40 Notice: Undefined index: content in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dba\menu.php on line 41 COUNT: 2 OF 5 () Posted by: . ---------------- COUNT: 3 OF 5 (2) This is the second story! Posted by: TDWP83. See, I fuckin told you so! Warning: mysql_fetch_array() [function.mysql-fetch-array]: The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dba\menu.php on line 36 ---------------- COUNT: 4 OF 5 (1) This is the mother fucking headline! Posted by: craigory83. stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff I have a development machine running WAMP on a win7 64 bit box. php 5.3.13
I have a server that runs Apache 2.2, php 5.3.12 MySql, etc.
I am running joomla 2.5.27 on both machines.
I require a number of php includes to many of the joomla articles (this works great via a plugin called Directphp)
After considerable time getting the site fully working on the dev machine, I ran into an unforseen problem when I uploaded to the production box.
For some unknown reason, the includes work fine on the dev machine using $DOCUMENT_ROOT to define the root (then tag the correct path and file to this)
However, on the production box, this doesn't work - but... $_SERVER['DOCUMENT_ROOT'] does.
Annoyingly, $_SERVER['DOCUMENT_ROOT'] won't work on the dev machine - and $DOCUMENT_ROOT doesn't work on the production box.
So, I can't come up with a generic method to keep both machines happy.
I've checked the php.ini files on both boxes and the register global is OFF on both.
They also seem to interperate the syntax differently in the actual include files - one box hates double quotes - the other has issues with single quotes.
This is really annoying as most of the includes are HTML snippets, coded into php.
The double/single quote problem means I would need to have two versions of the include files.
Can anyone help me with this? - serious hair pulling has started!
Hi Guys/Gals, I have a search form that people search for keywords. Basically and one field and one button form. When they search for a particular string for example, "white" it's only bringing up one result, but 23 times. Here's my code: Code: [Select] <?php require("format.php"); //Get the page number for later $pagenum = $_GET['pagenum']; //Here we display stuff if they have submitted the form if ( $_GET['searching'] == 'yes' ) { //If they stuffed up and didn't search for anything, we show them this if ($_GET['find'] == "") { //Build the HTML display that will output the page when no search is entered echo "$noSearch"; } //If everything is all good, we connect to the database mysql_connect("localhost", "******", "******") or die(mysql_error()); mysql_select_db("******") or die(mysql_error()); //Let's not forget the register globals off crap $animalID = $_GET['animalID']; $status = $_GET['status']; $date = $_GET['date']; $species = $_GET['species']; $breed = $_GET['breed']; $sex = $_GET['sex']; $primary_colour = $_GET['primary_colour']; $colour = $_GET['colour']; $distinctive_traits = $_GET['distinctive_traits']; $fur_length = $_GET['fur_length']; $age = $_GET['age']; $desexed = $_GET['desexed']; $microchipped = $_GET['microchipped']; $suburb = $_GET['suburb']; $pound_area = $_GET['pound_area']; $contact = $_GET['contact']; $link = $_GET['link']; $columns = $_GET['columns']; $find = $_GET['find']; $searching = $_GET['searching']; // We perform a bit of filtering $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); //Check to see if there's a page number, if not, set it to 1 if (!(isset($pagenum))) { $pagenum = 1; } //Count the number of results based on the search term $numresultsSQL = "SELECT *, MATCH(animalID, status, date, species, breed, sex, primary_colour, colour, distinctive_traits, fur_length, age, desexed, microchipped, suburb, pound_area, contact, img_data, notes) AGAINST ('%$find%' IN BOOLEAN MODE) AS score FROM animal_info WHERE MATCH(animalID, status, date, species, breed, sex, primary_colour, colour, distinctive_traits, fur_length, age, desexed, microchipped, suburb, pound_area, contact) AGAINST('%$find%' IN BOOLEAN MODE)"; $numresults = mysql_query($numresultsSQL) or die (mysql_error()."<br><br>Encountered when atemptempting to run the following query:<br>$numresultsSQL"); $rows = mysql_num_rows($numresults); $idForPicture = "SELECT ID FROM animal_info WHERE animalID='$find'"; $idResults = mysql_query($idForPicture) or die (mysql_error()."Couldn't get an ID from the record"); //How many results should be per page? $page_rows = 1; //What is the last page number? $last = ceil($rows/$page_rows); //Make sure the page number isn't a negative number or more than the maximum page required if ($pagenum < 1) { $pagenum = 1; } elseif ($pagenum > $last) { $pagenum = $last; } //Now we search for our search term, in the field the user specified so we know how many pages to link to at the bottom $data = "SELECT *, MATCH(id, animalID, status, date, species, breed, sex, primary_colour, colour, distinctive_traits, fur_length, age, desexed, microchipped, suburb, pound_area, contact, img_data, notes) AGAINST ('%$find%' IN BOOLEAN MODE) AS score FROM animal_info WHERE MATCH(animalID, status, date, species, breed, sex, primary_colour, colour, distinctive_traits, fur_length, age, desexed, microchipped, suburb, pound_area, contact) AGAINST('%$find%' IN BOOLEAN MODE) LIMIT 0,1"; $id = $row['id']; $img_mime = $row['img_mime']; $content = $row['img_data']; $results = mysql_query($data) or die(mysql_error()); //edited here if (mysql_num_rows($results) < 1) { echo "$noResults"; } elseif(mysql_num_rows($results) > 0) { //And we display the results of the search query as long as there is some while($row = mysql_fetch_array($results)) { //Build the HTML for the results in the table echo "$resultsHTMLabove"; echo " --Page $pagenum of $last-- <p>"; echo "<br><BR>"; //Here's the table echo "<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"2\">"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Animal ID</th>"; echo "<td>".$row['animalID']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Status</th>"; echo "<td>".$row['status']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Date</th>"; echo "<td>".$row['date']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Species</th>"; echo "<td>".$row['species']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Breed</th>"; echo "<td>".$row['breed']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Sex</th>"; echo "<td>".$row['sex']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Primary Colour</th>"; echo "<td>".$row['primary_colour']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Colour</th>"; echo "<td>".$row['colour']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Distinctive Traits</th>"; echo "<td>".$row['distinctive_traits']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Fur Length</th>"; echo "<td>".$row['fur_length']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Age</th>"; echo "<td>".$row['age']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Desexed?</th>"; echo "<td>".$row['desexed']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Microchipped?</th>"; echo "<td>".$row['microchipped']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Suburb</th>"; echo "<td>".$row['suburb']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Pound Area</th>"; echo "<td>".$row['pound_area']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Contact</th>"; echo "<td>".$row['contact']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Link</th>"; echo "<td><a href='".$row['link']."' target=_blank >Link to Facebook</a></td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Notes</th>"; echo "<td>".$row['notes']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" align=\"left\">Photo</th>"; echo "<td>"; echo "<img src=\"getimage.php?id=".$row['ID']."\" width=\"200px\" height=\"150px\" />"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "<BR><BR>"; //Build the navigation if ($pagenum == 1) { } else { echo " <a href='{$_SERVER['PHP_SELF']}?pagenum=1&find=$find&columns=$columns&searching=$searching'> <<-First</a> "; echo " "; $previous = $pagenum-1; echo " <a href='{$_SERVER['PHP_SELF']}?pagenum=$previous&find=$find&columns=$columns&searching=$searching'> <-Previous</a> "; } //This does the same as above, only checking if we are on the last page, and then generating the Next and Last links if ($pagenum == $last) { } else { $next = $pagenum+1; echo " <a href='{$_GET['PHP_SELF']}?pagenum=$next&find=$find&columns=$columns&searching=$searching'>Next -></a> "; echo " "; echo " <a href='{$_GET['PHP_SELF']}?pagenum=$last&find=$find&columns=$columns&searching=$searching'>Last ->></a> "; } echo "<br><BR>"; //And we remind them what they searched for echo "<b>You searched for:</b> " .$find; echo "</div>"; //Build the footer part of the page echo "$resultsHTMLbelow"; } //If there wasn't any results, we say thanks for searching, but we couldn't find anything that was worth showing and ask them to try again if ($numresults == 0) { //Once again, build the HTML output of the page for the "No Search Results" page echo "$noResultsSearch"; } } } ?> Really confusing to say the least. Could anyone shed some light? Any help would be appreciated! Cheers, Dave I am simple using include to include a file within the webpage. include $file; $file does exist and is a string. This works fine locally but when testing on my live server it isnt included and nothing below the include is executed, not even plain html. The error log shows nothing, and there are no errors on screen even when using E_ALL. So i decided to make $file point to the file on the server to see if it was picking it up and it does. So why doesnt the live server want to include this file? The file consists of php and html but there arent any errors. It wouldnt work locally if there were. Any ideas? So suppose I have a mysql table like the following Col1 Col2 Col3 Row1: A 10 2012-3-21 13:20:09 Row2: A 12 2012-3-20 12:04:09 Row3: A 5 2012-3-20 12:03:03 I need a query which will fetch me Row1 and Row2 given that I am searching for A, if the query sees that two rows occur on the same date, it should return the latest one. Any thoughts? I am having this weird session anomaly. When logged is as a regular user, all is well until I get to this one page in particular. Once I click the link to get to this page, I become logged in as someone else. The domain is consistent across, and session_start(); is present on all pages. Is there some check that I can use to figure out why this happens every time? Thanks. |