[Solved] Browse directory recursively and get files name

[ad_1] Since I’ve had to create the same functionality for a website of mine too, I’ll post my function as reference. function recursiveFileSearch($path, $searchmask = “*”) { $path = rtrim($path, “https://stackoverflow.com/”); $files = array(); if(is_array($searchmask)) { for($i = 0; $i < count($searchmask); $i++) { $files = array_merge($files, glob($path.”https://stackoverflow.com/”.$searchmask[$i])); } sort($files); } else { $files = … Read more

[Solved] How to store search result by using session? [closed]

[ad_1] <?php session_start(); //to start session $_SESSION[‘search_result’] = $_REQUEST[‘search_result’]; //$_REQUEST[‘search_result’] is the data you get from GET Mehthod or POST Method of variable search_result ?> To acess it on other page <?php session_start(); $search_result = $_SESSION[‘search_result’]; [ad_2] solved How to store search result by using session? [closed]

[Solved] SimpleXML not working with Yahoo Answers [closed]

[ad_1] Firstly, you need to create instance of SimpleXML to use it. $bot = file_get_contents(“http://answers.yahooapis.com/AnswersService/V1/questionSearch?appid=API_KEY&query=”.$q1.””); $bot = simplexml_load_string($bot); echo $bot->Question[0]->ChosenAnswer; 1 [ad_2] solved SimpleXML not working with Yahoo Answers [closed]

[Solved] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near [closed]

[ad_1] Replace insert_into with insert into And better use the YYYY-MM-DD date format insert into tb_loan (Product_Code, Customer_Code, Loan_Amount, Rate_Interest, Amount_Tenure, Emi_Amount, Emi_Start, Emi_End) VALUES (0,0,’10000′,10.37,’20’,’546.6′,’2013-10-25′,’2013-10-25′) 3 [ad_2] solved You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near [closed]

[Solved] If statement for variable ending in certain letters [closed]

[ad_1] if (preg_match(“/[A-Z]+$/”, $id)) { would return true for any string ending in at least one of the letters A-Z. To look for a specific thing, you could do, say, if (strlen($id) > 2 && substr($id, -2) == “XD”) { 1 [ad_2] solved If statement for variable ending in certain letters [closed]

[Solved] How to pass data from javascript to php [closed]

[ad_1] jQuery includes a library that makes ajax calls very simple, example below: $(document).ready(function() { $(‘#example-2’).ratings(5).bind(‘ratingchanged’, function(event, data) { $(‘#example-rating’).text(data.rating); $.ajax({ url : ‘page.php’, type : ‘POST’, data : { rating : data.rating }, success : function(response){ console.log(“successfull”); } }); }); }); On the PHP side, you can pick it up with: if($_SERVER[‘REQUEST_METHOD’] == ‘POST’) … Read more

[Solved] Examples of using JSON? [closed]

[ad_1] JSON is, purely and simply, a data-serialisation format. That is to say, it is syntax for taking a complex set of data and turning into a string. The string, in turn, can then be turned back into a set of data. This is useful in various ways. The primary way is in data transfer. … Read more

[Solved] How to simplify this php code [closed]

[ad_1] Try: <?php $include=””; if( in_array($day, array(‘Mon’, ‘Tue’, ‘Wed’, ‘Thu’, ‘Fri’) ) && ($hour >= 6 && $hour < 22) ) { $include = $detect->isMobile() ? ‘online_mobile’ : ‘online_desktop’; } if($day == ‘Sat’ && ($hour >= 8 && $hour < 18)) { $include = $detect->isMobile() ? ‘online_mobile’ : ‘online_desktop’; } if($day == ‘Sun’ && ($hour … Read more

[Solved] I want to remove duplicate entries separated by commas from text area when form is submitted? [closed]

[ad_1] Use $array = explode(“,”,$string) then array_unique($array); and then $string = implode(“,”,$array) <?php $string = “10,12,10,15,12”;// Textarea value $array = explode(“,”,$string);// make string to array separated by comma `,` $array = array_unique($array); // remove duplicate from array $string = implode(“,”,$array); // again make array to string with comma `,` separated echo $string; ?> Live demo … Read more

[Solved] I am trying to fetch data between date

[ad_1] I think it will be helpful for you. get the result from MYSQL table between two dates in php. try this code: <?php $con=mysqli_connect(“localhost”,”root”,””,”database_name”); $first_date=$_POST[“first_date”]; $second_date=$_POST[“second_date”]; $sql=mysqli_query($con,”SELECT * FROM `table_name` WHERE `date` BETWEEN ‘”.$first_date.”‘ AND ‘”.$second_date.”‘ “); ?> [ad_2] solved I am trying to fetch data between date

[Solved] Pagination data

[ad_1] You need to study their code more, dont just copy&paste. You told the program to echo those variables and it echoed them for you. In the tutorial they seem to store all the ‘paginatable’ data in the $list, so you need to look into that. $id = $row[“id”]; prints id column from the current … Read more