我在我的github存储库中创建了一个webhook,它在我的实时服务器上的hook url上发布,用于运行pull命令来更新服务器上的repo文件.
问题是我创建的钩子文件位于/var/www/site/web/hookfile.php(帖子请求就在那里.我也得到了身体响应)
我的repo文件在/ var/www/git-repo /
当我将任何东西推送到我的github存储库时,它不会更新git-repo.我使用终端及其工作运行此命令.
cd /var/www/git-repo && git pull
Run Code Online (Sandbox Code Playgroud)
但通过我的PHP文件它无法正常工作
shell_exec('cd /var/www/git-repo && git pull')
Run Code Online (Sandbox Code Playgroud) 我正在开发一个网络服务(API),我正在获取结果 WP_query() 函数并以 JSON 格式解析它。这将进一步用于 android 应用程序。问题是我通过查询获得的 post_content 是由视觉作曲家组成的,整个内容都是这样的标签形式
[VC_ROW][/VC_ROW][VC_COLUMN]some text[/VC_COLUMN] etc.
Run Code Online (Sandbox Code Playgroud)
我想从内容中删除/剥离所有这些短代码,并只从中检索纯文本。是否有任何视觉作曲家功能可以通过它来实现这件事
<?php
require('../../../wp-load.php');
require_once(ABSPATH . 'wp-includes/functions.php');
require_once(ABSPATH . 'wp-includes/shortcodes.php');
header('Content-Type: application/json');
$post_name = $_REQUEST['page'];
if($post_name!=''){
if($post_name=='services') {
$args = array(
'post_parent' => $page['services']['id'],
'post_type' => 'page',
'post_status' => 'published'
);
$posts = get_children($args);
foreach($posts as $po){
$services_array[] = array('id'=>$po->ID,'title'=>$po->post_title,'image'=>get_post_meta($po->ID, 'webservice_page_image',true),'description'=>preg_replace("~(?:\[/?)[^/\]]+/?\]~s", '', $po->post_content));
}
$post = array(
'status'=>'ok',
'services'=>$services_array
);
echo json_encode($post);
}
}
?>
Run Code Online (Sandbox Code Playgroud) 我在我的cms上使用了一个tinymce编辑器,它有一个普通的文本工具栏,它有粗体,斜体,下划线和对齐选项,但它没有字体系列更改选项,甚至没有颜色变化.如何启用?
嗨我正在使用限制0,1的UPDATE查询,其中我必须更新匹配查询中给出的条件的第一行
mysql_query("UPDATE `product_option` SET `input_value`='$color_a',`input_price`='$color_price_a' WHERE `product_id`='$_REQUEST[pid]' and `input_type`='option' LIMIT 0,1");
Run Code Online (Sandbox Code Playgroud)
在我的sql表中,$ _request [pid]重复多次,所以在$ _request [pid]匹配的行上,我想更新它上面的第一行,但是这个查询没有做任何事情,数据仍然相同我添加了.
任何建议将不胜感激
这是表格的图像
此代码仅显示单个选定图像.列表中选择的最后一个图像.我认为循环位置不正确或附加代码不正确.我也试过改变位置,但同样的事情只显示单个图像.
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader(),
count = input.files.length;
for(i=0;i<=count;i++){
reader.onload = function (e) {
//$('.image_preview_cont').html('<img src="'+e.target.result+'" />');
$('.image_preview_cont').append('<img src="#" id="img_preview'+i+'" />');
$('#img_preview'+i).attr('src',e.target.result);
}
reader.readAsDataURL(input.files[i]);
}
}
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<tr>
<td class="tdhead">Product Image</td><td><input type="file" name="p_image[]"
id="imgInp[]" multiple="true" onchange="readURL(this)" /><td>
</tr>
<tr>
<td colspan="2"><div class="image_preview_cont"></div></td>
</tr>
Run Code Online (Sandbox Code Playgroud) 嗨,我是ajax的新手,并尝试在ajax函数中添加两个数字,这里是代码:
$("#next_btn").click(function(){
Display_Load();
var page = this.title;
var subtract = 1;
$("#content").load("pagination_brand.php?page=" + page, Hide_Load());
this.title = parseInt(page + 1);
});
Run Code Online (Sandbox Code Playgroud)
在这个函数中,我调用div的标题值,点击我想要将1个值添加到该数字,就像标题有1所以onclick它将变成2但是这里它作为字符串添加当我看到输出它显示11分2.
您好,我是AngularJS的新手,正在从事一个我正在创建带条纹付款表格的项目。我已经创建了表单,并按照条纹网站中的描述创建了我的JS代码。我得到了卡验证的真实响应,但是付款方式在控制台“未捕获的TypeError:无法读取未定义的属性'create'”上给了我这个错误,
以下是我的HTML代码:
<div class="checkout_popup" id="checkout_popup">
<div class="col-md-12"><h3>Form</h3></div>
<form id="payment-form" method="post">
<div class="col-md-12"><input type="email" id="email" placeholder="Email" /></div>
<div class="col-md-12"><input type="text" id="card-number" data-stripe="number" value="4242424242424242" placeholder="Card Number (16 Digit)"/></div>
<div class="col-md-12"><input type="text" id="card-cvc" placeholder="cvc" data-stripe="cvc" value="123" /></div>
<div class="col-md-12"><input type="text" id="card-expiry-month" data-stripe="exp_month" value="12" placeholder="Month Expire" /></div>
<div class="col-md-12"><input type="text" id="card-expiry-year" data-stripe="exp_year" value="2017" placeholder="Year Expire" /></div>
<div class="col-md-12"><input type="button" id="pay-now" value="Pay Now" ng-click="submitstripe()" /></div>
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
这是JS代码:
.controller('UserAccountController', function($scope, $http, $state, $stateParams, $filter) {
$scope.submitstripe = function(){
console.log('ready stripe');
Stripe.card.createToken({
number: document.getElementById('card-number').value,
cvc: document.getElementById('card-cvc').value, …
Run Code Online (Sandbox Code Playgroud) javascript ×4
php ×4
ajax ×1
angularjs ×1
file-upload ×1
filereader ×1
fonts ×1
git ×1
github ×1
html5 ×1
jquery ×1
limit ×1
mysql ×1
node.js ×1
repository ×1
shell-exec ×1
strip-tags ×1
tinymce ×1
wordpress ×1