PHP - Weird Bug
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. Similar Tutorialsthis 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!!! 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!
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 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? 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! Hello i am writing a html form but i have problem with reading array. Here is html form: Code: [Select] <tr style="background-color: rgb(254, 242, 99);"><td>dghhf <input name="id[]" value="<?php echo $row['id']" type="hidden"> <input name="dbcheck[]" value="IF_THERE_IS_RECORD_TYPE 1 OR TYPE 0" type="hidden"></td> <td align="center"><input name="chk1[]" checked="checked" type="checkbox">chk1 <input name="chk2[]" type="checkbox">chk2 <input name="chk3[]" type="checkbox">chk3</td> <td align="center"> <select name="StartHour[]"> <option value=""></option> <option value="00">00</option><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05" selected="selected">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option> </select>:<select name="StartMin[]"><option value=""></option><option value="00">00</option> <option value="30" selected="selected">30</option></select> ~ <select name="EndHour[]"> <option value=""></option><option value="00">00</option><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20" selected="selected">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option> </select>:<select name="StartMin[]"><option value=""></option><option value="00" selected="selected">00</option> <option value="30">30</option></select></td></tr> Above HTML works great and no problem however my php code always take first record. Here is php section: Code: [Select] <?php $TODAY = strtotime($_GET['d']); if(isset($_POST['WorkEntry'])) { for($ii=0; $ii<count($_POST['girl_id']); $ii++) { if(isset($_POST['chk2'][$ii])){ $To = ""; $From = "ASK"; } else{ $To = $_POST['StartMin'][$ii]; $From = $_POST['StartHour'][$ii]; } if(isset($_POST['chk3'][$ii])) $ei = 1; else $ei = 0; if($_POST['dbcheck'][$ii] == 1) { echo $_POST['dbcheck'][$ii]; } else { if(isset($_POST['chk1'][$ii])) { $DELETE = "DELETE FROM time_table WHERE _id = '" .$_POST['_id'][$ii]. "' AND w_date = '" .$TODAY. "'"; } } echo $ei ."<BR>"; } } ?> I absolutely cannot login with facebook. Won't work. I have an account I use for freelancing and I can't use it.
I tried signing up another account, verification won't work. It tells me I succeeded in putting the pieces together with a big green check mark, and then afterwards it tells me there was an error and I didn't enter in the code properly. No idea what to do. Been like this for a few days. What's going on?
I'm having a weird issue with any elements that are given a width: 100% or width: auto. If the window is re-sized smaller. It seems to cut a chunk off and wreck hell upon the layout. I thought it was my code so I borrowed a few from tutorials etc with the same results. I've just installed FireFox also, thinking it was a Chrome bug, but that gives the same result too..
http://shanesdomain.byethost32.com/
I might be missing something obvious from lack of sleep, but could anyone assist this?
body { background: url(../images/background.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } #topbar-navigation { width: auto; height: 48px; background: #080d10; position: absolute; margin-left: auto; margin-right: auto; top: 0; left: 0; right: 0; display: inline-block; text-align: center; border-bottom: 1px solid #262b2f; z-index: 1; } #adblock-warning { width: auto; position: absolute; margin-left: auto; margin-right: auto; top: 0; left: 0; right: 0; background: #344152; font-family: 'sinkin_sans400_regular'; color: #b6b6b6; padding-top: 10px; padding-bottom: 10px; margin-top: 49px; text-align: center; font-weight: normal; font-size: 10px; white-space: nowrap; } #maincontainer { width: 960px; height: 1000px; position: absolute; margin-left: auto; margin-right: auto; margin-top: 150px; top: 0; left: 0; right: 0; background: #f2f2f2; } .user-icon-notif { height: 20px; width: 20px; position: absolute; margin-left: auto; margin-right: auto; margin-top: 15px; top: 0; left: 875px; right: 0; } .user-register { height: 20px; width: 20px; position: absolute; margin-left: auto; margin-right: auto; margin-top: 15px; top: 0; left: 815px; right: 0; text-decoration: none; font-family: 'sinkin_sans400_regular'; font-size: 11px; color: #99a0a8; } .user-register:hover { color: #c9c9c9; } .user-login { height: 20px; width: 20px; position: absolute; margin-left: auto; margin-right: auto; margin-top: 15px; top: 0; left: 700px; right: 0; text-decoration: none; font-family: 'sinkin_sans400_regular'; font-size: 11px; color: #99a0a8; } .user-login:hover { color: #c9c9c9; } <!DOCTYPE html> <html> <head> <META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8"> <META HTTP-EQUIV="content-language" content="EN"> <META NAME="Rating" content="General"> <META NAME="Designer" content="Shane Wilson"> <META NAME="Keywords" content="Gamer, Community"> <META NAME="revisit-after" content="7"> <META NAME="Robots" content="index,follow"> <META HTTP-EQUIV="Cache-Control" content="no-cache"> <META HTTP-EQUIV="Expires" content="0"> <META NAME="Author" content="Shane Wilson"> <link rel="stylesheet" type="text/css" href="css/index.css"> </head> <body> <div id="topbar-navigation"> <a href="register" class="user-register">Register</a> <a href="login" class="user-login">Login</a> </div> <div id="maincontainer"> </div> <script type="text/javascript" src="http://shanesdomain.byethost32.com/js/advertisement.js"></script> <script type="text/javascript"> if (document.getElementById("TestAdBlock") == undefined) { document.write('<div id="adblock-warning">Oops! It looks like you are using AdBlock. We know adverts can be annoying, but in order to keep the site running we have to display them</div>'); } </script> </body> </html> I am getting the following error message: Fatal error: Uncaught Error: Array callback must have exactly two elements in /Users/studio/Sites/BannerProject/b-as/tio-new/__classes/person_form_edit_initial.php:14 Stack trace: #0 /Users/studio/Sites/BannerProject/b-as/tio-new/index.php(78): require() #1 {main} thrown in /Users/studio/Sites/BannerProject/b-as/tio-new/__classes/person_form_edit_initial.php on line 14 for a line in my code that only has the following code: $person_id = $_SESSION('person_id'); This is a simple array assignment. Where is the "two elements" requirement? I"m confused by the "require() #1 {main}" comment in the message. If it refers to a require call in the index.php file, there are also no functions in that file or a file it requires that require two elements. --Kenoli Hi. I made a website to keep track of where I am in various manga. I noticed that sometimes the title I grab looks OK when rendered on the page but in the database it's weird looking
I did a for ($x=0; $x<strlen($title); $x++) loop and dumped $x, char at $ pos and ord of char: 0 = T = 84 1 = h = 104 2 = e = 101 3 = = 32 4 = D = 68 5 = e = 101 6 = m = 109 7 = o = 111 8 = n = 110 9 = = 32 10 = K = 75 11 = i = 105 12 = n = 110 13 = g = 103 14 = � = 226 15 = � = 128 16 = � = 153 17 = s = 115 18 = = 32 19 = D = 68 20 = a = 97 Is there some nifty built in function for converting that weird stuff to a regular apostrophe (and convert any other weird stuff)? I mean, I can write a filter to look for 226/128/153 and replace with ' but I'm sure there must be a proper way to handle that stuff. Thanks! I have an array from the database like so Array (2) ( | ['0'] => Array (4) | ( | | ['f_fid'] = String(1) "1" | | ['0'] = String(1) "1" | | ['f_names'] = String(99) "a:4:{i:0;s:18:"register_user_name";i:1;s:5:"r_u_n";i:2;s:10:"user_alias";i:3;s:12:"nickusername";} " | | ['1'] = String(99) "a:4:{i:0;s:18:"register_user_name";i:1;s:5:"r_u_n";i:2;s:10:"user_alias";i:3;s:12:"nickusername";} " | ) | ['1'] => Array (4) | ( | | ['f_fid'] = String(1) "2" | | ['0'] = String(1) "2" | | ['f_names'] = String(104) "a:4:{i:0;s:18:"register_password";i:1;s:5:"r_pass_word";i:2;s:10:"user_pass";i:3;s:12:"reg-pass-word";} " | | ['1'] = String(104) "a:4:{i:0;s:18:"register_password";i:1;s:5:"r_pass_word";i:2;s:10:"user_pass";i:3;s:12:"reg-pass-word";} " | ) ) So i use a foreach loop to turn the serialized value into an array foreach($fields as $key => $val) { $fields[$key]['f_names'] = unserialize($val['f_names']); } But for some reason the last f_names is false Array (2) ( | ['0'] => Array (4) | ( | | ['f_fid'] = String(1) "1" | | ['0'] = String(1) "1" | | ['f_names'] => Array (4) | | ( | | | ['0'] = String(18) "register_user_name" | | | ['1'] = String(5) "r_u_n" | | | ['2'] = String(10) "user_alias" | | | ['3'] = String(12) "nickusername" | | ) | | ['1'] = String(99) "a:4:{i:0;s:18:"register_user_name";i:1;s:5:"r_u_n";i:2;s:10:"user_alias";i:3;s:12:"nickusername";} " | ) | ['1'] => Array (4) | ( | | ['f_fid'] = String(1) "2" | | ['0'] = String(1) "2" | | ['f_names'] = Boolean(0) FALSE | | ['1'] = String(104) "a:4:{i:0;s:18:"register_password";i:1;s:5:"r_pass_word";i:2;s:10:"user_pass";i:3;s:12:"reg-pass-word";} " | ) ) Anyone have any idea why? Thanks 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. 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. Hello there, I am making a function to execute every time with a new demand no. in the while loop below. Every thing goes fine for the first time when the page loads, all the taxes come perfectly and each record is being read with the function calculateTaxes($demandno). But, when I press the search button with blank entries... All the entries come with only the first record. Means, the calculateTaxes function is not being loaded again and again with the loop when the press the search button. Please help. Please have a look in the below given code: Code: [Select] <?php function renderform($wardno, $demandno, $name) { include_once $_SERVER['DOCUMENT_ROOT'].'/npms/header.php'; include_once $_SERVER['DOCUMENT_ROOT'].'/npms/config/config.php'; include_once $_SERVER['DOCUMENT_ROOT'].'/npms/functions/functions.php'; include_once $_SERVER['DOCUMENT_ROOT'].'/npms/functions/connect-db.php'; extract($GLOBALS); if ($demandno == '' && $wardno == '' && $name == '') // all empty. { $result = mysql_query("SELECT * FROM sform where paid=false order by wardno, id, demandno limit 0,$maxrecords") or die(mysql_error()); } if ($demandno != '' && $wardno != '' && $name != '') // all full. { $result = mysql_query("SELECT * FROM sform where demandno='$demandno' and wardno='$wardno' and (name like '%$name%') and paid=false order by wardno, id, demandno") or die(mysql_error()); } if ($demandno != '' && $wardno == '' && $name == '') // demand full else empty. { $result = mysql_query("SELECT * FROM sform where demandno='$demandno' and paid=false order by wardno, id, demandno") or die(mysql_error()); } if ($demandno != '' && $wardno != '' && $name == '') // demand and ward full else empty. { $result = mysql_query("SELECT * FROM sform where demandno='$demandno' and wardno='$wardno' and paid=false order by wardno, id, demandno") or die(mysql_error()); } if ($demandno == '' && $wardno != '' && $name == '') // ward full else empty. { $result = mysql_query("SELECT * FROM sform where wardno='$wardno' and paid=false order by wardno, id, demandno") or die(mysql_error()); } if ($demandno == '' && $wardno != '' && $name != '') // ward and name full else empty. { $result = mysql_query("SELECT * FROM sform where wardno='$wardno' and (name like '%$name%') and paid=false order by wardno, id, demandno") or die(mysql_error()); } if ($demandno == '' && $wardno == '' && $name != '') // name full else empty. { $result = mysql_query("SELECT * FROM sform where (name like '%$name%') and paid=false order by wardno, id, demandno") or die(mysql_error()); } if ($demandno != '' && $wardno == '' && $name != '') // demand and name full else empty. { $result = mysql_query("SELECT * FROM sform where demandno='$demandno' and (name like '%$name%') and paid=false order by wardno, id, demandno") or die(mysql_error()); } usleep(200000); // wait for 2 seconds ?> <link rel=stylesheet HREF="/npms/css/sp.css" type="text/css" media="screen"> <div id="content"> <div id="labelopt"></div> <h2>okMZokj ukxfjdksa dh lwph</h2> <div id="list"> <form name="spsearchform" action="" method="post"> <table border="1" cellpadding="2px"> <tr> <td id="labelmust" width="10%">fM- dz- %</td> <td><input class="english" type="text" size="15%" name="demandno" maxlength="40" value="<?php echo $demandno; ?>" /></td> <td id="labelmust" width="10%">okMZ dz- %</td> <td><input class="english" size="20%" type="text" size="15%" name="wardno" maxlength="3" value="<?php echo $wardno; ?>"/></td> <td id="labelmust" width="10%">uke %</td> <td><input class="hindi" size="30%" type="text" name="name" maxlength="100" value="<?php echo $name; ?>"/></td> <td><input type="submit" value="Search" name="btnsearch" /></td> </tr> </table> </form> <div style="color: red;"><small><cite>List is limited to <? echo $maxrecords; ?> records. For precise searching, use the search options above.</small></cite></div> <table border="1" cellpadding="2px"> <tr> <td colspan="8" id="english"><div style="float: right; color: red; text-align: right; margin-right: 10px;"><small><cite><strong><? echo mysql_num_rows($result); ?> records</strong> dumped.</cite></small></div></td> </tr> <tr> <td id="labelcenter">okMZ dz-</td> <td id="labelcenter">fMeka.M dzekad</td> <td id="labelcenter">uke</td> <td id="labelcenter">irk</td> <td id="labelcenter">'kq} dj</td> <td id="labelcenter">dj fooj.k</td> <td id="labelcenter">fu;kstu</td> <td id="labelcenter">feVk;sa</td> </tr> <?php if (mysql_num_rows($result) > 0) { while($row = mysql_fetch_array( $result )) { echo "<tr>"; echo "<td id='english'><center>" . $row['wardno'] . "</center></td>"; echo "<td id='english'><center>" . $row['demandno'] . "</center></td>"; echo "<td id='hindi'>" . $row['name'] . "</td>"; echo "<td id='hindi'>" . $row['address'] . "</td>"; $taxes = calculateTaxes($row['demandno']); echo "<td id='english' align='right'>" . number_format($taxes['grosstax'],2) . "</td>"; echo '<td><center><a href="payments/taxreport.php?demandno=' . $row['demandno'] . '"><img src="../images/payment.jpeg" width="15" height="15" /></center></a></td>'; echo '<td><center><a href="spedit.php?demandno=' . $row['demandno'] . '"><img src="../images/edit.gif" width="15" height="15" /></center></a></td>'; echo '<td><center><a href="spdelete.php?demandno=' . $row['demandno'] . '"><img src="../images/delete.jpeg" width="15" height="15" /></center></a></td>'; } } else { echo "<tr>"; echo "<td colspan='7' align='center'><blink><strong>lwph miyC/k ugha gS A</strong></blink></td>"; echo "</tr>"; } ?> </tr> </table> </div> <div id="menu"> <table> <tr> <td> <input type="button" value="New" name="btnnew" onclick="location.href='spnew.php';" /> <input type="button" value="Back" name="btnspback" onclick="location.href='../sp.php';" /> </td> </tr> </table> </div> </div> <?php include_once $_SERVER['DOCUMENT_ROOT'].'/npms/footer.php'; } include_once $_SERVER['DOCUMENT_ROOT'].'/npms/functions/connect-db.php'; include_once $_SERVER['DOCUMENT_ROOT'].'/npms/functions/functions.php'; if(isset($_POST['btnsearch'])) { $wardno = mysql_real_escape_string(htmlspecialchars($_POST['wardno'])); $name = mysql_real_escape_string(htmlspecialchars($_POST['name'])); $demandno = mysql_real_escape_string(htmlspecialchars($_POST['demandno'])); renderform($demandno, $wardno, $name); } else { renderform('', '', ''); } ?> This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=350068.0 I have an array that displays the following information with the print_r function: Array ( => Array ( => 2206.235 [1] => 3.9 [2] => 0.48 [3] => 0.477 [4] => 0.477 [5] => 0.475 [215] => 0.434 [216] => 0.436 [217] => 0.435 [218] => 0.434 [219] => 0.435 [220] => 0.435 ) ) Array ( => Array ( => 2206.235 [1] => 3.9 [2] => 0.48 [3] => 0.48 [4] => 0.435 [5] => 0.435 ) ) I would like to save the last row to my database which in this case is 220 but the last row could vary from time to time as the array is created from an email attachment so l wanted a code that would find the number of rows in the array. When l echo out the row like this: echo $matches[0][210] it retrieves the correct information so l wanted to implement this code instead to cater for an unknown amount of array rows so that the highest row was always returned: $i = count($matches[0]); echo $matches[0][$i]; but this does not work as when echoing $i the result is 2216 instead of 220 which l find odd or l am doing something wrong. Any ideas? thanks Callum 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? 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 Im getting a realy weird error i my page. Quote Parse error: syntax error, unexpected T_VARIABLE in /pathtoroot/subscribers.php on line 1 Code: [Select] <?php session_start(); include 'header.php'; include("connect.php"); $username = $_SESSION['username']; $id = $_SESSION['uid']; How on earth is there an error there lol? |