[Solved] how to remove set of dates from given date and return start and end end date using php [closed]

[ad_1] $dateArr = array(); $arr_1 = array(); $arr_2 = array(); $begin = new DateTime(‘2013-01-01 00:00:00’); $end = new DateTime(‘2016-02-18 23:59:59’); $daterange = new DatePeriod($begin, new DateInterval(‘P1D’), $end); foreach($daterange as $date){ $arr_1[]= $date->format(“Y-m-d”); } $condidateStart = new DateTime(‘2014-03-25 00:00:00’); $condidateEnd = new DateTime(‘2014-10-15 23:59:59’); $daterange1 = new DatePeriod($condidateStart, new DateInterval(‘P1D’), $condidateEnd); foreach($daterange1 as $date){ $arr_2[] = … Read more

[Solved] PHP doesn’t get HTML Form values

[ad_1] You are missing ;’s at the end of your lines. <?php $conn = mysql_connect(localhost, root, usbw); mysql_select_db (‘veiling’); $bid = $_GET[‘bod’]; $name = $_GET[‘naam’]; $item = $_GET[‘item’]; $maxbid = mysql_query(“SELECT MAX(bod) FROM veiling WHERE item=1”); $maxbid = mysql_fetch_array($maxbid); if( $bid =< $maxbid[0] ) { die(); } else { mysql_query(“INSERT INTO veiling (bod, naam, item) … Read more

[Solved] Issue in storing data into database in php [closed]

[ad_1] As per your originally posted question which has been edited: Firstly, you are using a hyphen for your sex-select column. MySQL is thinking you want to do a math equation which translates to: sex (minus) select. Wrap it in backticks and missing the column for photo (fname, lname, email, pass, phone, photo, `sex-select`, month,day,year) … Read more

[Solved] Href URL matching, [duplicate]

[ad_1] First use the method described here to retrieve all hrefs, then you can use a regex or strpos to “filter out” those who don’t start with /download/. The reason why you should use a parser instead of a regex is discussed in many other posts on stack overflow (see this). Once you parsed the … Read more

[Solved] Sending variable to PHP server from Android

[ad_1] For Android you can use HTTP Connection URL. An example is mentioned here How to add parameters to HttpURLConnection using POST URL url = new URL(“http://yoururl.com”); HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); conn.setReadTimeout(10000); conn.setConnectTimeout(15000); conn.setRequestMethod(“POST”); conn.setDoInput(true); conn.setDoOutput(true); List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair(“name”, “Chatura”)); OutputStream os = conn.getOutputStream(); BufferedWriter writer = new BufferedWriter( new … Read more

[Solved] How to choose range with php If condition [closed]

[ad_1] really just guessing here: <?php $i=23;//13,33,43,9999999993 if(substr($i,-1) == 3){ echo “there is 3”; } the code substr($i,-1) returns the last character of the string $i to cover 2 or 3 or 4 $i=24; if(in_array(substr($i,-1),array(2,3,4))){ echo “ends in 2 or 3 or 4”; } 0 [ad_2] solved How to choose range with php If condition … Read more

[Solved] Html / php not updating sql database [duplicate]

[ad_1] Your if-statement checks !empty($_POST[‘doa’]), but your form does not contain a doa: <label for=”doa”>Date of Admission:</label> <input type=”text” name=”dob”> This <input> should probably have name=”doa” instead of dob. 3 [ad_2] solved Html / php not updating sql database [duplicate]

[Solved] How do I send a variable from a javascript to a php file? [closed]

[ad_1] try with this code <script> var test = “done”; document.getElementById(‘sample’).value = test; </script> <form method = “post”> <input type=”hidden” id=”sample” name=”stext”> <input type=”submit” name=”submit” value=”submit”> </form> <?php echo $_POST[‘stext’]; ?> [ad_2] solved How do I send a variable from a javascript to a php file? [closed]

[Solved] how to get values from the content? [closed]

[ad_1] To get you going my 2 cents. First off, Welcome, please read How to ask a good question First you need to decode the json string in to an array. with that array you can get the values. <?php $json = ‘{“prereqs”:{“prereq”:{“type”:”prereq_check”,”value”:”submerging_island_feature_enabled”}}, “divisions”:{“division”:[{“items”:{“item”:[{“name”:”rhino_shell”,”rarity”:”common”}, {“name”:”walrus_wavy”,”rarity”:”special”},{“name”:”hippo_fancyshell”,”rarity”:”rare”}, {“name”:”rhino_jellyfish”,”rarity”:”superRare”}]},”name”:”rubyCount_30″}, {“items”:{“item”:[{“name”:”walrus_clam”,”rarity”:”common”},{“name”:”hippo_nautical”,”rarity”:”special”}, {“name”:”giraffe_coral”,”rarity”:”rare”},{“name”:”elephant_starburst”,”rarity”:”superRare”}]},”name”:”rubyCount_40″}, {“items”:{“item”:[{“name”:”giraffe_waverider”,”rarity”:”common”},{“name”:”pony_sea”,”rarity”:”special”}, {“name”:”magicdeer_seadeer”,”rarity”:”rare”}, {“name”:”pony_seaprincesscorn”,”rarity”:”superRare”}]},”name”:”rubyCount_50″}, {“items”:{“item”:[{“name”:”bigcat_crystallion”,”rarity”:”common”},{“name”:”magicdeer_midnightdeer”,”rarity”:”special”}, {“name”:”horse_ofthesea”,”rarity”:”rare”}, {“name”:”horse_wingedsea”,”rarity”:”superRare”}]},”name”:”rubyCount_60″}]},”crafting”:{“recipes”:{“recipe”:[{“name”:”qdke”}, {“name”:”sb1p”},{“name”:”cb8v”}]}},”listEndDate”:”07/13/2015″,”currencyItem”:{“name”:”healingpotionbottle”},”feed”:{“throttleTime”:”21600″},”name”:”submerging_island”}’; … Read more

[Solved] PDO Insert error on execute

[ad_1] Looks like your DSN is incorrect (you have a space in it). Try this PDO constructor and stop using or die()! $db = new PDO(‘mysql:host=localhost;dbname=xxxxxx;charset=utf8’, ‘yyyyyy’, ‘zzzzzz’, array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC)); $query = “INSERT INTO multiTicker (mtgox,btcstamp,btce,btcchina,myDateTime) VALUES (:mtgox,:btcstamp,:btce,:btcchina,:myDateTime)”; $st = $db->prepare($query); $st->execute(array( ‘:mtgox’ => $mtgox, ‘:btcstamp’ => … Read more

[Solved] Can I display all users using php and sql?

[ad_1] mysqli query need connection parameter at first. More about mysqli query. Try this $query = mysqli_query($connection_var, “SELECT username FROM member”); echo ‘<table>’; while($rowtwo = mysqli_fetch_array($query)){ echo ‘<tr><td>’.$rowtwo[“username”].'</td></tr>’; } echo ‘</table>’; 0 [ad_2] solved Can I display all users using php and sql?

[Solved] How to add specific PHP code in HTML?

[ad_1] If you need to add a <meta> only for IE,This can use without creating a php file. Try this code insted of your php code. <!–[if IE]> <meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″ /> <![endif]–> 3 [ad_2] solved How to add specific PHP code in HTML?

[Solved] PHP $_POST syntax error [closed]

[ad_1] First, you’ve got a ` in your code and second, you forgot a semicolon on the second line. Use a source code editor with syntax highlighting to spot the syntax errors. <?php echo $_POST[“fname”]; $handler= fopen(‘f.txt’, ‘a’); $data=$_POST[“fname”]; fwrite($handle,$data); ?> [ad_2] solved PHP $_POST syntax error [closed]