...

View Full Version : Popup Form Php? Html?



irishpeck
12-07-2010, 10:58 AM
Hi Guys,

I got absolutely great advice here on this last time and i just need help with one more thing. Basically on the website www.smartinsuranceclaim.ie (http://www.smartinsuranceclaim.ie) we have a form called Make A Claim. Now if your on the homepage and click it, the form pops up and submission works but when you go to any other page it doesnt popup it opens in a new page please help me fix this. Heres the bits you need. I shortened index.html as the rest of the code is ok.

Heres the homepage script index.html!

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- layout style -->
<link href="css/reset.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/typography.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
<!-- jquery -->
<script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script>
<!-- superfish -->
<link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen" />
<script type="text/javascript" src="scripts/hoverIntent.js"></script>
<script type="text/javascript" src="scripts/superfish.js"></script>
<!-- slider -->
<script type="text/javascript" src="scripts/easySlider1.5.js"></script>
<!-- ColorBox CSS -->
<link href="css/colorbox.css" rel="stylesheet" type="text/css" media="all" />

<!-- Loading the Colorbox Scripts -->
<script type="text/javascript" SRC="js/jquery.colorbox.js"></script>

<script type="text/javascript">
jQuery(document).ready(function(){
//Loads the call for the gallery
$("a[rel='colorbox']").colorbox();
$(".colorbox").colorbox();

//Loads the call for the external file (form.html)
$("#click").click(function(){
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
return false;
});
});
</script>

<!-- initialize jquery plugins -->
<script type="text/javascript" src="scripts/init.js"></script>
<!--[if IE 6]>
<script src="scripts/dd_belated_png.js"></script>
<script>
DD_belatedPNG.fix('#top-items, #logo, #navmenu-container, #content-container-bg, #header-image-container, #prevBtn a, #nextBtn a, .comments, .post, #footer-container, .vertical-menu li, .vertical-menu li a, img, blockquote');
DD_belatedPNG.fix('.box-top, .box-center, .box-padding, .box-bottom');
DD_belatedPNG.fix('.box-2-top, .box-2-center, .box-2-padding, .box-2-bottom');
DD_belatedPNG.fix('.box-3-top, .box-3-center, .box-3-padding, .box-3-bottom');
</script>
<![endif]-->


</head>
<body>
<div id="wrapper">
<div id="top">
<div id="top-items">
<div id="logo">
<br><a href="index.html"><img src="images/logo.png" alt=""/></a>
</div>

<div id="top-right">
<div id="block-search">
<h2>Search</h2>

<div class="content">
<div>
<div class="container-inline">

</div>

</div>
</form>
</div>
</div>
</div>

</div>
<br><div id="navmenu-container">

<div id="nav-menu">

<ul class="sf-menu">
<li>
<a href="index.html" class="current">Home</a>
</li>
<li>
<a href="f&s.html">Facts & Solutions</a>
</li>
<li>
<a href="whatwedo.html">What We Do</a>
</li>
<li>
<a class="colorbox" HREF="form.html">Make A Claim</a>
</li>
<li>
<a href="whatarethesteps.html">What Are The Steps</a>
</li>
<li>
<a href="faq.html">FAQ</a>
</li>
<li>
<a href="contact.html">Contact</a>
</li>
</ul>


</div>


</div>
</div>
</body>
</html>

This is the Form that pops up - form.html!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>

<link href="css/all.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/styles/spectrum/spectrum.css" rel="stylesheet" type="text/css" media="all" />
<!-- layout style -->
<link href="css/reset.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/typography.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
<!-- jquery -->
<script type="text/javascript" src="scripts/jquery-1.2.6.min.js"></script>
<!-- superfish -->
<link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen" />
<script type="text/javascript" src="scripts/hoverIntent.js"></script>
<script type="text/javascript" src="scripts/superfish.js"></script>
<!-- jcarousel -->
<script type="text/javascript" src="scripts/jquery.jcarousel.pack.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.jcarousel.css" />
<link rel="stylesheet" type="text/css" href="css/skin.css" />
<!-- initialize slider -->

<script type="text/javascript">

jQuery(document).ready(function() {
jQuery('#mycarousel').jcarousel({
vertical: true,
scroll: 1
});
});

</script>
<!-- slider -->
<script type="text/javascript" src="scripts/easySlider1.5.js"></script>
<!-- initialize contact form -->
<script type="text/javascript" src="scripts/contact.js"></script>
<!-- initialize jquery plugins -->
<script type="text/javascript" src="scripts/init.js"></script>
<!--[if IE 6]>
<script src="scripts/dd_belated_png.js"></script>
<script>
DD_belatedPNG.fix('#top-items, #logo, #navmenu-container, #content-container-bg, #header-image-container, #prevBtn a, #nextBtn a, .comments, .post, #footer-container, .vertical-menu li, .vertical-menu li a, img, blockquote');
DD_belatedPNG.fix('.box-top, .box-center, .box-padding, .box-bottom');
DD_belatedPNG.fix('.box-2-top, .box-2-center, .box-2-padding, .box-2-bottom');
DD_belatedPNG.fix('.box-3-top, .box-3-center, .box-3-padding, .box-3-bottom');
</script>
<![endif]-->
</head>

<body>
<div style="padding:15px;"><div id="note"></div>
<div id="fields">
<p>Please tell us about your claim by filling out the form below and someone from our dedicated staff will be in touch with you shortly</p>
<form name="claimform" id="claimform" method="post" action="claimForm.php">
<label><span>1. Type of Claim</span></label><br />

<select name="claimType" id="claimType">
<option value="">Please choose one</option>
<option value="commercial">Commercial</option>
<option value="residential">Residential</option>
<option value="agricultural">Agricultural</option>
<option value="theft">Theft</option>
</select><br />
<p><label><span>2. Type of damage</span></label><br />

<select name="damageType" id="damageType">
<option value="">Please choose one</option>
<option value="fire">Fire</option>
<option value="flooding">Flooding</option>
<option value="structural">Structural</option>
<option value="other">Other</option>
</select><br />
<p> <label>If other please specify</label><!--VALIDATIONERROR--><br />
<input name="specify" type="text" class="form" id="specify" /><br />

<p><label><span>3. Contact details</span></label><!--VALIDATIONERROR--><br /><br>
<label>Location</label><!--VALIDATIONERROR--><br />
<select name="county" id="county">
<option value="">Please choose one</option>
<option value="antrim">Antrim</option>
<option value="armagh">Armagh</option>
<option value="carlow">Carlow</option>
<option value="cavan">Cavan</option>
<option value="clare">Clare</option>
<option value="cork">Cork</option>
<option value="derry">Derry</option>
<option value="donegal">Donegal</option>
<option value="down">Down</option>
<option value="dublin">Dublin</option>
<option value="fermanagh">Fermanagh</option>
<option value="galway">Galway</option>
<option value="kerry">Kerry</option>
<option value="kildare">Kildare</option>
<option value="kilkenny">Kilkenny</option>
<option value="laois">Laois</option>
<option value="leitrim">Leitrim</option>
<option value="limerick">Limerick</option>
<option value="longford">Longford</option>
<option value="louth">Louth</option>
<option value="mayo">Mayo</option>
<option value="meath">Meath</option>
<option value="monaghan">Monaghan</option>
<option value="offaly">Offaly</option>
<option value="roscommon">Roscommon</option>
<option value="sligo">Sligo</option>
<option value="tipperary">Tipperary</option>
<option value="tyrone">Tyrone</option>
<option value="waterford">Waterford</option>
<option value="westmeath">Westmeath</option>
<option value="wexford">Wexford</option>
<option value="wicklow">Wicklow</option>
</select><br />
<p><label>Day time phone number</label><br /><br>
<input name="number" type="text" class="form" id="number" /><br />
<p><label>E-mail Address*</label><br /><br>
<input name="email" type="text" class="form" id="email" /><br />


</div>
<div class="content column2 padding2">

<p><label>Full name*</label><br />

<input name="name" type="text" class="form" id="name" /><br />

<p><label>Please give a brief description of your claim</label><br /><p>
<textarea name="description" id="description" class="form" ></textarea><br />
<p><input type="submit" id="submit" name="submit" value="submit" />
</form> </div>
</body>
</html>

This is the Colorbox.css which opens the popup!

/*
ColorBox Core Style
The following rules are the styles that are consistant between themes.
Avoid changing this area to maintain compatability with future versions of ColorBox.
*/
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative; overflow:hidden;}
#cboxLoadedContent{overflow:auto;}
#cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
#cboxTitle{margin:0;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}

/*
Example user style
The following rules are ordered and tabbed in a way that represents the
order/nesting of the generated HTML, so that the structure easier to understand.
*/
#cboxOverlay{background:url(../images/overlay.png) 0 0 repeat;}
#colorbox{}
#cboxTopLeft{width:21px; height:21px; background:url(../images/controls.png) -100px 0 no-repeat;}
#cboxTopRight{width:21px; height:21px; background:url(../images/controls.png) -129px 0 no-repeat;}
#cboxBottomLeft{width:21px; height:21px; background:url(../images/controls.png) -100px -29px no-repeat;}
#cboxBottomRight{width:21px; height:21px; background:url(../images/controls.png) -129px -29px no-repeat;}
#cboxMiddleLeft{width:21px; background:url(../images/controls.png) left top repeat-y;}
#cboxMiddleRight{width:21px; background:url(../images/controls.png) right top repeat-y;}
#cboxTopCenter{height:21px; background:url(../images/border.png) 0 0 repeat-x;}
#cboxBottomCenter{height:21px; background:url(../images/border.png) 0 -29px repeat-x;}
#cboxContent{background:#fff;}
#cboxLoadedContent{margin-bottom:28px;}
#cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
#cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
#cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
#cboxPrevious{position:absolute; bottom:0; left:0px; background:url(../images/controls.png) -75px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;}
#cboxPrevious.hover{background-position:-75px -25px;}
#cboxNext{position:absolute; bottom:0; left:27px; background:url(../images/controls.png) -50px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;}
#cboxNext.hover{background-position:-50px -25px;}
#cboxLoadingOverlay{background:url(../images/loading_background.png) center center no-repeat;}
#cboxLoadingGraphic{background:url(../images/loading.gif) center center no-repeat;}
#cboxClose{position:absolute; bottom:0; right:0; background:url(../images/controls.png) -25px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;}
#cboxClose.hover{background-position:-25px -25px;}

/*
The following fixes png-transparency for IE6.
It is also necessary for png-transparency in IE7 & IE8 to avoid 'black halos' with the fade transition

Since this method does not support CSS background-positioning, it is incompatible with CSS sprites.
Colorbox preloads navigation hover classes to account for this.

!! Important Note: AlphaImageLoader src paths are relative to the HTML document,
while regular CSS background ../images are relative to the CSS document.
*/
.cboxIE #cboxTopLeft{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/internet_explorer/borderTopLeft.png, sizingMethod='scale');}
.cboxIE #cboxTopCenter{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/internet_explorer/borderTopCenter.png, sizingMethod='scale');}
.cboxIE #cboxTopRight{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/internet_explorer/borderTopRight.png, sizingMethod='scale');}
.cboxIE #cboxBottomLeft{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/internet_explorer/borderBottomLeft.png, sizingMethod='scale');}
.cboxIE #cboxBottomCenter{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/internet_explorer/borderBottomCenter.png, sizingMethod='scale');}
.cboxIE #cboxBottomRight{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/internet_explorer/borderBottomRight.png, sizingMethod='scale');}
.cboxIE #cboxMiddleLeft{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/internet_explorer/borderMiddleLeft.png, sizingMethod='scale');}
.cboxIE #cboxMiddleRight{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=../images/internet_explorer/borderMiddleRight.png, sizingMethod='scale');}


And this is the claimForm.php

<?php
$to = "info@smartinsuranceclaim.ie";


$claimType = $_POST['claimType'];
$damageType = $_POST['damageType'];
$specify = $_POST['specify'];
$county = $_POST['county'];
$number = $_POST['number'];
$from = $_POST['email'];
$name = $_POST['name'];
$message = $_POST['description'];

$subject = "Claim form submitted";
$subject2 = "Thank you from Smart Insurance Claim";
$message2 = "Thank you, your query has been submitted and is currently being reviewed. A member of our claims team shall be in contact shortly.\r\n\r\nKind regards,\r\nThe team at Smart Insurance Claim";

$header = "From: ".$from."\r\n";
$header .= "Reply-To: ".$from."\r\n\r\n";
$header .= "Name:\r\n".$name."\r\n\r\n";
$header .= "Type of claim:\r\n".$claimType."\r\n\r\n";
$header .= "Type of damage:\r\n".$damageType."\r\n\r\n";
$header .= "If other please specify:\r\n".$specify."\r\n\r\n";
$header .= "Location:\r\n".$county."\r\n\r\n";
$header .= "Phone number:\r\n".$number."\r\n\r\n";
$header .= "Email address:\r\n".$from."\r\n\r\n";
$header .= "Description:\r\n".$message."\r\n\r\n";


if (empty($from) && empty($name)) {
header( "Location: error1.php" );
}
elseif(empty($from)){
header( "Location: error2.php" );
}
elseif(empty($name) && (!preg_match('/@/', $from) || !preg_match('/[.]/', $from) || preg_match( "/[\r\n]/", $from) || preg_match( "/[,]/", $from))){
header( "Location: error5.php" );
}

elseif (!preg_match('/@/', $from) || !preg_match('/[.]/', $from) || preg_match( "/[\r\n]/", $from) || preg_match( "/[, ]/", $from)) {
header( "Location: error4.php" );
}

elseif(empty($name)){
header( "Location: error3.php" );
}
else {
mail($to, $subject, "", $header);
header("location: thankyou.php");
mail($from, $subject2, $message2, "From: sakura-designs@hotmail.com");
}

?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum