你好,我需要动态上传图像的高度和宽度.
这是我正在使用的PHP函数,但它不会返回宽度和高度的任何内容.
请你帮助我好吗?
list($width, $height, $type, $attr) = getimagesize($_FILES["Artwork"]);
$min_width = "1000";
$min_height = "1000";
if ((($_FILES["Artwork"]["type"] == "image/gif") || ($_FILES["Artwork"]["type"] == "image/jpeg") || ($_FILES["Artwork"]["type"] == "image/jpg")
|| ($_FILES["Artwork"]["type"] == "image/pjpeg")) && ($_FILES["Artwork"]["size"] < 20000000) && ($width > $min_width) && ($height > $min_height) && ($width == $height))
{
if ($_FILES["Artwork"]["error"] > 0)
{
//echo "Return Code: " . $_FILES["Artwork"]["error"] . "<br />";
}else{
move_uploaded_file($_FILES["Artwork"]["tmp_name"],
$path_image . $imageName);
header("Location: http://pitchmystuff.co.uk/m/digidist/tracks/".$idAlbum."");
}
}else{
//echo "invalid file";
echo '<script>
alert("There was an error …Run Code Online (Sandbox Code Playgroud) 我有这个字符串
1010081-COP-8-27-20110616214459
Run Code Online (Sandbox Code Playgroud)
我需要计算从该字符串结尾开始的最后6个字符(因为它可能从开始时开始很长)
然后我需要在每2个字符后添加冒号.
因此,从最后计算6个字符后它将是
214459
Run Code Online (Sandbox Code Playgroud)
添加冒号后,它将如下所示:
21:44:59
Run Code Online (Sandbox Code Playgroud)
你能帮我实现吗?
我真的不知道从哪里开始!
谢谢
我需要获取元素内的文本.
我只能抓住这个元素的类而不是ID.
<span class="fileName">test.png</span>
Run Code Online (Sandbox Code Playgroud)
所以我需要一种方法来获取test.png,但正如你所看到的,我只有元素的类而不是ID.
请注意我们可能有更多<span class="fileName"></span>,所以它可能看起来像这样
<span class="fileName">test1.png</span>
<span class="fileName">test2.png</span>
<span class="fileName">test3.png</span>
<span class="fileName">test4.png</span>
Run Code Online (Sandbox Code Playgroud)
在我们有更多的情况下,如上面的例子,我需要获取所有值而不仅仅是一个,因为我需要将此值传递给另一个使用jQuery的页面.所以它应该能够从该元素中获得一个或多个值.
请帮忙!
而且我也不是一个JavaScript专家!
我有一个jQuery脚本,在参数内接收一个以毫秒为单位的字符串,如下所示:
params.tweetDate='77771564221';
Run Code Online (Sandbox Code Playgroud)
我需要做的是创建一个jQuery函数,它能够在美国时间格式化这个毫秒字符串,比如10.00 AM或10.00 PM.
是否有一个jQuery函数能够做到这一点?
请帮忙.
谢谢
我有个问题.我正在使用CMS,它的名字是Dolphin.简而言之,我创建了一个包含繁重代码的块(jQuery,javascript,php,HTML,图像等等).我想要做的是显示加载图像,直到该块的内容完全加载.因此,即使它看起来很奇怪,我也需要DIV的预加载功能.我需要这样做,因为如果我不使用它,我可以看到div组成缓慢,这太可怕了.你知道一个好的jQuery或javascript函数可以帮助我吗?只是在DIV中心加载图像,直到其内容完全加载.一旦它加载然后它将显示..谢谢!
如何<div>使用jQuery在另一个内部编写?
我有一个<div>我无法在HTML中修改,因为我在CMS中工作.所以我想用click函数<div>在里面写一个element()<div>.
我已经创建了click函数,但是如何用jQuery写一个<div>INSIDE另一个特定的<div>?
在此表单中,用户可以为作者添加一些信息(音乐,歌词作者)
用户可以选择添加1个或更多作者.
问题是,当用户只输入1个作者时,所有其他输入都保持为空,但jQuery序列化函数将把它们放在URL中,服务器给我这个错误:
Request-URI Too Large
Run Code Online (Sandbox Code Playgroud)
见下面的例子:
echo "<form action=\"\" id=\"submForm\" name=\"submForm\" method=\"get\">";
// AUTHOR NUMBER 1
echo "<p><span class=\"labelInput\">".(_t('_cR_name'))." </span><input id=\"nameAuthor\" name=\"author[0][name]\" value=\"\" type=\"text\" class=\"commonInput\"></p>";
echo "<p><span class=\"labelInput\">".(_t('_cR_DOB'))." </span><input id=\"DOBAuthor\" name=\"author[0][DOB]\" value=\"\" type=\"text\" class=\"littleInput\"></p>";
echo "<p><span class=\"labelInput\">".(_t('_cR_DOD'))." </span><input id=\"DODAuthor\" name=\"author[0][DOD]\" value=\"\" type=\"text\" class=\"littleInput\"></p>";
// AUTHOR NUMBER 2
echo "<p><span class=\"labelInput\">".(_t('_cR_name'))." </span><input id=\"nameAuthor\" name=\"author[1][name]\" value=\"\" type=\"text\" class=\"commonInput\"></p>";
echo "<p><span class=\"labelInput\">".(_t('_cR_DOB'))." </span><input id=\"DOBAuthor\" name=\"author[1][DOB]\" value=\"\" type=\"text\" class=\"littleInput\"></p>";
echo "<p><span class=\"labelInput\">".(_t('_cR_DOD'))." </span><input id=\"DODAuthor\" name=\"author[1][DOD]\" value=\"\" type=\"text\" class=\"littleInput\"></p>"; Death:
// AUTHOR NUMBER 3 …Run Code Online (Sandbox Code Playgroud) 我需要从给定的字符串中删除www $_SERVER['HTTP_HOST']
我怎么能用PHP做到这一点?
我使用以下代码来获取Facebook用户的信息.
有没有办法让用户页面(如果用户有一个或多个Facebook页面)和这些页面的ID?
$user = $_POST['uid']; //the returned user ID from Facebook
$key = $_POST['usid']; //the returned session ID from Facebook
$accesstoken = $_POST['accesstoken']; //the returned accesstoken from Facebook
$image = "http://graph.facebook.com/" .$user ."/picture?type=large"; //Facebook Profile Picture
$name = json_decode(file_get_contents('https://graph.facebook.com/' . $user))->name; //Name of the user account on Facebook
$link = json_decode(file_get_contents('https://graph.facebook.com/' . $user))->link; //Link of the user profile on Facebook
$gender = json_decode(file_get_contents('https://graph.facebook.com/' . $user))->gender; //Gender of the user on Facebook
$locale = json_decode(file_get_contents('https://graph.facebook.com/' . $user))->locale; //Location of the user …Run Code Online (Sandbox Code Playgroud) jquery ×5
php ×5
javascript ×3
add ×1
api ×1
class ×1
count ×1
element ×1
facebook ×1
image ×1
image-size ×1
preloading ×1