简体   繁体   中英

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

I found a script for a PHP contact form online which I wish to integrate with our magento cart.

I have entered the PHP through calling it through the Magento Page CMS and it is displaying correctly apart from the image verifcation. I was just wondering if anyone could assist.

This is the page that we are trying to get to work : http://gadgetfreakz.co.uk/contactus

The demo works fine here http://gadgetfreakz.co.uk/contact-form/contact.phtml

Thank you very much.

Kind Regards

<?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);

?>

Not a big deal :)

It's only an image src issue, you should use absolutes URLs from the root of your website.

On the main contact form, you have this URL:

http://gadgetfreakz.co.uk/contactus

And this one for the image:

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

On your demo:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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