android 微信 扫描信用卡 是不是用 cardio做的

android 微信 扫描信用卡 是不是用 cardio做的
android 支付宝的 扫描信用卡 是用什么第三方控件做的。

Csdn user default icon

“菜菜菜鸟”有一个刷卡器,当不同的工卡放在上面时,点击“卡号”后,会出现工卡卡号,现在想将工卡放在刷卡器上时,不用点击“卡号”,自动在网页上出现工卡卡号,且三秒钟自动刷新一次,哪位大神帮帮“菜菜菜鸟”啊?谢过了 现在代码如下: (js部分) function GetCardID() { var iRet = CardIO.ReadCardID(); document.getElementById("retResult").value = ''; document.getElementById("retContent").value = ''; document.getElementById("retResult").value = iRet; if( iRet == 0 ) { document.getElementById("retContent").value = CardIO.GetCardID(); } else if( iRet == 2 ) { document.getElementById("retContent").value = '未发现卡片!'; } else if( iRet == 3 ) { document.getElementById("retContent").value = '读卡信息错误!'; } } (html部分) <form method="get" action=" "> 返回数值: <input size = "20" type="text" value="" id="retResult"></input> <br/> 返回结果: <input size = "20" type="text" name=" " id="retContent" value=""></input></form>

如何用PHP过滤字符串? [重复]

<div class="post-text" itemprop="text"> <div class="question-status question-originals-of-duplicate"> <p>This question already has an answer here:</p> <ul> <li> <a href="/questions/28614078/what-kind-of-string-is-this-how-do-i-unserialize-this-string" dir="ltr">What kind of string is this? How do I unserialize this string? [duplicate]</a> <span class="question-originals-answer-count"> 2 answers </span> </li> </ul> </div> <p>I have a plugin exporting a bunch of strings from a database for me. The data returned is in a format like this</p> <pre><code>a:3:{i:0;s:8:"Skeletal";i:1;s:6:"Cardio";i:2;s:8:"Muscular";} a:3:{i:0;s:14:"Access to care";i:1;s:15:"Confidentiality";i:2;s:20:"Consent to treatment";} </code></pre> <p>I can apply a php function to filter the data, how would I get it to return like this, using a function.</p> <pre><code>Skeletal, Cardio, Muscular Access to care, Confidentiality, Consent to treatment </code></pre> </div>

TextView 不能在其它的 activity 中显示?

