簡體   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