即使我选择2个或更多图像,也只会上传一个.
我有一个简单的形式:
<form action="/images/thumbs" method="post" enctype="multipart/form-data">
<input name="file[]" id="file" type="file" multiple="" />
<input type="submit" name="upload_images" value="Upload Images">
</form>
Run Code Online (Sandbox Code Playgroud)
然后在我的控制器中:
public function thumbsAction()
{
$request = $this->getRequest();
if ($request->isPost()) {
if (isset($_POST['upload_images'])) {
$names = $_FILES['file']['name'];
// the names will be an array of names
foreach($names as $name){
$path = APPLICATION_PATH.'/../public/img/'.$name;
echo $path; // will return all the paths of all the images that i selected
$uploaded = Application_Model_Functions::upload($path);
echo $uploaded; // will return true as many times as i select …Run Code Online (Sandbox Code Playgroud) 我有一些数据,例如
"last_name": "AA-WEST"
"last_name": "VANDER AA"
"last_name": "ARENDES-AA"
Run Code Online (Sandbox Code Playgroud)
我试图只获取以a, ie开头的名称AA-WEST和ARENDES-AA
我试过了
"match": {
"last_name": {
"query": "a",
"operator": "and"
}
}
Run Code Online (Sandbox Code Playgroud)
和
"prefix": {
"last_name": { "value" : "a" }
}
Run Code Online (Sandbox Code Playgroud)
和
"match_phrase_prefix": {
"last_name.keyword": {
"query": "a"
}
}
Run Code Online (Sandbox Code Playgroud)
所有这些都将返回所有名称,不仅是真正以a
有任何想法吗?
the_title()在这种情况下,xxxi 返回一些文本Blue & Whiny
我们可以看到的问题是&字符看起来不同
如何打开Blue & Whiny到Blue & Whiny我tryed: ,,htmlspecialchars_decode(the_title()) 并没有什么.html_entity_decode(the_title())htmlspecialchars(the_title())
我想转换&为&
没有太多的代码要分享,我只是这样做:<?php the_title() ?>我得到了Blue & Whiny.如果我使用get_the_title()它不会显示任何东西
有任何想法吗?谢谢
EDIT1.生病分享一些代码:
<script type="text/javascript">
function showShareUI() {
var act = new gigya.services.socialize.UserAction();
act.setUserMessage("Check out this article.");
act.setTitle("Trends on Explore Talent - <?php the_title(); ?>");
act.setDescription("<?php get_the_content(); ?>");
act.setLinkBack("<?php the_permalink(); ?>");
act.addActionLink("Check out this article", "<?php the_permalink(); ?>");
var image = {
src: 'http://xxx.com/wp-content/uploads/2011/05/BOTTOM_BANNER.jpg',
href: …Run Code Online (Sandbox Code Playgroud) 简单的问题:
how to find the location (url) where a user came from before accessing my page?
Run Code Online (Sandbox Code Playgroud)
和
how to find the location (url) where a user goes after exiting my webpage?
Run Code Online (Sandbox Code Playgroud)
我应该从哪里开始?谢谢
我有一个登录表格:
<form method =POST action="/login.php">
...
</form>
Run Code Online (Sandbox Code Playgroud)
我希望login.php页面重定向到使用https.
我不想发送用户,https://.../login.php因为他们可能会更改链接.但我想在解析登录表单数据并将用户登录之前在服务器端进行重定向.
我发现并举例:
if($_SERVER["HTTPS"] != "on") {
header("HTTP/1.1 301 Moved Permanently");
header("Location: "https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
exit();
}
Run Code Online (Sandbox Code Playgroud)
但我没有,$_SERVER["HTTPS"]如果我var_dump($_SERVER);
我确实有$_SERVER['SERVER_PORT']女巫是80.
有任何想法吗?
谢谢
我有一个简单的ajax调用:
function message(){
$.ajax({
type: "GET",
url: "/file/timestamp="+ timestamp,
async: true,
cache: false,
success: function(data){
var json = eval('('+data+')');
console.log(json);
}
});
}
Run Code Online (Sandbox Code Playgroud)
我Uncaught SyntaxError: Unexpected token <在这一行收到一个错误:var json = eval('('+data+')');
有任何想法吗?
谢谢。
编辑:错误中的更多详细信息:
$.ajax.successajax.js:9
f.Callbacks.njquery.js:2
f.Callbacks.o.fireWithjquery.js:2
wjquery.js:4
f.support.ajax.f.ajaxTransport.send.d
Run Code Online (Sandbox Code Playgroud)
如果有帮助,这里有一些 php
public function fileAction()
{
$this->getHelper('viewRenderer')->setNoRender();
$filename = '/test/text.txt';
$front = Zend_Controller_Front::getInstance();
$data = $front->getRequest()->getParams();
$lastModif = !empty($data['timestamp']) ? $data['timestamp'] : 0;
$currentModif = filemtime($filename);
while($currentModif <= $lastModif){
usleep(10000);
clearstatcache();
$currentModif = filemtime($filename);
}
$response = array(); …Run Code Online (Sandbox Code Playgroud) 我试图模仿通常在你有一个面板的移动设备上找到的效果,当你点击它旋转的按钮时,在另一边它有一些其他信息.
我找到了一些使用css转换的代码,这是一个例子
js
$('#signup').on('click', function(e) {
e.preventDefault();
document.getElementById( 'side-2' ).className = 'flip flip-side-1';
document.getElementById( 'side-1' ).className = 'flip flip-side-2';
});
$('#create').on('click', function(e) {
e.preventDefault();
document.getElementById( 'side-2' ).className = 'flip';
document.getElementById( 'side-1' ).className = 'flip';
});
Run Code Online (Sandbox Code Playgroud)
这个例子的问题是,如果我将javascript转换为jquery,它会停止工作:
从:
document.getElementById( 'side-2' ).className = 'flip flip-side-1';
Run Code Online (Sandbox Code Playgroud)
至
$( '#side-2' ).addClass('flip flip-side-1');
Run Code Online (Sandbox Code Playgroud)
此外,我不确定是否还没有一个jquery插件以更好的方式执行此操作.
有任何想法吗?
一些更多的代码.HTML
<div id="side-1" class="flip">
<a id="signup" href="#">sign up</a>
</div>
<div id="side-2" class="flip">
<a id="create" href="#">create</a>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.flip {
backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
-webkit-backface-visibility: hidden; …Run Code Online (Sandbox Code Playgroud) 我有一个简单的问题:
我有这个var: $v = "24000,1500,1500,1500,1500,1500,";
我想将这些数字加在一起.
我已经尝试过str_replace了,,+所以a eval(),但是没有用.
我也尝试了,str_split()但它不知道分裂,.
也许如果以某种方式将其转换为数组并做array_sum...
有任何想法吗?
谢谢
我已经尝试了许多方法加载谷歌地图和firebaseio没有成功:这就是我现在拥有的:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com;
script-src 'self' https://maps.googleapis.com/* 'unsafe-inline' 'unsafe-eval';
style-src 'self' 'unsafe-inline';">
Run Code Online (Sandbox Code Playgroud)
我得到:
Refused to load the script 'https://maps.googleapis.com/maps/api/js?libraries=places' because it violates the following Content Security Policy directive: "script-src 'self' https://maps.googleapis.com/* 'unsafe-inline' 'unsafe-eval'".
Refused to load the script 'https://test.firebaseio.com/.lp?start=t&ser=79549912&cb=1&v=5' because it violates the following Content Security Policy directive: "script-src 'self' https://maps.googleapis.com/* 'unsafe-inline' 'unsafe-eval'".
Run Code Online (Sandbox Code Playgroud)
任何想法我做错了什么?
javascript google-maps phonegap-plugins firebase content-security-policy
我试图使用MySQL按位运算我的查询,我有这个例子:
table1
id ptid
1 3
2 20
3 66
4 6
table2
id types
1 music
2 art
4 pictures
8 video
16 art2
32 actor
64 movies
128 ..
...
Run Code Online (Sandbox Code Playgroud)
现在,id = 3从table1'66',女巫意味着它有64 or movies和2 or art
但
不是他也有32 or actor两次而且2 or art??
希望你看到我的困惑在哪里.我如何控制我想要的结果.在这种情况下,我想要64 or movies和2 or art.
但有时我要三id's从table2属于一个id从table1
有任何想法吗?
谢谢
php ×6
javascript ×3
jquery ×2
ajax ×1
arrays ×1
file-upload ×1
firebase ×1
flip ×1
google-maps ×1
https ×1
location ×1
mysql ×1
redirect ×1
startswith ×1
string ×1
sum ×1
syntax-error ×1
upload ×1
wordpress ×1
zend-file ×1