PHP - Moved: How To Filter By Session_id ?
This topic has been moved to Third Party PHP Scripts.
http://www.phpfreaks.com/forums/index.php?topic=307001.0 Similar TutorialsI have a question. Session_id is unique or not. I see a lot of resource. There is no certain answer. Please tell me. Thank you very much. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=320638.0 hey guys sorry for the newb question... way back I had a site developed for me and ive since shut it down but thinking of re-creating a similar one. im looking over all of the old code files I have and I remember when logging in the developer had always set a session id....it I guess is a social networking site (mine was up years before facebooK!) lol. Anyway, what would be the benefit to setting a session_id on this even in the url have website.com/page.php?sid=328483248324 or some number or whatever it was. Just trying to educate myself. I was looking on php.net but didnt really get any answers that helped. thanks This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=322686.0 This topic has been blindfolded and driven across the boarder to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=344623.0 (That was a pun, not a typo.) This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=353613.0 I have some text boxes for searching the students in database also i have a drop down box for selecting student with balance amount to be paid tell me how to filter or search the list of stuents Code: [Select] <select> <option value="">All </option> <option value="">Unpaid </option> <option value="">Paid </option> </select> Hi there, I have one question about the function rand(), What if i want to have an number between 0 and 360 Without 90 to 180 so 91,92,93,94.....180 can't be the number how can i do that? btw, I know its possible through if,while,for and so on. But is there an other way to do this? I have a MySql table full of records. id owner car location on my page i have these results in a table i want to set a filter up so the table will only show cars from eg location England. at the minute its just set to show cars that owner has but i want a location filter any help HI all, Yesterday i read quite alot about htmlentities() htmlspecialchars() mysql_real_escape_string But today i stumbled upon filter() (http://www.w3schools.com/php/php_filter.asp). Does anyone know if this is also a good way to sanitize and may even be an alternative for the other functions? OR is it something completly different? I am still a novice with this so please enlighten me : ) TY Hey, 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; } } hi all i just read an article at http://www.phpro.org/tutorials/PHP-Security.html about not trusting server variables like $_SERVER['PHP_SELF'] so they explain, it can't be trusted and so on, but when it comes to a real life example i have difficulty understandig what someone could do with it since i assume it only has effect at client side. they use a form and say that Code: [Select] <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> ... </form> They give as example that someone could do the following: add Code: [Select] <script>alert("XSS HERE");</script> But i don't see how that would have effect to anyone except for the one that inserts that. Could someone maybe explain this a little to me. Code: [Select] SELECT * FROM table1,table2,table3,table4,table5 WHERE table1_f = table2_id AND table1_g = table3_id AND table4_p = table1_id AND table5 _m = table4_id ORDER BY RAND() LIMIT 1 Right, Now What I want to do, is have a filter form, which posts to the above, and if: $filter1 = ""; it wont be include in the above code $filter1 = "word"; then i want to include AND table3_n = '$filter1'; in the above code thanks in advance. Hello, I have a client with a "contact us" form who has recently been receiving a lot of spam emails from the form. I already have a session set in place so the form is only active one time. I am now creating a filter for the message to look for things like a url or bb style codes etc. What I've got seems to be working but would like your thoughts on maybe a better way of doing it or if you see something I may be missing. IF an offending text is detected the ip address is sent to me and I can block ip from the site. If the message passes it is sent to the client. This is the related code. Code: [Select] <?php $themessage=str_replace("\r",'<br>',$_POST['message']); $badwords=array("[", "url", "http", "link", ".com", ".net", ".org", ".biz", "<"); $o=0; foreach($badwords as $key2 => $value2){ $pos = strpos($themessage, $value2); if ($pos==0) { } else{ $o=$o+1; } } if ($o==0) { //compose and send email to client } else{ $useraddress=$_SERVER['REMOTE_ADDR']; //compose and send email to me containing offending address } ?> 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! Hey guys i am using a global filter on my $_POST function filter($str){return htmlentities($str, ENT_QUOTES);} $_POST = array_map('filter', $_POST); It helps me encode the stuff into the database. It works great on all my fields exept my arrays ... Ex: fields like this <input type="text" name="name[]" size="20"> breaks Any sugestions on gething this global filter working? Hi ! I have an 2d array like this: column 1 column 2 column 3 $data[0][0] $data[0][1] $data[0][2] $data[0][0] RDR -1.3 0.001 $data[1][0] RQR 0.4 0.01 $data[2][0] DDR 1 0.00004 and more... Now i need to filter this data. I only need the rows with column 3 < 0.01 AND column2 > 1 or column 2 < -1 . I have this, but it doesn't work: $teller = 0; for($i = 0; $aantal>$i; $i++) { if($data[$i][2]<=0.01) { $p[$teller][0] = $data[$i][0]; $p[$teller][1] = $data[$i][1]; $p[$teller][2] = $data[$i][2]; $teller++; } } $teller2 = 0; for($i = 0; $teller>$i; $i++) { if($p[$i][1] < -1 || $p[$i][1] > 1 ) { #als de p value kleiner is dan 0.01 dan alles kopieren in een nieuwe array $r[$teller2][0] = $p[$i][0]; $r[$teller2][1] = $p[$i][1]; $r[$teller2][2] = $p[$i][2]; $teller2++; } } Can you help me? How do I know if Filter extension is on with my webhost? Or does it always work with PHP5? If I cannot use it, can someone recommend a good regex to validate EMAIL addresses?? Thanks, Debbie Hi All I have a script which imports values from a csv file created using excel. However there are several blank values within the file where the person creating it has used blank columns to create whitespace in the file. I have used array_filter to remove these from the array, however how do I remove the redundant keys and 'squash' everything together so it is nice and neat? eg import would be , ,id, , surname, ,firstname, ,DOB, , address, , which returns array after array_filter [1]-> id [3]->surname [5]->firstname [7]->DOB [9]->address I want to return as an array which would be Quote [0]-> id [1]->surname [2]->firstname [3]->DOB [4]->address Is there a function to do this or would I need to create a custom one? Hi,
I want to use an external rss in my site but the problem is that i only want to grab feeds that contain certain keywords in the title,
This is what i got so far to display the feed:
<?php $html = ""; $url = "http://www.feedsite.com/conv-rss.asp"; $xml = simplexml_load_file($url); for($i = 0; $i < 5; $i++){ $title = $xml->channel->item[$i]->title; $link = $xml->channel->item[$i]->link; $description = $xml->channel->item[$i]->description; $pubDate = $xml->channel->item[$i]->pubDate; $html .= "<a href='$link'><h3>$title</h3></a>"; $html .= "$description"; $html .= "<br />$pubDate<hr />"; } echo $html; ?>The feed is a classified jobs but i only need the jobs listed for musicians, keywords could be: bassist, singer, drummer, musician, etc.. Thanks |