PHP - Tons Of Weird Problems
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?
Similar TutorialsDear 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!!! 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! Hey, been banging my head against the wall for a couple of hours now. There is an If () in the code that is driving me crazy because it is not behaving like I expect it to.. foreach ( $types as $type ) { if ( !isset( $type->modclass ) or !isset( $type->typestr ) ) { debugging( 'Incorrect activity type in ' . $modname ); continue; } $var = (string)$type->type; if ( $var != 'assignment&type=online' ) { print '<br/>' . $var . '<br/>'; if ( $type->modclass == MOD_CLASS_RESOURCE ) { $resources[$type->type] = $type->typestr; } else { $activities[$type->type] = $type->typestr; } } } results in... Code: [Select] label resource&type=text resource&type=html resource&type=file resource&type=directory resource&type=ims assignment_group_start assignment&type=upload assignment&type=online assignment&type=uploadsingle assignment&type=offline assignment_group_end Notice the assignment&type=online in the output... I'm just about ready to give up as to why it is still outputting $var when it is clearly equal to the compared string? Any ideas? Hi all, I can't find anything about this, but maybe someone knows this. the code below works as it should except when it is being included for some reason the filter function doesn;'t work and i get a pop up... $string = "<script> alert('koekoek')</script>"; echo 'string = '.filter_var($string, FILTER_SANITIZE_SPECIAL_CHARS).'<br />'; -edit: the string is normally is retrieved from a $_POST['var'] like: $query = $_POST['query']; echo 'query: '.filter_var($query, FILTER_SANITIZE_SPECIAL_CHARS).'<br />'; and thats when it seems to not work when included edit2: Now i changed the code a bit and put the filter function before echoing it, and than it works... may i assume that it should not be used in the echo directly? $query = filter_var($_POST['query'], FILTER_SANITIZE_SPECIAL_CHARS); echo $query; 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? 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? I'm inserting some data from a CSV file into a database. I'm using mysql_real_escape_string to escape a string and getting some really weird output. ex. input string = Adobe CS5 output = \0\0A\0d\0o\0b\0e\0 \0C\0S\05 I plugged the string into mb_detect_encoding and it told me it was in ASCII and I did a bunch of searching to find out that \0 is a null byte. The only thing I can't figure out is how to convert it to something that won't give me that garbage when I run it through mysql_real_escape_string. I tried mb_convert_encoding($str,"ISO-8859-1","ASCII") and it didn't do anything. Anyone know something I can try?? So, I wrote a little function the other day to fetch an array of elements out of character-separated-data (like "value1|value2|value3", but then fetched into an array using explode()). The only thing is just that it isn't working at all[/]. Every time I run the function, and catch it as an variable to use it as an array, it simply outputs the word "media", with each character separated into one array-element. Could anybody figure out what's wrong with my code? (Aside from my style, I know it's horrible. I'm halfway learning OOP) Any help would be greatly appreciated. Code: [Select] if(!function_exists('getText')) { function getText($item) { $text = explode(" | ", $data["text"][$item]); $text = Array(0=>"")+$text; return Array(1=>$data["text"][$item]); //outputs Array(0=>"", "m", "e", "d", "i", "a") } } 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. Hey guys! Well this is actually kind of a weird problem I have been having, and not too sure why I'm getting this problem. I've tried a lot of stuff, and it doesnt seem like I've been able to find a solution. I've been trying for about a month. Anyways, I have a website created with some OOP. Well, once I write an include statement to include a file, which then includes all my classes, it messes up my font, moves my website content down, and well.. it just does weird stuff. However, once I comment the include out, the website looks normal again. so basically, I can comment out the file itself and everything is just fine. But it only happens when I include my class files. Any ideas or suggestions would be amazing! Thank you! 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 have a function that contains 2 UPDATE commands. One updates a table whenever the function is ran. The second updates only if a condition is met. When the page loads the function is ran. For some reason the table is updated twice. So my table looks like this: Initially Viewed: 0 Replies: 0 Navigate to page: Viewed:2 Replies:0 Enter a reply and submit: Veiwed:4 Replies:1 No matter where I move the "viewed +1" code, it fires twice per page impression. Is this a glitch? Do functions run twice for some reason? If so why doesn't "reply +1" fire twice? //page loads as forum.php?goto=innertopic function connectForum(){ //connects DB if($_GET['goto'] == "innertopic"){ detailTopic(); } } function detailTopic(){ if(isset($_POST['content']{ //if there is a reply to a post mysql_query("UPDATE topics SET Replies=Replies+1") //works fine } else{ //no reply, just show all posts mysql_query("UPDATE topics SET Views=Views+1") //fires 2 times per page load .. ?!?!? //show posts //show reply window, posts to forum.php?goto=innertopic&&content=whateverTheUserTyped } } //html of page if($_GET['goto'] == "innertopic"){ connectForum(); } 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('', '', ''); } ?> has just solved it, can be deleted. |