[Solved] how to get after 6 month date in M / Y format?

Best way is use DateTime object to convert your date. $regDate = “Jan / 2013”; $myDateTime = DateTime::createFromFormat(‘M / Y’, $regDate); $myDateTime->modify(‘+6 Months’); echo $myDateTime->format(‘M / Y’); CodePad DEMO. Note: It will support for PHP 5 >= 5.3.0 only. 0 solved how to get after 6 month date in M / Y format?

[Solved] How to update an HTML table content without refreshing the page? [closed]

in html <tbody id=”table-body”> <?php include ‘tableBody.php’;?> </tbody> in your button function $.get(“tableBody.php”, function(data) { $(“#table-body”).html(data); }); When the button function is trigger, it will fire up the AJAX GET request to the tableBody.php, and then use its content to update the <tbody> with id table-body. 2 solved How to update an HTML table content … Read more

[Solved] Link with / and $_GET PHP [closed]

If I understand the question correctly, this can be done with something like this You can use Apache mod_rewrite to load subpages dynamically, for example: RewriteEngine on RewriteRule ^website/index.php$ website/index.php?id=$1 This would be in an .htaccess at your root directory. Hope I helped! -CM 6 solved Link with / and $_GET PHP [closed]

[Solved] Grouping in array

try this, CODE : foreach($old_array as $key_old => $val_old) { foreach($val_old as $key => $val) { if(in_array($key, $VitalInfo_array)) { $new_array[$key_old][‘VitalInfo’][$key] = $val; } else { $new_array[$key_old][‘Price’][$key] = $val; } } } OUTPUT : Array ( [0] => Array ( [VitalInfo] => Array ( [Title] => HoMedics MAN-300 [ean] => 31262006288 [upc] => 31262006288 [ProductImageName] => … Read more

[Solved] Populate a text box based on a dynamic drop down box in php

Add the rating to your HTML using a data attribute: <select name=”JournalID” id=”JournalID”> <?php for($i = 0; $i < sizeof($journals); $i++) { print “<option value=\”” . $journals[$i][1] . “\” data-rating=\”” . $journals[$i][2] . “\”>” . $journals[$i][0] . “</option>\r\n”; } ?> </select> Then you can access this using jQuery .data(): (function($) { $(function() { $(“#JournalID”).on(‘change’, function() … Read more

[Solved] Using file_get_contents and ftp_put [closed]

ftp_put expects a path to a local file as its third argument, not the contents of the file like you are passing it here: $current = file_get_contents($file); // Append a new person to the file $current .= “John Smith\n”; … $local_file = $current; … $upload = ftp_put($conn_id, $ftp_path, $local_file, FTP_ASCII); You will probably want to … Read more

[Solved] How to generate dynamic IF statement

I found my answer with my self. It’s look like this. $abc=””; foreach($setLogic2 as $key => $value){ $abc.= $value[‘Conj’].’ ‘.(int)$value[‘Topic’].’ ‘; } //$abc = “0 And 1 And 1”; if(eval(“return $abc;”) == true) { echo ‘true boolean’; } else if(eval(“return $abc;”) == false){ echo ‘false boolean’; } else{ echo ‘none’; } 1 solved How to … Read more

[Solved] Error in an update mysql query execution with php and mysqli [duplicate]

You need to escape the single quotes using php’s str_replace, e.g.: $exp_title = str_replace(“‘”, “\'”, $_REQUEST[‘exp_title’]); $exp_description = str_replace(“‘”, “\'”, $_REQUEST[‘exp_description’]); $exp_time = $_REQUEST[‘exp_time’]; $update=”UPDATE experience SET exp_title=””.$exp_title.”” , exp_description='”.$exp_description.”‘ , exp_time=””.$exp_time.”” WHERE expid='”.$id.”‘”; However, you should really really use preparedstatements instead of concatenating strings and escaping characters, e.g.: $exp_title = $_REQUEST[‘exp_title’]; $exp_description = $_REQUEST[‘exp_description’]; … Read more

[Solved] How to force file to download which is output of json file

You can use file_get_contents like this: <?php $details1=json_decode(file_get_contents(“http://2strok.com/download/download.json”), true); $details2=json_decode(file_get_contents($details1[‘data’]), true); $file_url = $details2[‘data’]; header(‘Content-Type: application/octet-stream’); header(“Content-Transfer-Encoding: Binary”); header(“Content-disposition: attachment; filename=\”” . basename($file_url) . “\””); readfile($file_url); ?> Or you can use cURL: <?php $ch = curl_init(); $url = “http://2strok.com/download/download.json”; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); $url2 = json_decode($output)->data; curl_setopt($ch, CURLOPT_URL, $url2); curl_setopt($ch, … Read more

[Solved] Send 2 e-mails with mail()

My first guess is that you’re sending an email to “[email protected]” which will surely won’t work. Unless I’m mistaken, it should work if $to is a valid email address. edit Alright, then check this out, not really a direct answer to the first problem. But I’d consider using something like this: https://github.com/Synchro/PHPMailer Unless you have … Read more

[Solved] php + Highcharts.js + convert from mysql to mysqli causes error [duplicate]

If you are going to convert your code to mysqli_*, then it should be in a prepared statement manner. Lets re-establish your MySQL connection in db.inc.php: <?php $conn = new mysqli(“localhost”, “Datenbank-Username”, “Datenbank-Passwort”, “Datenbank-Name”); /* CHECK CONNECTION */ if (mysqli_connect_errno()) { printf(“Connect failed: %s\n”, mysqli_connect_error()); exit(); } /* CHANGE CHARACTER SET TO utf8 */ if … Read more