我被困住了,无法解决这个错误,我认为这可能是我的数据库选项搞砸了
这是数据放入表格的地方
<form name = "quoted" method="post" onsubmit="get_action(this);">
<input id = "poster" type="text" name="poster" required="required" placeholder = "Credited Individual."> <br>
<textarea class = "actual_quote" name = "actual_quote" required="required" placeholder = "Write the question here!"></textarea><br><br><br>
<div class = "checkboxes" required="required">
<h3 style = "margin-top:-20px;">Please select one catagory that the quote falls into.</h3>
<label for="x"><input type="radio" name="x" value="Inspirational" id = "inspirational.php" checked="checked" /> <span>Inspirational</span></label><br>
<label for="x"><input type="radio" name="x" value="Funny" id = "funny.php" /> <span>Funny</span> </label><br>
<label for="x"><input type="radio" name="x" value="OutofContext" id = …Run Code Online (Sandbox Code Playgroud) 在页面中,两个变量在URL中传递.
在第二页中,初始化这些变量.提交时,新页面打开.问题出在这里,我无法恢复会话变量.
该脚本表示错误(未定义的索引).
提前感谢您的帮助.
这里的代码:
第一页:
<?php
$requete_cours="SELECT COURS.SIGLE AS SIGLE, ANNEE FROM COURS, MODULE WHERE COURS.ID_MODULE = MODULE.ID_MODULE and ID_PERSONNE = $userid";
//$requete_cours;
$res = mysqli_query($cxn, $requete_cours);
echo (mysqli_error ($cxn));
while($ligne = mysqli_fetch_array($res)){
echo '<a href="professeur_absences.php?classe='.$ligne['ANNEE'].'&cours='.$ligne['SIGLE'].'">';
echo $ligne['ANNEE'].' - '.$ligne['SIGLE'].'</a>';
echo '<br/>';
}
?>
Run Code Online (Sandbox Code Playgroud)
第二页:
$_SESSION['classe'] = $_GET['classe'];
$_SESSION['cours'] = $_GET['cours'];
Run Code Online (Sandbox Code Playgroud)
第三页:
if(isset($_REQUEST['afficher'])){
$semaine = $_REQUEST['semaine'];
$classe = $_SESSION['classe'];
$cours = $_SESSION['cours'];
$_SESSION['semaine'] = $semaine;
$requete_cours_id = "SELECT ID_COURS FROM COURS WHERE SIGLE = $cours";
//echo …Run Code Online (Sandbox Code Playgroud) 所以,我想用单例创建一个客户端基本 URL。
这是我的 GuzzleClient.php,其中包含基本 URL
<?php
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
class GuzzleClient {
public static function getClient()
{
static $client = null;
if (null === $client)
{
$client = new Client([
'base_url' => 'http://localhost:8080/task_manager/v1/',
]);
}
return $client;
}
private function __construct()
{}
}
Run Code Online (Sandbox Code Playgroud)
这是我应该放置基本网址的地方
require_once 'GuzzleClient.php';
class CardTypeAPIAccessor
{
private $client;
public function __construct($client)
{
$this->client = $client;
}
public function getCardTypes() {
$cardTypes = array();
try
{
//this is where base URL should be
$response = $client->get('admin/card/type',
['headers' …Run Code Online (Sandbox Code Playgroud) 我正在调用 Web 服务以获取 JSON 字符串响应,它包含不在原始字符串中的反斜杠。下面是我请求一个 JSON 字符串对象的代码,它是: {"name":"Name","id":1}
protected String doInBackground(String... uri)
{
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response;
String responseString = null;
try {
response = httpclient.execute(new HttpGet(uri[0]));
StatusLine statusLine = response.getStatusLine();
if(statusLine.getStatusCode() == HttpStatus.SC_OK){
ByteArrayOutputStream out = new ByteArrayOutputStream();
response.getEntity().writeTo(out);
out.close();
responseString = out.toString();
} else{
//Closes the connection.
response.getEntity().getContent().close();
throw new IOException(statusLine.getReasonPhrase());
}
} catch (ClientProtocolException e) {
//TODO Handle problems..
} catch (IOException e) {
//TODO Handle problems..
}
return responseString;
}
Run Code Online (Sandbox Code Playgroud)
在执行后,我只是尝试将此响应字符串解析为 JSONObject。代码如下:
protected …Run Code Online (Sandbox Code Playgroud) 以前我用jQuery开发了所有项目,但最近开始使用Angular.我用Yeoman生成器创建了一个Angular样板,并从中扩展了我的代码.
我将jQuery代码的ajax表单翻译成以下Angular控制器.
'use strict';
angular.module('MyApp')
.controller('ShareformCtrl', function ($scope, $http) {
// create a blank object to hold our form information
// $scope will allow this to pass between controller and view
$scope.formData = {};
// process the form
$scope.processForm = function() {
$http({
method : 'POST',
url : 'php/share_handling.php',
data : $.param($scope.formData), // pass in data as strings
headers : { 'Content-Type': 'application/x-www-form-urlencoded' } // set the headers so angular passing info as form data (not request payload)
})
.success(function(data) …Run Code Online (Sandbox Code Playgroud) 我刚下载了新发布的测试版Android Studio.尝试启动应用程序时,没有任何反应.
OS X控制台中显示以下消息:
"com.apple.launchd.peruser.501: (com.google.android.studio.58288[542])退出代码:1"
我正在运行OS X Mavericks并Java 1.7.0_51已安装.
任何帮助解决这个问题非常感谢:)