小编use*_*494的帖子

中心图像水平内溢:隐藏的div

我有一个父DIV width:100%overflow:hidden
我需要放置的图像2500-3000px内,但具有水平居中的图像(裁剪左侧和右侧),以使图像的主要中心部分显示在小屏幕上,但没有水平滚动条.
我无法使用,background-image因为图像是通过PHP动态添加的.
请帮忙.

css

6
推荐指数
1
解决办法
7636
查看次数

fopen 与 cron 作业

有人可以告诉我我做错了什么吗?我有一个 php 脚本,应该使用 cron 作业执行,从数据库中提取数据并将其放入 csv 文件中。当我从浏览器运行它时,它工作得很好,所以我确信我的查询是正确的。但是,当我使用 cron 作业时,它返回“未指定输入文件。 ”并且不写入该文件。

这是我的代码:

克朗:

/home/ACCOUNT_NAME/public_html/directory/report.sh

报告.sh

php -q /home/ACCOUNT_NAME/public_html/directory/report.php
php -q /home/ACCOUNT_NAME/public_html/directory/report_mail.php
Run Code Online (Sandbox Code Playgroud)

报告.php

<?php

    $con = mysql_connect("localhost", "my_un", "my_pw") ;

    if(!$con){
        die('Could not connect: ' . mysql_error()) ;
        }
    mysql_select_db("my_db", $con) ;

if (!function_exists('fputcsv')){
        function fputcsv($objFile,$arrData,$strDelimiter=',',$strEnclose='"') {
            $strNewLine="\n";
            $strToWrite = '';
            foreach ($arrData as $strCell){
                //Test if numeric
                if (!is_numeric($strCell)){
                    //Escape the enclose
                    $strCell = str_replace($strEnclose,$strEnclose.$strEnclose,$strCell);
                    //Not numeric enclose
                    $strCell = $strEnclose . $strCell . $strEnclose;
                }
                if ($strToWrite==''){
                    $strToWrite = …
Run Code Online (Sandbox Code Playgroud)

php cron

5
推荐指数
1
解决办法
3887
查看次数

htaccess重定向但排除图像

我正在尝试使用htaccess重定向到文件,但无法显示图像.

我想将任何请求重定向到mydomain.com或www.mydomain.com到www.mydomain.com/test.html

这是我的htaccess文件的内容:

# Turn rewriting on
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !=/test.html
RewriteCond %{REQUEST_URI} !=*\.png$ [NC]
RewriteRule .* /test.html
Run Code Online (Sandbox Code Playgroud)

我在test.html文件中有这行代码:

<img src="image.png" alt="My Image">
Run Code Online (Sandbox Code Playgroud)

但是图像根本没有显示,我只是得到了破碎的图像.我也尝试使用绝对路径的图像,同样的事情.

.htaccess redirect image

4
推荐指数
2
解决办法
1万
查看次数

php cURL 返回全部小写

我正在连接到 API 并且需要检索 XML 数据。我收到了回复,但问题是所有键都是小写的。如果我使用 SoapUI 测试请求,它会按预期响应,因此我将其范围缩小到我的服务器和代码。这是我的要求:

$headers = array(
        "Content-type: text/xml;charset=\"utf-8\"",
        "Accept: text/xml",
        "Cache-Control: no-cache",
        "Pragma: no-cache",
        "SOAPAction: http://XYZDOMAIN.com.au/" . $func,
        "Content-length: " . strlen($xml_post_string),
        "Accept-Encoding: gzip,deflate"
    ); //SOAPAction: your op URL
    // PHP cURL  for https connection with auth

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
    curl_setopt($ch, CURLOPT_URL, $this->url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
    curl_setopt($ch, CURLOPT_ENCODING, "gzip,deflate");

    $response = curl_exec($ch);

    if ($errno …
Run Code Online (Sandbox Code Playgroud)

php xml curl soap

4
推荐指数
1
解决办法
2010
查看次数

标签 统计

php ×2

.htaccess ×1

cron ×1

css ×1

curl ×1

image ×1

redirect ×1

soap ×1

xml ×1