PHP - Stop Word Filter Code Not Working...
Friends,
I have a code to filter out stopwords (from text file) out of a string supplied. Seems its not filtering out the stop words. Code: [Select] <?php $CommonWords = file_get_contents('http://minimate.co.uk/stopwords.txt'); $CommonWords = explode("\n", $CommonWords); $keywords = 'This is did samle a as any ass'; $search_keywords = strtolower(trim($keywords)); $arrWords = explode(' ', $search_keywords); $arrWords = array_unique($arrWords); foreach ($arrWords as $word) { if (!in_array($word, $CommonWords) && (trim($word) != '')) { $searchWords[] = $word; } } print_r($searchWords); ?> Output is: Quote Array ( => this [1] => is [2] => did [3] => sample [4] => a [5] => as [6] => any [7] => ass ) So the output is not filtering out any words from that text file. Can someone help me with this? Cheers Natasha T Similar TutorialsHey, I have a word filter which is dectecting strings that are only embedded in words. Which i don't want it to do. For example: If i want to filter "FR" and some one puts france - it flags it because france contains FR. How do i make it only look for "FR" on its own seperated from a word instead of it flagging nearly all words with the two letters together? Heres my filter: $text = 'testing'; //this should not return 1 // fill this array with the bad words you want to filter and their replacements $bads = array ("test"); foreach($bads as $key => $search_needle) { if(stristr($text, $search_needle) == TRUE) { return(1); break; } } Hello Guys, I need some help here.. I want to implement a Bad word filter and not quite sure how to do it.. I am grabbing the following vars from the text fields $ad_title = filter_var($_POST['ad_title'], FILTER_SANITIZE_STRING,FILTER_FLAG_NO_ENCODE_QUOTES); $ad_body = filter_var($_POST['description'], FILTER_SANITIZE_STRING,FILTER_FLAG_NO_ENCODE_QUOTES); Then its inserted into the db. I would like to run it through this function first.. Code: [Select] FUNCTION BadWordFilter(&$text, $replace){ // fill this array with the bad words you want to filter and their replacements $bads = ARRAY ( ARRAY("butt","b***"), ARRAY("poop","p***"), ARRAY("crap","c***") ); IF($replace==1) { //we are replacing $remember = $text; FOR($i=0;$i<sizeof($bads);$i++) { //go through each bad word $text = EREGI_REPLACE($bads[$i][0],$bads[$i][1],$text); //replace it } IF($remember!=$text) RETURN 1; //if there are any changes, return 1 } ELSE { //we are just checking FOR($i=0;$i<sizeof($bads);$i++) { //go through each bad word IF(EREGI($bads[$i][0],$text)) RETURN 1; //if we find any, return 1 } } } // this will replace all bad words with their replacements. $any is 1 if it found any $any = BadWordFilter($wordsToFilter,1); I really would also like to query a table for any words that match and then use a replacement like [censored] Any help would be greatly appreciated! Ok I'm trying to make word replace but I'm have some problems , first I have in my database row "words" have the words it look for to replace row "wordsys" have the replacement word the problem I'm have is let say the text I want to replace is "My friend is in here house" and row "words" has "My, In , here" in it and the replacement words are in wordsys has "In for My" "We for In" and "gone for here" so first it going to replace "My" with "In" that good ,but then it going back and replacing "In" the we just replaced with "We" and so forth who do I stop it from re-replace a word that it already replace. <?php //connect to database $textw = "My friend is in here house"; //load all replacements $result = mysql_query("SELECT * FROM data"); //replace all words $words = array(); $replacewords =array(); while ($row = mysql_fetch_assoc($result)) { $words[] = $row['words']; $replacewords[] = $row['wordsys']; } $text = str_replace($words,$replacewords,$textw); echo $text; ?> Thank you for your help Hi all. I have three scripts interacting with one another to create a checkbox that when selected will filter out any products from the table that are custom products (any products with product_type = 3 in the sql database). Right now the page reloads when the checkbox is clicked to the correct url, but the table hasn't actually has custom products filtered out. I'm very new to programming and made these code changes by copying and modifying another checkbox for our website that already worked. Please take a look and let me know if you see where I might be going wrong. I have tried to include all relevant parts of the scripts: Code: [Select] // index.php if (isset( $_GET['exclude_custom'] )) { if($_GET['exclude_custom'] == "noexclude"){ $exclude_custom = ''; $exclude = "noexclude"; $AppUI->setState( 'QuoteIdxCond', 'noexclude'); } else{ $exclude_custom = "exclude"; $exclude = "exclude"; $AppUI->setState( 'QuoteIdxCond', 'exclude'); } } $exclude = $AppUI->getState( 'QuoteIdxCond' ) ? $AppUI->getState( 'QuoteIdxCond' ) : ''; if($exclude == "exclude") $exclude_custom = "exclude"; else $exclude_custom = ''; Code: [Select] // vw_idx_products.php global $sort_state, $products_view_mode, $exclude_custom; include_once("{$dPconfig['root_dir']}/modules/quotes/utility.php"); load_all_products(); <script LANGUAGE="JavaScript"> function excludeCustom() { f = document.productQuotes.exclude_custom.checked; if(f == true) window.location =('./index.php?m=quotes&exclude_custom=exclude'); else // window.location =('./index.php?m=quotes&exclude_custom=noexclude'); window.location =('./index.php?m=quotes&exclude_custom=noexclude'); } </script> <FORM ACTION="?m=quotes" METHOD="post" NAME="productQuotes" ID="productQuotes"> <B> Stock Products & Services Only: </B><input type="checkbox" onclick="excludeCustom()" NAME="exclude_custom" id="exclude_custom" <?php echo ($exclude_custom ? 'checked="checked"' : '');?> /> <THEAD> Code: [Select] // utility. php global $item_list, $drawn_array, $item_list_parents, $sort_state, $AppUI, $exclude_custom; function load_all_products() { global $AppUI; global $sorted_item_list; global $additional_pfilter; load_type_list(); $orderby = 'product_id'; $search_map = array($orderby, 'product_number','product_name'); $where = $AppUI->getState( 'QuoteIdxWhere' ) ? $AppUI->getState( 'QuoteIdxWhere' ) : '*'; $not =" "; $op = " OR"; $check = substr(trim($where),0,4); if(stristr($check,"NOT")){ $op ="AND"; $not = " NOT "; $where = substr(trim($where),4); $where = trim($where); } // assemble the sql statement $q = new DBQuery; $q->addTable('products'); $q->addJoin('companies', 'com', 'products.product_company_id = com.company_id'); $q->addJoin('users', 'u', 'products.product_owner = u.user_id'); $q->addQuery('products.*, com.company_name, u.user_username'); $where_filter = " "; foreach($search_map as $search_name) $where_filter .=" $op $search_name $not REGEXP '$where'"; $where_filter = substr($where_filter, 5); // echo $where_filter; if($where != "*") $q->addWhere("($where_filter)"); $q->addOrder('product_id'); if (isset( $_POST['exclude_custom'] )) { $where_filter .= "AND PRODUCT_TYPE != '3'"; } $sql = $q->prepare(); $q->clear(); $sql_list = db_exec( $sql ); if ($sql_list) $rn = db_num_rows( $sql_list ); else { echo db_error(); $rn = 0; } Thanks! Hey guys for a project im making a search filter function. Only one filter seems to be working and that's the genre filter :(
This is my code:
function filterFilms(){ global $conn; $loop = 0; if(isset($_POST['titel']) && !empty($_POST['titel'])){ $titel = sanatize($_POST['titel']); } if(isset($_POST['genre']) && !empty($_POST['genre'])){ $genre = sanatize($_POST['genre']); } $sql = "SELECT TOP 20 * From Movie Inner Join Movie_Director On Movie_Director.movie_id = Movie.movie_id Inner Join Movie_Genre On Movie_Genre.movie_id = Movie.movie_id Inner Join Person On Movie_Director.person_id = Person.person_id"; if(isset($titel) && !empty($titel)){ if($loop == 0){ $sql .= " WHERE ( title = ':titel' OR title like ':titel')"; $loop++; } else{ $sql .= " AND ( title = ':titel' OR title like ':titel')"; } } if(isset($genre) && !empty($genre)){ if($loop == 0){ $sql .= " WHERE genre_name = :genre"; $loop++; } else{ $sql .= " AND genre_name = :genre"; } } $query = $conn->prepare($sql); if(isset($titel) && !empty($titel)){ $query->bindValue('titel', $titel,PDO::PARAM_STR); } if(isset($genre) && !empty($genre)){ $query->bindParam('genre', $genre,PDO::PARAM_STR); } $query->execute(); $rows = $query->fetchAll(); return $rows; }
Anyone any idea??
Hey all, While the filter itself is functioning properly, the flag doesn't seem to be. Here's how I have it set up: Code: [Select] $UserInput = filter_var($UserInput , FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); // Test Format 1 $UserInput = filter_input(INPUT_POST, 'UserInput', FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); // Test Format 2 As you can see, I have set up to test methods however, each one fails regarding the flag..or so it's seeming to me. FILTER_FLAG_STRIP_LOW is supposed to strip out anything > 32 in ascii, but it isn't. '&' (38) is greater than 32 but it still displays in the browser. Am I missing something here? The code belows stops sql queries from being executed when there are blank fields on my form. Aswell as this, a message is displayed '<br> but you did not complete all of the required fields, please try again' How can I tell me page to check the fields upon pressing the click button, opposed to onload? Code: [Select] <?php include('func.php'); include($_SERVER['DOCUMENT_ROOT'].'/include/db.php'); ?> <!--$INC_DIR = $_SERVER["DOCUMENT_ROOT"]. "/include/";--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Chained Select Boxes using PHP, MySQL and jQuery</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#wait_1').hide(); $('#drop_1').change(function(){ $('#wait_1').show(); $('#result_1').hide(); $.get("func.php", { func: "drop_1", drop_var: $('#drop_1').val() }, function(response){ $('#result_1').fadeOut(); setTimeout("finishAjax('result_1', '"+escape(response)+"')", 400); }); return false; }); }); function finishAjax(id, response) { $('#wait_1').hide(); $('#'+id).html(unescape(response)); $('#'+id).fadeIn(); } </script> </head> <body> <p> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post"> Name: <input type="text" name="Name" maxlength="50"/><br /> Phone: <input type="text" name="Phone" maxlength="50"/><br /> Email: <input type="text" name="Email" maxlength="50"/><br /> Postcode: <input type="text" name="Postcode" maxlength="50"/><br /> Web Address: <input type="text" name="Website" maxlength="50"/><br /><br /> <select name="drop_1" id="drop_1"> <option value="" selected="selected" disabled="disabled">Select a Category</option> <?php getTierOne(); ?> </select> <span id="wait_1" style="display: none;"> <img alt="Please Wait" src="ajax-loader.gif"/> </span> <span id="result_1" style="display: none;"></span> <br /> </form> </p> <p> <?php if(isset($_POST['submit'])){ $drop = mysql_real_escape_string($_POST['drop_1']); $tier_two = mysql_real_escape_string($_POST['Subtype']); echo "You selected "; echo $drop." & ".$tier_two; } $Name = mysql_real_escape_string($_POST["Name"]); $Phone = mysql_real_escape_string($_POST["Phone"]); $Email = mysql_real_escape_string($_POST["Email"]); $Postcode = mysql_real_escape_string($_POST["Postcode"]); $Website = mysql_real_escape_string($_POST["Website"]); if($Name == '' || $Phone == '' || $Email == '' || $Postcode == '' || $Website == '') { die('<br> but you did not complete all of the required fields, please try again'); } echo "<br>"; echo $Name; echo "<br>"; echo $Website; $query = ("INSERT INTO business (`id`, `Name`, `Type`, `Subtype`, `Phone`, `Email`, `Postcode`, `Web Address`) VALUES ('NULL', '$Name', '$drop', '$tier_two' , '$Phone', '$Email', '$Postcode', '$Website')"); mysql_query($query) or die ( "<br>Query: $query<br>Error: " .mysql_error()); ?> </body> </html> The pre tags: <pre></pre>get saved in the database like in the above shown example. Though, when reopening them within a textarea they stop working. For example: <pre><h1>The Headline</h1></pre>becomes: The Headline within the textarea. The Questions: What happens here? How to solve it? Edited by glassfish, 03 October 2014 - 09:42 AM. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=345438.0 Hi all, I am in need of php code for word file conversion. That is to convert word .docx file to .doc file Someone please provide me with a solution. Thanks. <?xml-stylesheet href="/player.xsl" type="text/xsl"?> <config> <auto_start>false</auto_start> <player_skin>/test.swf</player_skin> <main_title>Test</main_title> <playlist_title>PLAYLIST</playlist_title> <time_text>TOTAL TIME</time_text> <pan_labels>L,R</pan_labels> <scroller_speed>1</scroller_speed> <scroller_marquee_content>#TRACK_NAME#</scroller_marquee_content> <repeat_is_enabled>false</repeat_is_enabled> <shuffle_is_enabled>false</shuffle_is_enabled> <default_volume>75</default_volume> <default_pan>0</default_pan> <play_list> <item>test.mp3;Test Soundtrack</item> </play_list> </config>Hi, The above code is from an XML file and I added the <?xml line of code to the XML file, but doing so causes the whole page to no longer display the track information (just blank). Is there there a way I could modify that text to try and call it another way? Thanks Edited by hexcode, 16 July 2014 - 02:52 PM. On all my forms, after I send an empty string to one field, it will stop accepting values when I resubmit. My code passes through the W3C validator Any ideas?? how can i use die but still continue with the html in the rest of code instead of stopping all codes from where die is initiated. i want to die (insert into database) but then still allow the html codes below the die function to work still. \= http://paste.ee/p/OhiWv
The above is a link to a readable version of my code. The XMLHTTPREQUEST worked, and the array was pulled down. Was able to print out the undecoded/unparsed array. However, immediately afterwards, all code stops working.
<script> var xhr; if (window.XMLHttpRequest) { // Mozilla, Safari, ... xhr = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE 8 and older xhr = new ActiveXObject("Microsoft.XMLHTTP"); } xhr.open("POST", "PHPLibrary/selectMemberResults.php", true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send(); xhr.onreadystatechange = display_data; var $phparray function display_data() { if (xhr.readyState == 4) { if (xhr.status == 200) { //alert(xhr.responseText); $phparray = xhr.responseText; document.getElementById("suggestion").innerHTML = $phparray; // // //......................................................? // The above line of code is the last thing to print or // to do anything that returns to the browser.... //.......................................................? // All lines below do nothing............................? // } else { //alert('There was a problem with the request.'); } } } document.write("Length of phparray Array :" + $phparray.length + "<"); var output = JSON.parse($phparray, function (key,val) { if ( typeof val === 'string' ) { // regular expression to remove extra white space if ( val.indexOf('\n') !== -1 ) { var re = /\s\s+/g; return val.replace(re, ' '); } else { return val; } } return val; } ); document.write("Length of Array :" + $output.length + "<"); for (var i=0; i < $output.length; i++) { document.getElementById("suggestion").innerHTML = $output[i].MEMBER_NAME; } </script> i dont understand what is wrong plz help me.
here is code
$name = "img/".rand(1,9999999).".png"; $myFile = $name; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = $html; fwrite($fh, $stringData); fclose($fh); $file=$name; $fst=file_get_contents($file); $im=imagecreatefromstring($fst); imagefilter($im, IMG_FILTER_GRAYSCALE); imagefilter($im, IMG_FILTER_NEGATE); //Convert to Grey Scale for($i=0;$i<123;$i++){ for($j=0;$j<50;$j++){ $px=imagecolorat($im,$i,$j); if($px<0x303030){ imagesetpixel($im,$i,$j,0); }else{ imagesetpixel($im,$i,$j,0xffffff); } } } $database = unserialize(@file_get_contents("db.txt")); if($database === false) $database = array(); // modify the database if needed if($_SERVER['REQUEST_METHOD'] == 'POST'){ if($_POST['submit'] == 'Add') $database[$_POST['ident']] = substr($_POST['letter'], 0, 1); if($_POST['submit'] == 'Del') unset($database[$_POST['ident']]); if($fh = @fopen('db111.txt', 'w+')){ fwrite($fh, serialize($database)); fclose($fh); } }else{ $newimage = true; } $width = 130; $height = 40; $captcha_gridstart =1; $captcha_gridspace =2; $letters = findletters($im, $width, $height, $captcha_gridstart, $captcha_gridspace); $count = count($letters); $cellw = ($count > 0) ? intval(100 / $count) : 0; //dispeckle the image and GET co-ordinates of the characters of captcha image and return them. function findletters($image, $width, $height, $gridstart, $gridspace){ $offsets = array(); $o = 0; $atstartx = true; for($x = 0; $x < $width; $x++){ $blankx = true; for($y = 0; $y < $height; $y++){ if(imagecolorat($image, $x, $y) == 0){ $blankx = false; break; } } if(!$blankx && $atstartx){ $offsets[$o]['startx'] = $x; $atstartx = !$atstartx; }else if($blankx && !$atstartx){ $offsets[$o]['endx'] = $x; $atstartx = !$atstartx; $o++; } } $count = $o; for($o = 0; $o < $count; $o++){ for($y = 0; $y < $height; $y++){ $blanky = true; for($x = $offsets[$o]['startx']; $x < $offsets[$o]['endx']; $x++){ if(imagecolorat($image, $x, $y) == 0){ $blanky = false; break; } } if(!$blanky){ $offsets[$o]['starty'] = $y; break; } } for($y = $height-1; $y > $offsets[$o]['starty']; $y--){ $blanky = true; for($x = $offsets[$o]['startx']; $x < $offsets[$o]['endx']; $x++){ if(imagecolorat($image, $x, $y) == 0){ $blanky = false; break; } } if(!$blanky){ $offsets[$o]['endy'] = $y; break; } } } for($o = 0; $o < $count; $o++){ $offsets[$o]['ident'] = ""; for($x = $offsets[$o]['startx'] + $gridstart; $x < $offsets[$o]['endx']; $x += $gridspace){ for($y = $offsets[$o]['starty'] + $gridstart; $y < $offsets[$o]['endy']; $y += $gridspace){ $offsets[$o]['ident'] .= ((imagecolorat($image, $x, $y) == 0) ? "0" : "1"); #echo $offsets[$o]['ident'].'<br>'; } } } return $offsets; } $a=""; foreach($letters as $letter){ $asciiletter = $database[$letter['ident']]; if(!empty($asciiletter)) { $a.=$asciiletter; } } <?php require_once("includes/connection.php");?> <html> <head> <style type="text/css"> <!-- a:link { color: #000000; text-decoration: none; } a:visited { text-decoration: none; color: #000000; } a:hover { text-decoration: underline; color: #FFFFFF; } a:active { text-decoration: none; color: #000000; } a { font-family: Courier New, Courier, monospace; } body,td,th { font-family: Courier New, Courier, monospace; font-size: 18px; } .style1 {font-size: 40px} #one { text-align:center; vertical-align:top; } #parent { position:absolute; left:60px; font-size:14px; } --> </style> </head> <body> <table width="100%" height="888" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="186" colspan="2" bgcolor="#CCCCCC"><div align="center" class="style1">DOWNLOAD TREASURE </div></td> </tr> <tr> <td id="one" width="16%" bgcolor="#99CCFF" ><?php $result =mysql_query("SELECT * FROM subjects",$connection); if(!$result){ die("connection error : ".mysql_error()); } while($row = mysql_fetch_array($result)){ echo $row["menu_name"]."<br/>"; } $parent = mysql_query("SELECT * FROM pages WHERE subject_id = {$row["id"]}" ,$connection); if(!$parent){ die("connection error : ".mysql_error()); } while($rowone = mysql_fetch_array($parent)){ echo $rowone["menu_name"]; } ?></td> <td width="84%"> </td> </tr> </table> </body> </html> is there any mistake here.it is a big help for me. I am a newbie PHP Web Developer and currently reading the book 'PHP and MYSQL Web Development' by Luke Welling and Laura Thomson. Following what was written in the book, that is what I got:
<?php $tireqty = $_POST['tireqty']; $oilqty = $_POST['oilqty']; $sparkqty = $_POST['sparkqty']; $address = $_POST['address']; $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT']; $date = date('H:i, jS F Y'); ?> <html> <head> <title>Order Results</title> </head> <body> <h1>Bob's Auto Parts</h1> <h2>Order Results</h2> <?php if($tireqty == 0 && $oilqty == 0 && $sparkqty == 0){ echo '<p>You did not order anything on the previous page!</p>'; exit; }else{ echo '<p>Order Processed at '.$date.'</p>'; $totalqty = 0; $totalqty = $tireqty + $oilqty + $sparkqty; echo 'Items ordered: '.$totalqty.'<br />'; $totalamount = 0.00; define('TIREPRICE',100); define('OILPRICE',10); define('SPARKPRICE',4); $totalamount = $tireqty * TIREPRICE + $oilqty * OILPRICE + $sparkqty * SPARKPRICE; echo 'Subtotal: $'.number_format($totalamount,2).'<br />'; $taxrate = 0.10; $totalamount = $totalamount * (1 + $taxrate); echo '<p>'.'Total including tax: $'.number_format($totalamount,2).'<br /></p>'; echo '<p>Adress to ship to is '.$address.'<br />'; $outputString = $date."\t".$tireqty." tires \t".$oilqty." oil \t".$sparkqty." spark plugs \t".$totalamount."\t".$address."\n"; //opening files. @ $fp = fopen("$DOCUMENT_ROOT/booktutorials/orders.txt", 'ab'); /////////////////////////////////HERE IS WHERE IT WOULD NOT WORK AS I WANT TO //////////////////////////////////////////////////// if(!$fp){ echo "<p><strong> Your order could not be processed at this time. Please try again later.</strong></p>"; exit; } flock($fp, LOCK_EX); fwrite($fp, $outputString, strlen($outputString)); flock($fp, LOCK_UN); fclose($fp); echo "<p>Order written.</p>"; echo '<hr />'. file_get_contents("$DOCUMENT_ROOT/booktutorials/orders.txt"); } ?> </body> </html>All I get is 'Your order could not be processed at this time. Please try again later'. Even though I am pretty sure that the URL of the file is correct. Please help. Thanks in advance. <?php session_start(); if($_SESSION['username']) echo "Welcome, ".$_SESSION['username']."!<BR>"; echo "<a href=\"logout.php\">LOGOUT</a>"; else die("Your Have To Be Logged In To View This Page"); ?> anyone see anything wrong with this i'm getting a parse error on line 8 that is the else statment Hi, I have a registration page (that one works fine) where users register with minimal personal info. They also get to rate 8 categories (see bellow) 1-5. Once they hit submit it all goes into database just fine. I have also created a page for myself where I can recall all data for any registration. All data gets pulled from database correctly. When I change variables and hit submit it does not update the record in the database. I get no errors from the script, but I have narrowed the problem to the recall of categories and the ratings. If I remove them from the update script other info gets stored correctly. Here is how I recall the 8 categories and their user submitted ratings (as well as other info): Code: [Select] $category = array('AS','BE','BI','CH','CS','EG','EV','PH'); foreach ($category as $cat) { if ($cat == 'AS') $cat_name = 'Animal Sciences'; if ($cat == 'BE') $cat_name = 'Behavioral & Social Sciences'; if ($cat == 'BI') $cat_name = 'Biology'; if ($cat == 'CH') $cat_name = 'Chemistry'; if ($cat == 'CS') $cat_name = 'Computer Science'; if ($cat == 'EG') $cat_name = 'Engineering'; if ($cat == 'EV') $cat_name = 'Environmental Sciences'; if ($cat == 'PH') $cat_name = 'Physical Sciences'; echo" <tr> <td>$cat_name</td>"; $numbers = array('0','1','2','3','4','5'); foreach ($numbers as $no) { echo "<td><input type='radio' name='$cat' value='$no'"; if ($row[$cat] == $no) echo " checked/>"; else echo "/>"; echo"$no</td>"; }} And here is how I update the record (as well as other info not listed): Code: [Select] mysql_query("UPDATE registrations SET AS = '$_POST[AS]', BE = '$_POST[BE]', BI = '$_POST[BI]', CH = '$_POST[CH]', CS = '$_POST[CS]', EG = '$_POST[EG]', EV = '$_POST[EV]', PH = '$_POST[PH]' WHERE ID = '$_POST[ID]' "); Something in my recall code is creating issued for me, but I have no idea what. Thanks Code goes no place but changes some figures on the tool bar. Code: [Select] <?php ini_set('display_errors', 1); error_reporting(E_ALL); function OnSubmitForm() { $choose = ""; $variable1 = ""; $variable2 = ""; $choose = $_GET["pages"]; $variable1 = $_GET["page1"]; $variable2 = $_GET["page2"]; if ($choose == $variable1) { header("Location: http://url.com/page1"); } if ($choose == $variable2) { header("Location: http://url.com/page2"); } } ?> <form name="pages" onsubmit="return OnSubmitForm()"> <input type="text" name="call" size="25"> e<select name="pages"> <option name="page1" value="non1">page1</option> <option name="page2" value="non2">page2</option> </select> <input type="submit" name="submit" value="submit"> </p> </form> |