繁体   English   中英

简单的PHP与我们联系表格,用于验证的图像未显示-有任何想法吗?

[英]Simple PHP Contact Us Form, Image For Verification Not Showing - Any Ideas?

我在网上找到了一个PHP联系人表单的脚本,希望将其与我们的magento购物车集成。

我已经通过Magento Page CMS调用了PHP,从而进入了PHP,并且除了图像验证之外,它都能正确显示。 我只是想知道是否有人可以提供帮助。

这是我们试图开始工作的页面: http : //gadgetfreakz.co.uk/contactus

该演示在这里可以正常运行http://gadgetfreakz.co.uk/contact-form/contact.phtml

非常感谢你。

亲切的问候

<?php

session_name($_GET['sname']); session_start();
$t_num = isset($_SESSION['contact-form-number']) ? $_SESSION['contact-form-number'] : '0000';

if (get_magic_quotes_gpc() && !function_exists('strip_slashes_deep'))
{
function strip_slashes_deep($value)
{
if (is_array($value)) return array_map('strip_slashes_deep', $value);
return stripslashes($value);
}

$_GET    = strip_slashes_deep($_GET);
$_POST   = strip_slashes_deep($_POST);
$_COOKIE = strip_slashes_deep($_COOKIE);
}

header('Pragma: no-cache');
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('Expires: Fri, 31 Dec 1999 23:59:59 GMT');

header("Content-type: image/png");
$image = imagecreate(60, 17);
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image,   0,   0,   0);
imagestring ($image, 3, 0, 4, $t_num, $black);
imagepng    ($image);
imagedestroy($image);

?>

没有大碍 :)

这只是图像src问题,您应该使用网站根目录中的绝对URL。

在主联系表上,您具有以下URL:

http://gadgetfreakz.co.uk/contactus

而这张图片:

contact-form/image.php?sname=frontend&rand=721024679

在您的演示中:

http://gadgetfreakz.co.uk/contact-form/contact.phtml
contact-form/image.php?sname=frontend&rand=721024679

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM