Hello everyone,
I have broken this code out into 6 different php files, all with designated class names. I added an HTML file called showwindow.html containing the original index page plus the 2nd form with name,age,country,category, linked to a new style sheet that I’ve created named emailsubmit.css with the new form. This will take a second, but I’ll lay out what I have.
I’d like to make the rest of the page be gray except for the form2 html.
I’m trying to debug the HTML markup because it’s not validating and the entire style sheet is not being applied.
index.php
<?php
//this section is for the e-mail box scripting to begin
class PassEmail
{
function postEmail()
{
include 'Scripts/emailsubmission.php';
$emailPasser = new ProcessEmail;
include 'Scripts/finalactions.php';
$error = new FinalActions;
if (isset($_POST["go"])){
$email = $_POST["go"];
$emailPasser -> getEmail($email);
} else {
$error -> invalidEntry();
}
}
}
//end e-mail box scripting section
?>
emailsubmission.php
<?php
class ProcessEmail
{
function gatherEmail()
{
$categoryFinder = new CategoryFinder;
include 'categoryfinder.php';
$databaseWriter = new DatabaseWriter;
include 'databasewriter.php';
$emailSender = new EmailSender;
include 'emailsender.php';
$spamCatcher = new SpamCatcher;
include 'spamcatcher.php';
$showForm = new ShowWindow;
include 'showwindow.php';
$showForm -> showWindow();
if (isset($confirmedEmail) && $email == $confirmedEmail){
writeUserToDatabase($confirmedEmail, $name, $age, $country, $category);
} else {
invalidEntry();
}
}
public function getEmail($email)
{
$enteredEmail = $email;
}
}
?>
emailtester.php
<?php
class EmailTester
{
public function isItAValidEmail($email)
{
if(!filter_var($email, FILTER_VALIDATE_EMAIL)) {
return false;
} else {
return true;
}
}
}
?>
emailsender.php
<?php
class EmailSender{
function sendWelcomeEmail()
{
}
}
?>
databasewriter.php
<?php
class DatabaseWriter
{
public function writeUserToDatabase($email , $name , $age , $country , $category)
{
$connection = new PDO(
'mysql:host=hostname;dbname=emailcollection' , "user" , "password");
if (!$connection){
die('Could not connect.');
}
$statement = $connection -> prepare("INSERT INTO emailcollection (email, name, age, country, category) VALUES (:email, :name, :age, :country, :category)");
$statement -> bindParam(':email', $email);
$statement -> bindParam(':name', $name);
$statement -> bindParam(':age', $age);
$statement -> bindParam(':country', $country);
$statement -> bindParam(':category', $category);
$statement -> execute();
$connection = NULL;
}
}
?>
categoryfinder.php
<?php
class CategoryFinder
{
public function getCategory()
{
$currentURL= $_SERVER['PHP_SELF'];
if (preg_match($currentURL, "index"))
return "Home Page";
elseif (preg_match($currentURL, "health"))
return "Health";
elseif (preg_match($currentURL, "insurance"))
return "Insurance";
elseif (preg_match($currentURL, "general"))
return "General";
elseif (preg_match($currentURL, "dating"))
return "Dating";
elseif (preg_match($currentURL, "education"))
return "Education";
elseif (preg_match($currentURL, "legal"))
return "Legal";
elseif (preg_match($currentURL, "startyour"))
return "Business Opportunities";
elseif (preg_match($currentURL, "business"))
return "Business Services";
}
}
?>
finalactions.php
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div id="active"><p id="error">You didn't enter a valid email, silly!</p><input type="submit" value="Go Back" onclick="goBack()"></div>
<?php
class FinalActions
{
public function invalidEntry()
{
}
private function goBack()
{
header();
}
}
?>
</body>
</html>
spamcatcher.php
<?php
class SpamCatcher
{
public function generateCapture()
{
}
}
?>
I’ll be working on validation of the markup. Hopefully this will end the styles not being applied.
I probably have a CSS-based question with trying to make the area outside the email submit have a semi-transparent gray mask. See div with id graybox.
showwindow.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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style/main.css" type="text/css" media="screen, projection, tv" />
<link href="style/emailsubmit.css" type="text/css" media="screen, projection, tv" />
<link href="style/dropdownmenus.css" type="text/css" media="screen, projection, tv" />
<title>Join the Mailing List at World Review Group!</title>
</head>
<body>
<!-- begin container -->
<div id="graymask">
<div id="container">
<!-- begin middle div -->
<div id="middle">
<!--header with image -->
<h1>World Review Group<span></span></h1>
<div id="body">
<p id="welcomestatement">Hello everyone, <br />
This site is dedicated to consumer reviews on current products in many different markets. This site is here to promote the good ones and expose the bad ones. Thank you for visiting!</p>
<div id="wrapper">
<!-- begin Personal navigation menu -->
<ul id="pMenu">
<li><a href="health.html" title="Health Page">health</a>
<!-- begin health -->
<div id="health">
<!-- weight loss -->
<h2>weight loss & wellness</h2>
<!-- fitness -->
<h3><span>fitness</span></h3>
<ul>
<li><a href="health/fitness/weiderpowerbell1.html">Weider PowerBell</a></li>
<li><a href="health/fitness/brazilbuttlift1.html">Brazil Butt Lift</a></li>
<li><a href="health/fitness/georgesstpierre1.html">MMA Training with Georges St. Pierre</a></li>
<li><a href="health/fitness/turbofire1.html">TurboFire Fitness</a></li>
</ul>
<!-- dieting -->
<h3><span>dieting</span></h3>
<ul>
<li><a href="health/dieting/healthetrimdiet1.html">Healthé Trim Diet</a></li>
<li><a href="health/dieting/southbeach1.html">South Beach Diet</a></li>
</ul>
<!-- supplements -->
<h2>supplements</h2>
<ul>
<li><a href="health/Rx/nutrilitevitamins1.html">Nutrilite Multivitamins</a></li>
<li><a href="health/Rx/dochangover1.html">Doc Hangover Cure</a></li>
<li><a href="health/Rx/libigrow1.html">Libigrow</a></li>
<li><a href="health/Rx/smokedeter1.html">Smoke Deter</a></li>
<li><a href="health/Rx/prorexin1.html">Prorexin</a></li>
</ul>
<!-- skin care -->
<h2>skin care</h2>
<ul>
<li><a href="health/skincare/shivaacne1.html">Shiva23 Acne Cream</a></li>
<li><a href="health/skincare/deadseamineral1.html">Dead Sea Mineral Cellulite Treatment</a></li>
</ul>
</div>
<!-- end health -->
</li>
<li><a href="insurance.html" title="Insurance Page">insurance</a>
<!-- begin insurance -->
<div id="insurance">
<!-- property insurance -->
<h2><a href="insurance/propertyinsurance1.html">home⁄property insurance</a></h2>
<ul>
<li><a href="insurance/usinsurancepropertyreview1.html">USInsuranceOnline.com – Property</a></li>
</ul>
<!-- auto insurance -->
<h2><a href="insurance/autoinsurance1.html">auto insurance</a></h2>
<ul>
<li><a href="insurance/bestquotesautoreview1.html">BestQuotes.com</a></li>
<li><a href="insurance/insuremycar4lessreview1.html">InsureMyCar4Less</a></li>
<li><a href="insurance/lowermycarinsuranceratereview1.html">Lower My Car Insurance Rate</a></li>
<li><a href="insurance/atlascarinsurancereview1.html">Atlas Car Insurance</a></li>
<li><a href="insurance/insurancecomparisonreview1.html">Insurance Comparison</a></li>
</ul>
<!-- health insurance -->
<h2><a href="insurance/healthinsurance1.html">health insurance</a></h2>
<ul>
<li><a href="insurance/betterhealthquotereview1.html">Better Health Quote</a></li>
<li><a href="insurance/healthinsurancesourcesreview1.html">Health Insurance Sources</a></li>
<li><a href="insurance/americanhealthcarecenterreview1.html">American Health Care Center Review</a></li>
<li><a href="insurance/bestquoteshealthreview1.html">BestQuotes.com – Health</a></li>
</ul>
<!-- life insurance -->
<h2><a href="insurance/lifeinsurance1.html">life insurance</a></h2>
<ul>
<li><a href="insurance/americaninsurancereview1.html">American Insurance</a></li>
<li><a href="insurance/usinsurancelife1.html">USInsuranceOnline.com – Life</a></li>
</ul>
</div>
<!-- end insurance -->
</li>
<li><a href="general.html" title="General Page">general</a>
<!-- begin general -->
<div id="general">
<!-- electronics -->
<h2>electronics</h2>
<!-- gaming -->
<h3><span>gaming</span></h3>
<ul>
<li><a href="gaming/haltgamereview1.html">Halt Game</a></li>
<li><a href="gaming/battlestargalactica1.html">Battlestar Galactica</a></li>
<li><a href="gaming/gsn1.html">GSN Gaming</a></li>
</ul>
<!-- electronic gadgets -->
<h3><span>electronic gadgets</span></h3>
<ul>
<li><a href="electronics/kindle1.html">Kindle e–Reader</a></li>
<li><a href="electronics/ecig1.html">Electronic Cigarettes</a></li>
</ul>
<!-- style and fashion -->
<h2>style & fashion</h2>
<!-- makeup -->
<h3><span>makeup</span></h3>
<ul>
<li><a href="makeup/dinair1.html">Dinair Airbrush Makeup</a></li>
<li><a href="makeup/simplykaren1.html">Simply Karen</a></li>
</ul>
<!-- food/dining -->
<h2>food⁄dining</h2>
<!-- net grocers -->
<h3><span>net grocers</span></h3>
<ul>
<li><a href="food/efooddepot1.html">eFood Depot</a></li>
<li><a href="food/peapod1.html">Peapod</a></li>
</ul>
<!-- coupons -->
<h3><span>coupons</span></h3>
<ul>
<li><a href="coupons/brandcaster1.html">Brandcaster Coupons</a></li>
</ul>
<!-- cars/auto -->
<h2>cars⁄auto</h2>
<ul>
<li><a href="auto/carfax1.html">Carfax Vehicle History Reports</a></li>
<li><a href="auto/carprices1.html">CarPrices.com</a></li>
</ul>
<!-- security -->
<h2>security</h2>
<ul>
<li><a href="security/adtalarm1.html">ADT Alarm System</a></li>
</ul>
<!-- hobby -->
<h2>hobby</h2>
<!-- music -->
<h3><span>music</span></h3>
<ul>
<li><a href="music/guitartricksreview1.html">GuitarTricks</a></li>
<li><a href="music/jamoramareview1.html">Jamorama– Learn Guitar</a></li>
</ul>
</div>
<!-- end general -->
</li>
<li><a href="dating.html" title="Dating Page">dating</a>
<!-- begin dating -->
<div id="dating">
<!-- dating sites -->
<h2>dating sites</h2>
<ul>
<li><a href="dating/realmaturesingles1.html">RealMatureSingles</a></li>
<li><a href="dating/seniorpeoplemeet1.html">SeniorPeopleMeet</a></li>
<li><a href="dating/adultfriendfinder1.html">Adult Friend Finder</a></li>
<li><a href="dating/benaughty1.html">BeNaughty.com</a></li>
<li><a href="dating/untrue1.html">Untrue.com</a></li>
<li><a href="dating/elitemate1.html">EliteMate</a></li>
<li><a href="dating/pridedating1.html">Pride Dating (gay)</a></li>
<li><a href="dating/speeddate1.html">SpeedDate.com</a></li>
</ul>
<!-- books and advice -->
<h2>books & advice</h2>
<ul>
<li><a href="dating/askapril1.html">Ask April</a></li>
<li><a href="dating/bounceback1.html">Bounce Back to Dating Formula</a></li>
<li><a href="dating/datingsecrets1.html">Dating Secrets</a></li>
</ul>
</div>
<!-- end dating -->
</li>
<li><a href="education.html" title="Education Page">education</a>
<!-- begin education -->
<div id="education">
<ul>
<li><a href="education/scholzone1.html">Scholarship Zone</a></li>
<li><a href="education/speedstudytechniques1.html">Speed Study Techniques</a></li>
<li><a href="education/stimulusgrants1.html">Stimulus Grants</a></li>
<li><a href="education/teachmetoday1.html">Teach Me Today</a></li>
<li><a href="education/winningsurveys1.html">Winning Surveys</a></li>
<li><a href="education/basicskillsassessments1.html">Basic Skills Assessments</a></li>
</ul>
</div>
<!-- end education -->
</li>
<li><a href="legal.html" title="Legal Page">legal</a>
<!-- begin personal legal -->
<div id="pLegal">
<ul>
<li><a href="debt/urgenthomerelief1.html">Urgent Home Relief</a></li>
</ul>
<!-- mortgage -->
<h2>mortgage</h2>
<ul>
<li><a href="mortgage/foreclosurefighter1.html">Home Foreclosure Fighter</a></li>
<li><a href="mortgage/fastcash4homes1.html">Fast Cash 4 Homes</a></li>
</ul>
<!-- debt -->
<h2>debt</h2>
<!-- bankruptcy -->
<h3><span><a href="legal/bankruptcy1.html">bankruptcy</a></span></h3>
<ul>
<li><a href="debt/evalbankruptcy1.html">Bankruptcy Lawyer Finder</a></li>
<li><a href="legal/bankruptcy1.html">Bankruptcy Attorney Finder</a></li>
</ul>
<!-- credit debt -->
<h3><span><a href="legal/creditdebt1.html">credit debt</a></span></h3>
<ul>
<li><a href="debt/debtnegotiator1.html">Debt Negotiator</a></li>
</ul>
<!-- divorce -->
<h2>divorce</h2>
<ul>
<li><a href="legal/divorcedocuments1.html">Divorce Documents</a></li>
</ul>
<!-- defense attorney -->
<h2>defense attorney</h2>
<ul>
<li><a href="legal/DUIattorney1.html">DUI Attorney</a></li>
</ul>
<!-- will creation -->
<h2>will creation</h2>
<ul>
<li><a href="legal/willcreation1.html">Create My Will</a></li>
</ul>
</div>
<!-- end personal legal -->
</li>
</ul>
</li>
<!-- end Personal navigation menu-->
<!-- begin Business navigation menu-->
<ul id="bMenu">
<li><a href="startyourownbusiness.html" title="Business Opportunities Page">business opportunities</a>
<!-- business opportunities -->
<div id="bizopps">
<ul>
<li><a href="bizopps/mobilemassmoney1.html">Mobile Mass Money</a></li>
<li><a href="bizopps/autopilothomeprofits.html">Autopilot Home Profits</a></li>
<li><a href="bizopps/anthonymorrison1.html">Anthony Morrison's Big Profits Secret</a></li>
</ul>
<!-- home business scams -->
<h2>home business scams</h2>
<ul>
<li><a href="bizopps/medicalbillinghomebusiness1.html">The Medical Billing Home Business Bible</a></li>
</ul>
<!-- medical -->
<h2>medical</h2>
<ul>
<li><a href="bizopps/freesitesignup1.html">Cash–Pulling Affiliate Marketing Websites</a></li>
<li><a href="bizopps/biggerbloggingprofitsreview1.html">Bigger Blogging Profits</a></li>
</ul>
<!-- affiliate marketing -->
<h2>affiliate marketing</h2>
<ul>
<li><a href="bizopps/milliondollarpips1.html">Pips Forex Trading Robot</a></li>
<li><a href="bizopps/pennystockprophet1.html">The Penny Stock Prophet</a></li>
</ul>
<!-- trading/investing -->
<h2>trading⁄investing</h2>
<ul>
<li><a href="bizopps/swagbucks1.html">Swag Bucks</a></li>
<li><a href="bizopps/corsentialsurvey1.html">Corsential</a></li>
</ul>
<h2><a href="bizopps/makemoneywithsurveys1.html">surveys</a></h2>
<ul>
<li><a href="bizopps/thepeoplesprogram1.html">The People's Program</a></li>
</ul>
</div>
<!-- end business opportunities -->
</li>
<li><a href="businessservices.html" title="Business Services Page">business services</a></li>
<!-- business services -->
<div id="bizservices">
<ul>
<li><a href="bizopps/lessthantruckloadshipping1.html">Top Flight Concepts</a></li>
</ul>
<!-- shipping solutions -->
<h2>shipping solutions</h2>
<ul>
<li><a href="telecommasterquoteagency1.html">Telecom Master Quote Agency</a></li>
</ul>
<!-- technology solutions -->
<h2>technology solutions</h2>
<ul>
<li><a href="bizservices/projmgmttemplates1.html">Project Management Templates</a></li>
</ul>
<!-- project management -->
<h2>project management</h2>
</div>
<!-- end business services -->
</li>
<li><a href="legal.html" title="Legal Services Page">legal services</a>
<!-- begin business legal -->
<div id="bLegal">
<ul>
<li><a href="legal/willcreation1.html">Create My Will</a></li>
</ul>
<!-- will creation -->
<h2>will creation</h2>
<ul>
<li><a href="legal/DUIattorney1.html">DUI Attorney</a></li>
</ul>
<!-- defense attorney -->
<h2>defense attorney</h2>
<ul>
<li><a href="legal/divorcedocuments1.html">Divorce Documents</a></li>
</ul>
<!-- divorce -->
<h2>divorce</h2>
<ul>
<li><a href="debt/debtnegotiator1.html">Debt Negotiator</a></li>
</ul>
<!-- credit debt -->
<h3><span><a href="legal/creditdebt1.html">credit debt</a></span></h3>
<ul>
<li><a href="debt/evalbankruptcy1.html">Bankruptcy Lawyer Finder</a></li>
<li><a href="legal/bankruptcy1.html">Bankruptcy Attorney Finder</a></li>
</ul>
<!-- bankruptcy -->
<h3><span><a href="legal/bankruptcy1.html">bankruptcy</a></span></h3>
<!-- debt -->
<h2>debt</h2>
<ul>
<li><a href="mortgage/foreclosurefighter1.html">Home Foreclosure Fighter</a></li>
<li><a href="mortgage/fastcash4homes1.html">Fast Cash 4 Homes</a></li>
</ul>
<!-- mortgage -->
<h2>mortgage</h2>
<ul>
<li><a href="debt/urgenthomerelief1.html">Urgent Home Relief</a></li>
</ul>
</div>
<!-- end business legal -->
</li>
</ul>
<!-- end Business navigation menu-->
</div>
<!-- end wrapping div -->
</div>
<!-- end body div -->
<div id="footer"> </div>
<!-- end footer div -->
<h3 id="copytagatbottom">©WorldReviewGroup.com<br />
Updated Dec 14, 2012</h3>
</div>
<!-- end middle div -->
<!-- begin side windows -->
<div id="leftside">
<div id="leftsideend"> </div>
<div id="leftsidebody">
<h2 class="sideWindowHeaderText">Most Popular</h2>
<ul class="sideWindowLinks">
<li><a href="food/peapod1.html">Peapod</a></li>
<li><a href="health/dieting/southbeach1.html">South Beach Diet</a></li>
<li><a href="coupons/brandcaster1.html">Brandcaster Coupons</a></li>
</ul>
</div>
<div id="leftsidestart"> </div>
</div><!-- end leftside div -->
<div id="rightside"><!-- begin rightside div -->
<div id="rightsidestart"> </div>
<div id="rightsidebody">
<h2 class="sideWindowHeaderText">Not Recommended</h2>
<ul class="sideWindowLinks">
<li><a href="#">Anthony Morrison's Big Profits Secret</a></li>
<li><a href="#">Mobile Mass Media</a></li>
<li><a href="#">Prorexin</a></li>
</ul>
<form id="emailbox" name="form1" method="post" action="showwindow.html">
<div>
<input type="text" name="go" id="go" value="your e-mail" onclick="input_focus(this)" onblur="input_reset(this)" maxlength="60"/>
<input type="submit" value="Join" onclick="postEmail()" />
</div>
</form>
</div>
<div id="rightsideend"> </div>
</div>
<!-- end side windows -->
<form name="form2" id="form2" method="post">
<label for="confirmemail">Confirm Your E-mail:<span>*</span></label>
<input type="text" name="confirmemail" value="" maxlength="60"/><br />
<label for="name">Enter Your Name:</label>
<input type="text" name="name" value="" maxlength="60" /><br />
<label for="age">Select Your Age Range:</label>
<select name="age">
<option selected="selected">18–35</option>
<option>36–55</option>
<option>55+</option>
<option>17 or Younger</option>
</select>
<input type="text" name="age" value="" maxlength="3" /><br />
<label for="country">Select Your Country:<span>*</span></label>
<select name="country">
<option selected="selected">United States</option>
<option>United Kingdom</option>
<option>Canada</option>
<option>Australia</option>
<option>Russia</option>
<option>Brazil</option>
<option>Somewhere Else</option>
</select><br />
<input type="submit" value="Sign Me Up!" />
</form>
</div>
</div><!-- end container -->
</div><!-- end gray mask -->
</body>
</html>
emailsubmit.css
@charset "utf-8";
/* CSS Document for the E-mail Submission Form */
#graymask{
height:1000px;
width:1360px;
background:#999;
opacity:40;
filter:alpha(opacity=50);
z-index:99;
}
#form2{
background:url("emailsubmission.gif") no-repeat scroll 50% 0 transparent;
width:360px;
height:300px;
margin-left:0;
text-align:center;
opacity:100;
filter:alpha(opacity=100);
z-index:999;
}
#form2 span{
color:red;
}