View Single Post
Old 01-31-2013, 10:59 PM   PM User | #8
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,365
Thanks: 18
Thanked 348 Times in 347 Posts
sunfighter is on a distinguished road
Replace your first php section with what I gave you.

IE does not understand the submit button. In your form use a hidden field. I like
Code:
<input type="hidden" name="msoft" value="junk">
right after the form tag.
Then use this line in your evaluation code:
Code:
if(isset($_POST["msoft"]) && $_POST["msoft"] == 'junk')
instead of this one:
Code:
if($_POST['pubformsubmit'] == "Submit")
Your input checking just looks to see if the user entered something and not what he entered. You should spend some time on the internet looking up evaluating forms. Lots out there. It's also where you eliminate the commas, enters, =, -, and other special characters that your having problems with. Some of this uses Regex which is hard to master, but easy to copy/paste.

Here's an updated but not fully correct page:
PHP Code:
<?php
session_start
();
 
$_SESSION["rewards"] = '';

if(isset(
$_GET['refid'])){
    
setcookie("njfailREWARDsystem"$_GET['refid'], time()+604800);

}else if(isset(
$_COOKIE["njfailREWARDsystem"])){
    
$value $_COOKIE["njfailREWARDsystem"];
    
$_SESSION["rewards"] = $value;
}

if(isset(
$_POST["msoft"]) && $_POST["msoft"] == 'junk')
{
    
$errorMessage "";

    if(empty(
$_POST['publishername']))
    {
        
$errorMessage .= "<li>Please enter your name in the field below.</li>";
    }
    if(empty(
$_POST['publisheremail']))
    {
        
$errorMessage .= "<li>Please enter your email in the field below.</li>";
    }
    if(empty(
$_POST['websitename']))
    {
        
$errorMessage .= "<li>Please enter a name for your website.</li>";
    }
    if(empty(
$_POST['websiteurl']))
    {
        
$errorMessage .= "<li>Please enter your website's URL.</li>";
    }
    if(empty(
$_POST['uniqueviews']))
    {
        
$errorMessage .= "<li>Please enter an estimate of your website's monthly unique views.</li>";
    }
    if(empty(
$_POST['rawviews']))
    {
        
$errorMessage .= "<li>Please enter an estimate of your website's monthly raw impressions.</li>";
    }
    if(empty(
$_POST['websitedescription']))
    {
        
$errorMessage .= "<li>Please enter a description for your website.</li>";
    }

    
$varpublishername $_POST['publishername'];
    
$varpublisheremail $_POST['publisheremail'];
    
$varwebsitename $_POST['websitename'];
    
$varwebsiteurl $_POST['websiteurl'];
    
$varuniqueviews $_POST['uniqueviews'];
    
$varrawviews $_POST['rawviews'];
    
$varwebsitedescription $_POST['websitedescription'];


    if(empty(
$errorMessage))
    {

//define the receiver of the email
    
$to $_POST['publisheremail'];
//define the subject of the email
    
$subject 'ValueViewMedia Application Confirmation';
//define the message to be sent. Each line should be separated with \n
    
$message $_POST['publishername']. ",\n\nThank you for applying to become a ValueViewMedia publisher!\nWe will review your application, and contact you with the results within 48 hours.\n\nThank you,\nValueViewMedia";
//define the headers we want passed. Note that they are separated with \r\n
    
$headers "From: publishers@valueviewmedia.com\r\nReply-To: publishers@valueviewmedia.com";
//send the email
    
$mail_sent = @mail$to$subject$message$headers );



        
$fs fopen("publisherapps.csv","a");
        
fwrite($fs,$varpublishername ", " $varpublisheremail ", " $varwebsitename ", " $varwebsiteurl ", " $varuniqueviews ", " $varrawviews ", " $varwebsitedescription ", " $refid "\n");
        
fclose($fs);

        
header("Location: /publishers/success/");
        exit;
    }
}
?>
<!DOCTYPE html>
<html>
<head>
<link type="text/css" href="/style.css" rel="stylesheet">
<link type="text/css" href="/publishers/apply/applystyle.css" rel="stylesheet">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Publisher Application</title>
<link rel="icon" type="image/png" href="/vvmfavicon16.png">
</head>

