我正在开发一个wordpress插件,它将表单提交到另一个页面.但是当我尝试将表单提交到另一个页面时,该页面会返回一些php错误.我的表单代码如下
echo "<form action='".plugins_url()."/wp_voting_poll/frontend_poll_process.php' method='post'>";
echo "<input type='hidden' name='hide' value='$ques' />";
$total_vote_count = $wpdb->get_var( "SELECT COUNT(*) FROM $table_result WHERE question_uid='$ques'" );
if($ques!=""){
echo "<table>";
foreach($ans_data as $ans_res){
// $ans=$ans_res->answer;
$answer_id=$ans_res->id;
$type=$ans_res->answer_type;
$vote_count = $wpdb->get_var( "SELECT COUNT(*) FROM $table_result WHERE answer_id='$answer_id'" );
if($vote_count==0){
error_reporting(0);
}
$vote_percent=($vote_count*100)/$total_vote_count;
echo "<tr> <td>";
echo "<div class='answer_div'>";
if($type==1){
echo "<div class='input'><input type='radio' name='ans_name[]' value='$answer_id'/>".$ans_res->answer."<br/></div>";
}
elseif($type==0){
echo "<div class='input'><input type='checkbox' name='ans_name[]' value='$answer_id'/>".$ans_res->answer."<br/></div>";
}
if($backend==0){
echo "</td> <td>";
echo "<h4> total vote counted $vote_percent% </h4>";
// echo …Run Code Online (Sandbox Code Playgroud) 我是android和java的新手.最近我遇到了使用baseadapter将获取的json数据显示到listview中的问题.起初我使用了这段代码
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new TheTask().execute();
}
class TheTask extends AsyncTask<Void,Void,String>
{
@Override
protected String doInBackground(Void... params) {
String str = null;
try
{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://10.0.2.2/BSDI/show.php");
HttpResponse response = httpclient.execute(httppost);
str = EntityUtils.toString(response.getEntity());
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return str;
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
String response = result.toString();
try {
ArrayList<String> stringArray = new ArrayList<String>();
JSONArray …Run Code Online (Sandbox Code Playgroud) 我很了解php.但我是一个非常新的php框架学习者.我正在学习codeigniter 2.0.3.我正在尝试开发一个简单的hello world应用程序.
我试过这段代码..
class Hello extends Controller{
function Hello(){
parent::Controller();
}
function you(){
$this->load->view("you_view");
}
}
Run Code Online (Sandbox Code Playgroud)
但不幸的是我收到了这个错误......
致命错误:第7行的C:\ wamp\www\CodeIgniter\application\controllers\hello_world.php中找不到"控制器"类
我使用 AudioRecord 类录制了声音。但它无法通过音乐播放器播放。所以我在音频文件中添加了一些标题信息。虽然它现在可以通过音乐播放器播放,但它滞后且嘈杂,并且无法播放准确的声音。任何帮助,将不胜感激 。我的代码如下
private void rawToWave(final File rawFile, final File waveFile) throws IOException {
byte[] rawData = new byte[(int) rawFile.length()];
DataInputStream input = null;
try {
input = new DataInputStream(new FileInputStream(rawFile));
input.read(rawData);
} finally {
if (input != null) {
input.close();
}
}
DataOutputStream output = null;
try {
int myBitsPerSample= 2;
int myFormat = 1;
long myChannels = 1;
long mySampleRate = 8000 ;
long myByteRate = mySampleRate * myChannels * myBitsPerSample/8;
int myBlockAlign = (int) (myChannels * …Run Code Online (Sandbox Code Playgroud) android ×2
php ×2
codeigniter ×1
form-submit ×1
java ×1
json ×1
listview ×1
pcm ×1
wav ×1
wordpress ×1