我想传递数据到其它的activities除了现在这个。谁能告诉我问题出现在哪里。我现在获得的唯一的错误是TextView showmsg不能在新的activity中显示。这是为什么啊? public class MyScanActivity extends Activity { private static final String MY_CARDIO_APP_TOKEN = "NOT THE PROBLEM"; final String TAG = getClass().getName(); private Button scanButton; private TextView resultTextView; private Button buttonBack; private TextView showmsg; private int MY_SCAN_REQUEST_CODE = 100; // arbitrary int /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.myscan); Intent in = getIntent(); if (in.getCharSequenceExtra("usr") != null) { final TextView setmsg = (TextView)findViewById(; setmsg.setText(in.getCharSequenceExtra("usr")); } resultTextView = (TextView)findViewById(; scanButton = (Button)findViewById(; buttonBack = (Button)findViewById(; showmsg = (TextView) findViewById(;


<div class="post-text" itemprop="text"> <p>I'm getting data from an API in JSON format. It's getting the resting heart rate of the user and inserting it into my database. It gets todays date as well as a couple days in the past and updates the database accordingly. The code below does work (although it's inserting a blank row for some reason). My question is, is there a better/more efficient way of writing this code?</p> <p>Here is the array:</p> <pre><code>[activities-heart] =&gt; Array ( [0] =&gt; Array ( [dateTime] =&gt; 2018-03-22 [value] =&gt; Array ( [customHeartRateZones] =&gt; Array ( ) [heartRateZones] =&gt; Array ( [0] =&gt; Array ( [caloriesOut] =&gt; 1135.7736 [max] =&gt; 85 [min] =&gt; 30 [minutes] =&gt; 814 [name] =&gt; Out of Range ) [1] =&gt; Array ( [caloriesOut] =&gt; 1260.7179 [max] =&gt; 119 [min] =&gt; 85 [minutes] =&gt; 289 [name] =&gt; Fat Burn ) [2] =&gt; Array ( [caloriesOut] =&gt; 690.64515 [max] =&gt; 145 [min] =&gt; 119 [minutes] =&gt; 90 [name] =&gt; Cardio ) [3] =&gt; Array ( [caloriesOut] =&gt; 0 [max] =&gt; 220 [min] =&gt; 145 [minutes] =&gt; 0 [name] =&gt; Peak ) ) [restingHeartRate] =&gt; 65 ) ) [1] =&gt; Array ( [dateTime] =&gt; 2018-03-23 [value] =&gt; Array ( [customHeartRateZones] =&gt; Array ( ) [heartRateZones] =&gt; Array ( [0] =&gt; Array ( [caloriesOut] =&gt; 1512.00346 [max] =&gt; 85 [min] =&gt; 30 [minutes] =&gt; 1113 [name] =&gt; Out of Range ) [1] =&gt; Array ( [caloriesOut] =&gt; 1315.59604 [max] =&gt; 119 [min] =&gt; 85 [minutes] =&gt; 280 [name] =&gt; Fat Burn ) [2] =&gt; Array ( [caloriesOut] =&gt; 98.14618 [max] =&gt; 145 [min] =&gt; 119 [minutes] =&gt; 13 [name] =&gt; Cardio ) [3] =&gt; Array ( [caloriesOut] =&gt; 0 [max] =&gt; 220 [min] =&gt; 145 [minutes] =&gt; 0 [name] =&gt; Peak ) ) [restingHeartRate] =&gt; 64 ) ) ) </code></pre> <p>And here is the relevant code to process it:</p> <pre><code> &lt;?php $obj = new RecursiveIteratorIterator( new RecursiveArrayIterator( json_decode( $return, TRUE ) ), RecursiveIteratorIterator::SELF_FIRST ); foreach ( $obj as $key =&gt; $val ) { $$key = $val; $stmt = $connection-&gt;prepare( "INSERT INTO heartrate SET `encodedid` = ?, activitydate = ?, rhr = ? ON DUPLICATE KEY UPDATE rhr= ?" ); $stmt-&gt;bind_param( 'ssii', $studentencodedid, $dateTime, $restingHeartRate, $restingHeartRate ); $stmt-&gt;execute(); if ( $stmt-&gt;affected_rows &lt; 1 ) { header( "Location: " . $url . "/index.php?errormessage=Failed to updated the resting heart rate value." ); exit; } $stmt-&gt;close(); } </code></pre> <p>Thanks for any feedback.</p> <p>Tim</p> </div>


<div class="post-text" itemprop="text"> <p>My question is over creating a self-processing form that inserts to a database and then refreshes, incrementing arrays to change relevant info in the form. (though if there is an easier or better way to do this, I'm all ears).</p> <p>So site is essentially a digital equivalent to an exercise journal. The user selects a template name from a select menu, then it queries the database for that template, then returns the result to a variable. The exercise names and number of sets per exercise (which will be used to calculate maximum number of form refreshes) are passed into their own respective arrays: $exerciseName[]; and $setNum[];</p> <p><a href="" rel="nofollow noreferrer">This is a screenshot of the form.</a> My question is how to go about setting up the logic so that I can keep submitting until the last set of the last exercise, where upon the final submission, would take to a different page.</p> <p>I am using mysql_ functions, which I know is frowned upon, but it is for school which uses PHP 5.2.12 and that is what my teammates know so I have no other options. I haven't tried to prevent mysql injections because I don't intend to take this version online.</p> <p>Here is the code for selecting type of workout and workout template:</p> <pre><code> session_start(); $user = $_SESSION['email']; //This script $thisScript = htmlentities($_SERVER['PHP_SELF']); if ($user) { require("include/"); require("include/"); //Default page buttons $cardioBtn = $_POST['cardioBtn']; $resistanceBtn = $_POST['resistBtn']; //Cardio submit $cardioSubmit = $_POST['cardioSubmit']; if ((empty($cardioBtn)) &amp;&amp; (empty($resistanceBtn)) &amp;&amp; (empty($selectSubmit)) &amp;&amp; (empty($cardioSubmit))) { echo &lt;&lt;&lt;BODYDOC &lt;article id="newDayArticle"&gt; &lt;header&gt; &lt;h2&gt;Category&lt;/h2&gt; &lt;/header&gt; &lt;fieldset id="ndFieldset"&gt; &lt;form action="$thisScript" method="POST" &gt; &lt;button id="cardioButton" name="cardioBtn" value="cardioBtn" &gt;Cardio&lt;/button&gt; &lt;button id="resistanceButton" name="resistBtn" value="resistBtn" &gt;Resistance&lt;/button&gt; &lt;/form&gt; &lt;/fieldset&gt; &lt;!-- &lt;div id="selection"&gt;&lt;/div&gt; &lt;div id="template"&gt;&lt;/div&gt; --&gt; &lt;/article&gt; BODYDOC; } else if (isset($cardioBtn)) { //Build cardio form echo "&lt;h2&gt;Cardio&lt;/h2&gt;"; echo &lt;&lt;&lt;BODYDOC &lt;fieldset&gt; &lt;legend&gt;Cardio Log&lt;/legend&gt; &lt;form action="$thisScript" method="POST"&gt; &lt;input type="number" name="distance" placeholder="Distance of Run" required /&gt; &lt;input type="number" name="duration" placeholder="Run Duration" required /&gt; &lt;button id="cardioSubmit" name="cardioSubmit"&gt;Submit&lt;/button&gt; &lt;button id="back" type="button" onclick="document.location.href='newday.php';" value="Back"&gt;Back&lt;/button&gt; &lt;/form&gt; &lt;/fieldset&gt; BODYDOC; } else if (isset($cardioSubmit)) { $thisScript = htmlentities($_SERVER['PHP_SELF']); //Cardio page $distance = $_POST['distance']; $duration = $_POST['duration']; $date = date("Y-m-d"); //Submit cardio data to DB updateCardio($distance, $duration, $user, $date); //Show user stats in table cardioStats($distance, $duration); //End cardio form } else if (isset($resistanceBtn)) { //Workout template select $selectSubmit = $_POST['selectSubmit']; //page to select workout template buildSelect(); //End resistance select }//End else if //Require footer require("include/"); mysql_close(); } else { //Redirect users not logged in require("include/redirect.php"); } //End redirect else </code></pre> <p>Here is the select function and functions for building the form and inserting it into the database.</p> <pre><code> function buildSelect() { //Check if resistance button submitted //Query for template names $query = "SELECT templateName, templatePosition FROM templates WHERE userID = 0 ORDER BY templatePosition"; $result = mysql_query($query) or die("&lt;b&gt;Query Failed&lt;/b&gt;&lt;br /&gt; $query&lt;br /&gt;" . mysql_error()); //Find number of rows $numRows = mysql_num_rows($result); //Array with spaces/capitals $templateArray = array(); //Array with no spaces/no capitals $noSpacesArray = array(); //Get template names and build arrays for ($i=0; $i &lt; $numRows; $i++) { while($row = mysql_fetch_row($result)) { $templateName = $row[0]; $position = $row[1]; //Build array in order by pushing to $templateArray array_push($templateArray, $templateName); //Build array without spaces or capitals in $noSpacesArray() $templateName = str_replace(' ', '', $templateName); $templateName = strtolower($templateName); array_push($noSpacesArray, $templateName); } //End while }//End for //Check array values //print_r($templateArray); //print_r($noSpacesArray); //Build page echo &lt;&lt;&lt;BODYDOC &lt;br /&gt; &lt;h2&gt;Resistance&lt;/h2&gt; &lt;form action="log.php" method="POST" &gt; &lt;fieldset&gt; &lt;legend&gt;Resistance Templates&lt;/legend&gt; BODYDOC; echo "&lt;select name='mySelect' id='mySelect'&gt; "; echo "\t&lt;option value=''&gt;Choose One&lt;/option&gt; "; //Build Template //Build Template for ($i=0; $i &lt; count($templateArray); $i++) { //value='$noSpacesArray[$i] is for no spaces, all lower case //value='$templateArray[$i] is for First letter capital, with spaces echo "\t&lt;option value='$templateArray[$i]'&gt;$templateArray[$i]&lt;/option&gt; "; } //End list generation echo "&lt;/select&gt; "; echo &lt;&lt;&lt;BODYDOC &lt;input type="submit" name="selectSubmit" value="Submit" /&gt; &lt;br /&gt; &lt;/fieldset&gt; &lt;/form&gt; BODYDOC; } //End function buildSelect //Function uses template name as argument in an SQL query to find exercise template //Returns exercise IDs, exercise names, and # of sets per exercise in that template function getResult($template) { //Query template name and get templateID $query = "SELECT templateID FROM templates WHERE templateName = '$template'"; $result = mysql_query($query) or die("&lt;b&gt;Query Failed&lt;/b&gt;&lt;br /&gt;$query&lt;br /&gt;" . mysql_error()); //This part made me smash my head into a wall $templateID = mysql_fetch_object($result); $templateID = $templateID-&gt;templateID; //Get exercise template, exercise names, and number of sets with query $query = "SELECT exerciseID, exerciseName, numSets FROM exercises WHERE templateID = $templateID"; $result = mysql_query($query) or die("&lt;b&gt;Query Failed&lt;/b&gt;&lt;br /&gt;$query&lt;br /&gt;" . mysql_error()); return $result; } //End getExercises //Get number of exercises function getExerciseNum($result) { //Get number $numRows = mysql_num_rows($result); return $numRows; }//End getExerciseNum //Get exercise names as array function exerciseList($result, $numRows) { //Initialize exercise name array $exerciseArray = array(); //Exercise array increment // for ($i=0; $i &lt; $numRows; $i++) { while($row = mysql_fetch_row($result)) { $exerciseName = $row[1]; //Push names to array array_push($exerciseArray, $exerciseName); } //End while } //End for //Return name array return $exerciseArray; }//End exerciseList() //Get number of sets per exercise function getSets($result, $numRows) { // $setsArray = array(); // for ($i=0; $i &lt; $numRows; $i++) { while($row = mysql_fetch_row($result)) { $numSets = $row[2]; //Push to array array_push($setsArray, $numSets); } //End while } //End for //Return array return $setsArray; } //End setsPerExercise() //Build log form using query result and exercise name increment ($x) function buildLog($thisScript, $template, $exerciseArray, $setsArray, $numRows, $date) { $logSubmit = $_POST['logSubmit']; //echo "numRows = " . $numRows; static $x = 0; echo "&lt;br /&gt;X = $x"; if (empty($logSubmit)) { echo "&lt;form action='$thisScript' method='POST' name='log' id='log'&gt; "; echo "&lt;fieldset&gt; "; echo "&lt;legend&gt;$template&lt;/legend&gt; "; echo "&lt;h2&gt;$exerciseArray[0]&lt;/h2&gt; "; echo "&lt;input type='hidden' name='exerciseArray[]' value='$exerciseArray[$x]'/&gt; "; $j = 1; //Generate exercise form with loop for ($i=0; $i &lt; $setsArray[$i]; $i++) { echo "&lt;fieldset&gt;"; echo "&lt;legend&gt;Set $j&lt;/legend&gt; "; //Use $template in a hidden value to work around issue of value being lost after submitting form echo &lt;&lt;&lt;BODYDOC &lt;label&gt;Weight&lt;/label&gt; &lt;input type="text" name="weight[]" required /&gt; &lt;label&gt;Reps&lt;/label&gt; &lt;input type="number" name="reps[]" required /&gt; &lt;label&gt;Rest Time&lt;/label&gt; &lt;input type="number" name="rest[]" required /&gt; &lt;label&gt;Notes&lt;/label&gt; &lt;textarea name="notes[]"&gt;&lt;/textarea&gt; &lt;input type="hidden" name="set[]" value='$j' /&gt; &lt;input type="hidden" name='mySelect' value='$template' /&gt; &lt;/fieldset&gt; BODYDOC; $j++; } //End form for loop echo "&lt;br /&gt;&lt;button type='submit' name='logSubmit'&gt;Submit&lt;/button&gt; "; echo "&lt;/fieldset&gt; "; echo "&lt;/form&gt; "; echo "&lt;p&gt;&lt;a href='newday.php'&gt;Back&lt;/a&gt;&lt;/p&gt; "; //Increment exerciseNameArray counter so next form dispays next exercise name } //End if empty submit if (isset($logSubmit)) { //POSTed $template = $_POST['mySelect']; $set = $_POST['set']; $weight = $_POST['weight']; $reps = $_POST['reps']; $rest = $_POST['rest']; $notes = $_POST['notes']; //Update Log updateLog($user, $template, $exerciseArray, $set, $weight, $reps, $rest, $notes, $date); } //End else if } //End buildLog($template, $x) function function updateLog($user, $template, $exerciseArray, $set, $weight, $reps, $rest, $notes, $date) { //Insert data with query $numRows = count($exerciseArray); echo "count exerciseArray = " . $numRows; for ($i=0; $i &lt; $numRows; $i++) { $insert[$i] = "INSERT INTO stats_resistance (userID, template, exerciseName, set, weight, reps, rest, notes, date) VALUES ('$user','$template', $exerciseArray[$i]','$set[$i]','$weight[$i]','$reps[$i]','$rest[$i]', '$notes[$i]', '$date')" or die(mysql_error()); $result[$i] = mysql_query($insert[$i]) or die(mysql_error()); } //End for //Increment $x and pass it back to buildLog //$x++; //return $x; } //End updateLog() </code></pre> <p>Here is the log.php form file: Edit: Added htmlentities to PHP_SELF and changed some logic.</p> <pre><code> session_start(); //User $user = $_SESSION['email']; $date = date("Y-m-d"); // $template = $_POST['mySelect']; //Set log submit button $logSubmit = $_POST['logSubmit']; //Check if user is signed in if ($user) { if ($template) { require_once("include/"); require_once("include/"); //Get this script $thisScript = htmlentities($_SERVER['PHP_SELF']); //Return query $result = getResult($template); //Returns result of template //numRows $numRows = getExerciseNum($result); //Return exercise array $exerciseArray = exerciseList($result, $numRows); //Returns set of exercises in template //For some reason, $result and $numRows is empty after being passed into $exerciseArray //Reinitialize $result = getResult($template); //Returns result of template //numRows $numRows = getExerciseNum($result); //Return sets per exercise as array $setsArray = getSets($result, $numRows); //Build form buildLog($thisScript, $template, $exerciseArray, $setsArray, $numRows, $date); //Require Footer require_once("include/"); mysql_close(); } else if (empty($template)){ //Do something if template is empty require_once("include/"); require_once("include/"); echo "&lt;p&gt;Seems the template is empty&lt;/p&gt; "; echo "&lt;p&gt;Template = $template&lt;/p&gt; "; //Require Footer require_once("include/"); mysql_close(); } //End if ($template) } /*else if (($user) &amp;&amp; (isset($logSubmit))) { //If user is signed in and log has been submitted //Get form values and insert into database require("include/"); require_once("include/"); //Get this script $thisScript = htmlentities($_SERVER['PHP_SELF']); echo "&lt;pre&gt; "; echo "print_r of POST&lt;br /&gt;"; print_r($_POST); echo "&lt;/pre&gt; "; //Get Workout and POST info $template = $_POST['mySelect']; $set = $_POST['set']; $weight = $_POST['weight']; $reps = $_POST['reps']; $rest = $_POST['rest']; $notes = $_POST['notes']; //Check if form is submitted, if so, insert into db updateLog($user, $template, $exerciseArray, $set, $weight, $reps, $rest, $notes, $date); echo "&lt;p&gt;Entered update log else/if block&lt;/p&gt; "; //Require Footer require_once("include/"); mysql_close(); }*/ else if (!isset($user)) { //If user not logged in require("redirect.php"); } </code></pre> </div>

数据库连接无法在ajax call-laravel中工作

<div class="post-text" itemprop="text"> <p>My javascript is:</p> <pre><code>$( "#exerciseFetch" ).change(function( event ) { //alert("super"); // var _token = $( this ).find( 'input[name=_token]' ).val() var mytoken = $('#mytoken').attr('value'); ajaxContent = [ {"_token": mytoken}, {"val" : $( "#exerciseFetch" ).val()} ] $.ajax({ type: "POST", url: 'exerciseFetchAjaxCall', data: { ajaxContent } // data: { "_token": mytoken } }).done(function( msg ) { alert( msg ); var reqContent = msg; $("#dynamic").html(reqContent); }); }); </code></pre> <p>my route:</p> <pre><code>Route::group(array('prefix' =&gt; 'admin', 'namespace' =&gt; 'App\Controllers\Admin'), function() { Route::post('exerciseFetchAjaxCall', 'ExerciseController@exerciseAjaxCall'); }); </code></pre> <p>my controller code:</p> <pre><code>public function exerciseAjaxCall(){ $row = $_POST['ajaxContent']; // $row[1]['val'] $muscles = Muscular::whereIn('Status',array(1))-&gt;orderBy('id', 'desc')-&gt;paginate(10); // return $this-&gt;content = View::make('admin.exercise.displayMusclarGroupAjax',array('row' =&gt; $row )); return $this-&gt;content = View::make('admin.exercise.displayMusclarGroupAjax',array('muscles' =&gt; $muscles )); } </code></pre> <p>my view code:</p> <pre><code>@if($muscles &amp;&amp; count($muscles) &gt; 0) @foreach($muscles as $muscular) &lt;?php $icons = ["fa-icon-user", "fa-icon-user", "fa-icon-user inactive"]; $typeArray = [ '1'=&gt; 'Resistance', '2'=&gt; 'Cardio' ]; $typeArray[3] = 'Resistance &amp; Cardio'; ?&gt; &lt;tr&gt; &lt;td data-title="muscular_name"&gt;{{ ucfirst($muscular-&gt;muscular_name) }}&lt;/td&gt; &lt;td data-title="muscular_type"&gt;{{ $typeArray[$muscular-&gt;type]}}&lt;/td&gt; &lt;/tr&gt; &lt;?php $i++; ?&gt; @endforeach @endif @if(isset($row) &amp;&amp; count($row) &gt; 0) &lt;?print_r($row);?&gt; @endif </code></pre> <p>If I comment out the row contents and comment the muscles content in controller the code returns the values passed but the contents of the muscles are not displayed if uncommented.</p> <p>I have displayed the muscle contents with the same code in its listing page (but without ajax call) dont know why its not working as I am new to laravel.</p> <p>Any suggestions would be helpful...</p> </div>


<div class="post-text" itemprop="text"> <pre><code>events: [ { id: '&lt;?php echo $event['id']; ?&gt;', title: '&lt;?php echo $event['title']; ?&gt;', color: '&lt;?php echo $event['color']; ?&gt;', start: '&lt;?php echo $start; ?&gt;', end: '&lt;?php echo $end; ?&gt;', dow: '&lt;?php echo $dow; ?&gt;', ranges: [{ start: '&lt;?php echo $start; ?&gt;', end: '&lt;?php echo $end; ?&gt;', }] }, ] </code></pre> <p>Following image below shows my current status of my calendar: <a href="" rel="nofollow noreferrer"><img src="" alt="Calendar"></a></p> <p>As seen from the image above, the cardio training has been recurring non-stop. Is there a way to stop the recurring event based on the end date in ranges, other than using event render function? </p> <p><strong>Take note:</strong> <code>&lt;?php echo $start; ?&gt;</code> and <code>&lt;?php echo $end; ?&gt;</code> is a date formatted in YYYY-MM-DD.</p> <p><strong>UPDATED after attempting ADyson's solution:</strong> <a href="" rel="nofollow noreferrer"><img src="" alt="updatedCalendar"></a> </p> <pre><code> &lt;?php foreach ($events as $event): ..... ?&gt; { id: '&lt;?php echo $event['id']; ?&gt;', title: '&lt;?php echo $event['title']; ?&gt;', color: '&lt;?php echo $event['color']; ?&gt;', start: '04:00', end: '05:00', dow: '&lt;?php echo $dow; ?&gt;', ranges: [{ start: '&lt;?php echo $start; ?&gt;', end: '&lt;?php echo $end; ?&gt;', }] }, { id: '&lt;?php echo $event['id']; ?&gt;', title: '&lt;?php echo $event['title']; ?&gt;', color: '&lt;?php echo $event['color']; ?&gt;', start: '&lt;?php echo $start; ?&gt;', end: '&lt;?php echo $end; ?&gt;', } &lt;?php endforeach; ?&gt; </code></pre> <p><a href="" rel="nofollow noreferrer"><img src="" alt="data"></a></p> <p>Apparently, it went into recurring and non-recurring event objects due to they are in the foreach loop.</p> <p><strong>SOLUTION</strong></p> <pre><code>events:[ &lt;?php inside the foreach loop: .......... if ($dow == "") { ?&gt; { id: '&lt;?php echo $event['id']; ?&gt;', title: '&lt;?php echo $event['title']; ?&gt;', color: '&lt;?php echo $event['color']; ?&gt;', start: '&lt;?php echo $start; ?&gt;', end: '&lt;?php echo $end; ?&gt;', }, &lt;?php } else {?&gt; { id: '&lt;?php echo $event['id']; ?&gt;', title: '&lt;?php echo $event['title']; ?&gt;', color: '&lt;?php echo $event['color']; ?&gt;', start: '04:00', end: '05:00', dow: '&lt;?php echo $dow; ?&gt;', ranges: [{ start: '&lt;?php echo $start; ?&gt;', end: '&lt;?php echo $end; ?&gt;', }] }, &lt;?php } ?&gt; &lt;?php endforeach; ?&gt; </code></pre> </div>


<div class="post-text" itemprop="text"> <p>I'm not sure if I actually have problem with checkbox form or age, height and weight which i put it in int as variable on phpMyAdmin. Because after I click signup, it just write error upside the form. So I really confuse where is my error</p> <p></p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;?php session_start(); if(isset($_SESSION['user'])!="") { header("Location: home.php"); } include_once 'dbconnect.php'; if(isset($_POST['signup'])) { $username = mysql_real_escape_string($_POST['username']); $email = mysql_real_escape_string($_POST['email']); $upass = md5(mysql_real_escape_string($_POST['password'])); $age = $_POST['age']; $disease=$_POST['disease']; $weight = $_POST['weight']; $heigth = $_POST['height']; $dis=""; $flag=0; foreach($disease as $entry){ $dis .= $entry."|"; $flag=1; } if($flag==1){ $dis=rtrim($dis); } // Insert data into mysql $sql="INSERT INTO users(username,email,password, age, disease, weight, heigth) VALUES('$username','$email','$upass', '$age', '$dis', '$weight', '$heigth')"; $result=mysql_query($sql); // if successfully insert data into database, displays message "Successful". if($result){ echo "Successful"; echo "&lt;BR&gt;"; echo "&lt;a href='P.SIGNUP.php'&gt;Back to main page&lt;/a&gt;"; } else { echo "ERROR"; } } ?&gt;</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form name=register method="post" class="form-horizontal" role="form" onSubmit="return validatePwd()"&gt; &lt;div class="form-group"&gt; &lt;div class="form-group"&gt; &lt;label for="disease" class="col-sm-2 control-label"&gt;&lt;/label&gt; &lt;div class="col-sm-10"&gt; &lt;h1&gt;Register&lt;/h1&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="username" class="col-sm-2 control-label"&gt;Username&lt;/label&gt; &lt;div class="col-sm-10"&gt; &lt;input type="text" class="form-control" name="username" id="username" placeholder="User Name" class="required" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="password" class="col-sm-2 control-label"&gt;Password&lt;/label&gt; &lt;div class="col-sm-10"&gt; &lt;input type="password" class="form-control" id="password" name="password" placeholder="6-12 character" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="password" class="col-sm-2 control-label"&gt;Confirm Password&lt;/label&gt; &lt;div class="col-sm-10"&gt; &lt;input type="password" class="form-control" name="password2" placeholder="6-12 character" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="email" class="col-sm-2 control-label"&gt;E-mail&lt;/label&gt; &lt;div class="col-sm-10"&gt; &lt;input type="email" class="form-control" name="email" placeholder="" class="email required" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="age" class="col-sm-2 control-label"&gt;Age&lt;/label&gt; &lt;div class="col-sm-10"&gt; &lt;input type="number" name="age" min="45" max="55" step="1" value="45" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="disease" class="col-sm-2 control-label"&gt;Disease&lt;/label&gt; &lt;div class="col-sm-10"&gt; &lt;input type="checkbox" name="disease[]" value="obesity" /&gt;Obesity&lt;br/&gt; &lt;input type="checkbox" name="disease[]" value="diabetes" /&gt;Diabetes&lt;br/&gt;&lt;br/&gt; &lt;b&gt;Cancer&lt;/b&gt;&lt;br&gt; &lt;input type="checkbox" name="disease[]" value="coloncancer" /&gt;Colon Cancer&lt;br/&gt; &lt;input type="checkbox" name="disease[]" value="kidneyCancer" /&gt;Kidney Cancer&lt;br/&gt; &lt;input type="checkbox" name="disease[]" value="breastCancer" /&gt;Breast Cancer&lt;br/&gt;&lt;br/&gt; &lt;input type="checkbox" name="disease[]" value="cardio" /&gt;Cardio Disease&lt;br/&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="weight" class="col-sm-2 control-label"&gt;Weight&lt;/label&gt; &lt;div class="col-sm-10"&gt; &lt;input type="number" name="weight" min="30" max="180" step="10" /&gt;kg &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="height" class="col-sm-2 control-label"&gt;Height&lt;/label&gt; &lt;div class="col-sm-10"&gt; &lt;input type="number" name="height" min="100" max="200" step="10" /&gt;cm &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="disease" class="col-sm-2 control-label"&gt;&lt;/label&gt; &lt;div class="col-sm-10"&gt; &lt;button type="submit" class="btn btn-primary" name="signup"&gt; SIGNUP &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt;</code></pre> </div> </div> </div>

如何从php接收json数据? [关闭]

<div class="post-text" itemprop="text"> <p>I am trying to work with an API. Which returns <code>json</code>. below is the output:</p> <pre><code>{ "meta": { "code": 200, "next": ";key=AKVP839qHEM7TgXV&amp;offset=1", "previous": null }, "response": { "deals": [ { "active": 1, "business": { "id": 11009, "locations": [ { "address": "120 Millenium Dr", "id": 974228, "lat": 44.5400434, "locality": "Chester", "lon": -64.2325975, "phone": null, "smart_locality": "Chester", "state": "NS", "zip_code": "B0J 1J0" }, { "address": "95 Wentworth St", "id": 974229, "lat": 44.6685886, "locality": "Dartmouth", "lon": -63.5698711, "phone": null, "smart_locality": "Dartmouth", "state": "NS", "zip_code": "B2Y 2T3" } ], "name": "Fit Body Boot Camp", "url": "" }, "date_added": "2013-01-05 04:14:17", "description": "Exercise keeps the body in peak condition, which explains the marbleized ThighMaster lying next to Michelangelo's David. Enjoy an anatomical renaissance with this Groupon. Choose Between Two Options $29 for a 10-day Fit and Firm program (a $124 value) $47 for a four-week Rapid Fat Loss program (a $247 value) Both options include a nutrition consultation, elective weigh-ins and body-fat measurements, and unlimited boot-camp sessions for the duration of the program. The sessions combine cardio training with resistance and weight work, helping to maximize caloric burn both during and after the workout. Click here to see the class schedule, and click here for a list of frequently asked questions.", "discount": { "formatted": "77%", "raw": 77 }, "division": { "active": 1, "country": "Canada", "lat": 44.648881, "lon": -63.575312, "name": "Halifax, Nova Scotia", "slug": "halifax-nova-scotia", "time_zone_diff": -4, "url": "" }, "end_date": "2013-01-11 03:59:59", "id": 14517543, "images": { "image_big": "", "image_small": "" }, "mobile_url": "", "price": { "formatted": "$29", "raw": 29.00 }, "source": { "name": "Groupon", "paid": 0, "slug": "groupon", "url": "" }, "tags": [ { "name": "Boot Camp", "slug": "boot-camp", "url": "" } ], "title": "10-Day Fit-and-Firm Program or Four-Week Rapid Fat-Loss Program at Fit Body Boot Camp (Up to 81% Off)", "url": ";key=t5pm9EBw", "value": { "formatted": "$124", "raw": 124.00 }, "yipit_title": "Up to 81% Off at Fit Body Boot Camp", "yipit_url": "" } ] } } </code></pre> <p>In PHP I need to receive <code>id,lat,lan,name,url,yipit_url,yipit_id,img_bg, city, zip</code> etc. But I don't know how to show those <code>json</code> object on a php page. Please help me.</p> <p>Thanks, Enamul</p> </div>



定量遥感中文版 梁顺林著 范闻捷译



YOLOv3是一种基于深度学习的端到端实时目标检测方法,以速度快见长。本课程将手把手地教大家使用labelImg标注和使用YOLOv3训练自己的数据集。课程分为三个小项目:足球目标检测(单目标检测)、梅西目标检测(单目标检测)、足球和梅西同时目标检测(两目标检测)。 本课程的YOLOv3使用Darknet,在Ubuntu系统上做项目演示。包括:安装Darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 Darknet是使用C语言实现的轻型开源深度学习框架,依赖少,可移植性好,值得深入探究。 除本课程《YOLOv3目标检测实战:训练自己的数据集》外,本人推出了有关YOLOv3目标检测的系列课程,请持续关注该系列的其它课程视频,包括: 《YOLOv3目标检测实战:交通标志识别》 《YOLOv3目标检测:原理与源码解析》 《YOLOv3目标检测:网络模型改进方法》 敬请关注并选择学习!

sql语句 异常 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your

在我们开发的工程中,有时候会报 [Err] 1064 - 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 ------ 这种异常 不用多想,肯定是我们的sql语句出现问题,下面...

浪潮集团 往年的软件类 笔试题 比较详细的哦

浪潮集团 往年的软件类 笔试题 比较详细的哦

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!




董付国系列教材《Python程序设计基础》、《Python程序设计(第2版)》、《Python可以这样学》配套视频,讲解Python 3.5.x和3.6.x语法、内置对象用法、选择与循环以及函数设计与使用、lambda表达式用法、字符串与正则表达式应用、面向对象编程、文本文件与二进制文件操作、目录操作与系统运维、异常处理结构。


本套课程的设计完全是为初学者量身打造,课程内容由浅入深,课程讲解通俗易懂,代码实现简洁清晰。通过本课程的学习,学员能够入门微信公众平台开发,能够胜任企业级的订阅号、服务号、企业号的应用开发工作。 通过本课程的学习,学员能够对微信公众平台有一个清晰的、系统性的认识。例如,公众号是什么,它有什么特点,它能做什么,怎么开发公众号。 其次,通过本课程的学习,学员能够掌握微信公众平台开发的方法、技术和应用实现。例如,开发者文档怎么看,开发环境怎么搭建,基本的消息交互如何实现,常用的方法技巧有哪些,真实应用怎么开发。



eclipseme 1.7.9

eclipse 出了新的eclipseme插件,官方有下载,但特慢,我都下了大半天(可能自己网速差)。有急需要的朋友可以下哦。。。

Spring Boot -01- 快速入门篇(图文教程)

Spring Boot -01- 快速入门篇 今天开始不断整理 Spring Boot 2.0 版本学习笔记,大家可以在博客看到我的笔记,然后大家想看视频课程也可以到【慕课网】手机 app,去找【Spring Boot 2.0 深度实践】的课程,令人开心的是,课程完全免费! 什么是 Spring Boot? Spring Boot 是由 Pivotal 团队提供的全新框架。Spring Boot...


本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。

最简单的倍频verilog程序(Quartus II)

一个工程文件 几段简单的代码 一个输入一个输出(50Mhz倍频到100Mhz)




这是一个门针对零基础学员学习微信小程序开发的视频教学课程。课程采用腾讯官方文档作为教程的唯一技术资料来源。杜绝网络上质量良莠不齐的资料给学员学习带来的障碍。 视频课程按照开发工具的下载、安装、使用、程序结构、视图层、逻辑层、微信小程序等几个部分组织课程,详细讲解整个小程序的开发过程

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?







课程亮点: 课程培训详细的笔记以及实例代码,让学员开始掌握设计模式知识点 课程内容: 工厂模式、桥接模式、组合模式、装饰器模式、外观模式、享元模式、原型模型、代理模式、单例模式、适配器模式 策略模式、模板方法模式、观察者模式、迭代器模式、责任链模式、命令模式、备忘录模式、状态模式、访问者模式 课程特色: 笔记设计模式,用笔记串连所有知识点,让学员从一点一滴积累,学习过程无压力 笔记标题采用关键字标识法,帮助学员更加容易记住知识点 笔记以超链接形式让知识点关联起来,形式知识体系 采用先概念后实例再应用方式,知识点深入浅出 提供授课内容笔记作为课后复习以及工作备查工具 部分图表(电脑PC端查看):




本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。


本文的面试题如下: Redis 持久化机制 缓存雪崩、缓存穿透、缓存预热、缓存更新、缓存降级等问题 热点数据和冷数据是什么 Memcache与Redis的区别都有哪些? 单线程的redis为什么这么快 redis的数据类型,以及每种数据类型的使用场景,Redis 内部结构 redis的过期策略以及内存淘汰机制【~】 Redis 为什么是单线程的,优点 如何解决redis的并发竞争key问题 Red...


【超实用课程内容】 本课程演示的是一套基于Java的SSM框架实现的图书管理系统,主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的java人群。详细介绍了图书管理系统的实现,包括:环境搭建、系统业务、技术实现、项目运行、功能演示、系统扩展等,以通俗易懂的方式,手把手的带你从零开始运行本套图书管理系统,该项目附带全部源码可作为毕设使用。 【课程如何观看?】 PC端: 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化






发现网上很多Java面试题都没有答案,所以花了很长时间搜集整理出来了这套Java面试题大全,希望对大家有帮助哈~ 本套Java面试题大全,全的不能再全,哈哈~ 一、Java 基础 1. JDK 和 JRE 有什么区别? JDK:Java Development Kit 的简称,java 开发工具包,提供了 java 的开发环境和运行环境。 JRE:Java Runtime Environ...






CopyOnWriteArrayList.java和,这2个类的构造函数,注释中有一句话 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public ArrayList(Collection&lt;? ...


【超实用课程内容】 程序员对于算法一直又爱又恨!特别是在求职面试时,算法类问题绝对是不可逃避的提问点!本门课程作为算法面试系列的第一季,会从“知己知彼”的角度,聊聊关于算法面试的那些事~ 【哪些人适合学习这门课程?】 求职中的开发者,对于面试算法阶段缺少经验 想了解实际工作中算法相关知识 在职程序员,算法基础薄弱,急需充电 【超人气讲师】 孙秀洋&nbsp;| 服务器端工程师 硕士毕业于哈工大计算机科学与技术专业,ACM亚洲区赛铜奖获得者,先后在腾讯和百度从事一线技术研发,对算法和后端技术有深刻见解。 【课程如何观看?】 PC端: 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程无限观看时长,但是大家可以抓紧时间学习后一起讨论哦~


DirectX修复工具(DirectX Repair)是一款系统级工具软件,简便易用。本程序为绿色版,无需安装,可直接运行。 本程序的主要功能是检测当前系统的DirectX状态,如果发现异常则进行修复




微信小程序番茄时钟视频教程,本课程将带着各位学员开发一个小程序初级实战类项目,针对只看过官方文档而又无从下手的开发者来说,可以作为一个较好的练手项目,对于有小程序开发经验的开发者而言,可以更好加深对小程序各类组件和API 的理解,为更深层次高难度的项目做铺垫。




限时福利1:购课进答疑群专享柳峰(刘运强)老师答疑服务 限时福利2:购课后添加学习助手(微信号:csdn590),按消息提示即可领取编程大礼包! 为什么说每一个程序员都应该学习MySQL? 根据《2019-2020年中国开发者调查报告》显示,超83%的开发者都在使用MySQL数据库。 使用量大同时,掌握MySQL早已是运维、DBA的必备技能,甚至部分IT开发岗位也要求对数据库使用和原理有深入的了解和掌握。 学习编程,你可能会犹豫选择 C++ 还是 Java;入门数据科学,你可能会纠结于选择 Python 还是 R;但无论如何, MySQL 都是 IT 从业人员不可或缺的技能! 【课程设计】 在本课程中,刘运强老师会结合自己十多年来对MySQL的心得体会,通过课程给你分享一条高效的MySQL入门捷径,让学员少走弯路,彻底搞懂MySQL。 本课程包含3大模块:&nbsp; 一、基础篇: 主要以最新的MySQL8.0安装为例帮助学员解决安装与配置MySQL的问题,并对MySQL8.0的新特性做一定介绍,为后续的课程展开做好环境部署。 二、SQL语言篇: 本篇主要讲解SQL语言的四大部分数据查询语言DQL,数据操纵语言DML,数据定义语言DDL,数据控制语言DCL,学会熟练对库表进行增删改查等必备技能。 三、MySQL进阶篇: 本篇可以帮助学员更加高效的管理线上的MySQL数据库;具备MySQL的日常运维能力,语句调优、备份恢复等思路。 &nbsp;


将打包工具packer-ng-plugin升级支持将v3签名的apk生成多渠道包。 详情请查阅:


图像处理和计算机视觉的课程大家已经看过很多,但总有“听不透”,“用不了”的感觉。课程致力于创建人人都能听的懂的计算机视觉,通过生动、细腻的讲解配合实战演练,让学生真正学懂、用会。 【超实用课程内容】 课程内容分为三篇,包括视觉系统构成,图像处理基础,特征提取与描述,运动跟踪,位姿估计,三维重构等内容。课程理论与实战结合,注重教学内容的可视化和工程实践,为人工智能视觉研发及算法工程师等相关高薪职位就业打下坚实基础。 【课程如何观看?】 PC端: 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,但是大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 下载方式:电脑登录,点击右下方课程资料、代码、课件等打包下载

微信小程序 实例汇总 完整项目源代码

微信小程序 实例汇总 完整项目源代码

2019数学建模A题高压油管的压力控制 省一论文即代码


相关热词 c# dbml文件 修改 c#遍历tree c# 能够控制单片机 c#对象写入数据库 c# 添加activex c#2005 json c# 数据库在云端 c# 字符串移位加密 c#禁用滚轮 c#实体类list去重复