<body>
<div id="headerWrapper">
            <div id="header">
                <div id="networkname">
                    <h1><a href="/"><img alt="ValueViewMedia" src="/valueviewmedia.png"></a></h1>
                </div>
                <nav class="topbar" id="usernav">
                    <ul>
                        <li class="menu"><a class="menu" name="Settings" title="Log in to your ValueViewMedia Publisher or Advertiser account." href="http://manage.valueviewmedia.com/">Log in</a></li>
                        <li><a title="Talk with a support representative." href="/contactus/">Contact Us</a></li>
                    </ul>
                </nav>
            </div>
        </div>
        <div class="navtabsWrapper">
            <nav id="navtabs">
                <ul>
                    <li id="tab-dashboard"><a title="Home Page." href="/">Home</a></li>
                    <li id="tab-campaigns" class="selected"><a title="Information on becoming a ValueViewMedia Publisher." href="/publishers/">Publishers</a></li>
                    <li id="tab-sites"><a title="Learn about advertising on the ValueViewMedia network." href="/advertisers/">Advertisers</a></li>
                </ul>
            </nav>
        </div>
        <div class="imageNavContainer">
        </div>
        <div id="maincontent">
            <div class="contentHeader">
                <h2>Publisher Application</h2>
            </div>
            <div class="applicationcontainer">
<?php
if(!empty($errorMessage))
{
echo(
"<div class='errormessages'>\n");
echo(
"<p>There was an error with your application:</p>\n");
echo(
"<ul>" $errorMessage "</ul>\n");
echo(
"</div>\n");
}
?>
<form id="form" name="form" method="post" action="#">
<input type="hidden" name="msoft" value="junk">
<h1>Please fill out the form below.</h1>
<p>After you submit this form, a ValueViewMedia representative will review your website(s), and email you within 48 hours to discuss the results and help you get started with our network.</p>

<label>Full Name<br>
<span class="small">First Name Last Name</span>
</label>
<input type="text" name="publishername" id="publishername" /><br><br>

<label>Email Address<br>
<span class="small">This is how we will contact you</span>
</label>
<input type="text" name="publisheremail" id="publisheremail" /><br><br>

<label>Company Name<br>
<span class="small">Leave blank if you are not representing a company</span>
</label>
<input type="text" name="publishercompanyname" id="publishercompanyname" /><br><br>

<label>Website Name<br>
<span class="small">Title of your website</span>
</label>
<input type="text" name="websitename" id="websitename" /><br><br>

<div class="helpicon">
<div class="help">
<img src="/help.png">
<div>
This information will not be used to market your site, so please do not load it with keywords.<br>
If you have multiple sites, you can separate the titles using a backslash /.
</div>
</div>
</div>

<label>Website URL<br>
<span class="small">http://example.com</span>
</label>
<input type="text" name="websiteurl" id="websiteurl" /><br><br>

<div class="helpicon">
<div class="help">
<img src="/help.png">
<div>
If you have multiple websites, you can separate them using a backslash /.
Example: http://example.com  /  http://other.com
</div>
</div>
</div>

<label>Unique Visitors Per Month<br>
<span class="small">Your average unique views</span>
</label>
<input type="text" name="uniqueviews" id="uniqueviews"><br><br>

<div class="helpicon">
<div class="help">
<img src="/help.png">
<div>
If you have multiple websites, please list your site's URL and then the views for that site. Then list your next website's URL and list the views for that site. Example: example.com 22000 other.com 15000
</div>
</div>
</div><br>

<label>Raw Impressions Per Month<br>
<span class="small">Your average overall impressions per month</span>
</label>
<input type="text" name="rawviews" id="rawviews"><br><br>

<label>Website Description<br>
<span class="small">Describe your website to us</span>
</label><br>
<textarea rows="5" cols="50" name="websitedescription" id="websitedescription"></textarea>

<div class="submitcenter">
<input class="submitappbutton" type="submit" name="pubformsubmit" value="Submit"><br>
</div>
<div class="spacer"></div>
</form>
</div>
<div class="footerx">
    <a href="/privacypolicy/">Privacy Policy</a>
    <a style="margin-left:60px;margin-right:60px;" href="/termsofservice/">Terms of Service</a>
    <a href="/contactus/">Contact Us</a>
    <a style="margin-left:60px;" href="/ourphilosophy/">Our Philosophy</a>
    <div class="copyrightx">Copyright &copy; 2013, Value View Media Inc.</div>
</div>
</div>
</body>
</html>
sunfighter is offline   Reply With Quote