So I have made a "Coming Soon" page and I have a form to sign up for a newsletter but I cant seem to get the coding right.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Coming Soon to a Browser Near You</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script>
<script type='text/javascript' src='javascripts/jquery.tipsy.js'></script>
<script type='text/javascript'>
$(function() {
$('#tipsy').tipsy({fade: true, gravity: 's'});
});
</script>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="wrapper">
<!-- <img src="images/logo.png" alt="YourLogo" title="YourLogo"/>
--> <h1>SirAethon</h1>
<div class="hr"></div>
<h3>Coming Soon to a Browser Near You</h3>
<p>Unfortunately, we’re not quite ready yet. <strong> But, you can see our progress below:</strong></p>
<section class="progress">
<div class="progress-bar-container" id="tipsy" title="8% Complete"> <!-- Edit this title for the tooltip pop up -->
<article class="progress-bar" style="width:8%" ></article> <!-- Edit the width percentage value to indicate progress -->
</div>
<article class="txt-launch-day-hat"></article>
</section>
<div class="hr"></div>
<section class="mailing-list">
<h2>Want to be the first to know when we're ready?</h2>
<form>
<input type="text" value="your@email.com" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;">
<input type="submit" value="Subscribe">
</form>
</section><div class="clear"></div>
<div class="hr"></div>
<p class="credit">Designed by <a href="http://siraethon.com">SirAethon</a></p>
</div>
</body>
</html>
That is my index.html page. I want the form section to be able to take an email and confirm that it is an actual email then put that email into a text file so that I can come along later and take the emails so I can send a mass email at once.
<section class="mailing-list">
<h2>Want to be the first to know when we're ready?</h2>
<form>
<input type="text" value="your@email.com" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;">
<input type="submit" value="Subscribe">
</form>
</section>
Above is the mailing list section along with the form.
(Any help is highly appreciated! Thank you in advance!)
EDIT1: So I have gotten it to work but now it says "13 bytes written to file" once you click the subscribe button how do I fix it from saying this and make it say something else like thank you for subscribing?
I used these coding:
Form:
<form action="php/signup.php" method="POST">
<input name="field1" type="text" value="your@email.com" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;">
<input type="submit" name="submit" value="Save Data">
</form>
signup.php:
<?phppublic_html/the-fam.com/php/signup.php
if(isset($_POST['field1'])) {
$data = $_POST['field1'];
$ret = file_put_contents('emails.txt', $data, FILE_APPEND | LOCK_EX);
if($ret === false) {
die('There was an error writing this file');
}
else {
echo "$ret bytes written to file";
}
}
else {
die('no post data to process');
}
EDIT2: So i tried to fix it saying bytes written to file and now its not displaying anything nor is it writing to file: "$ret bytes written to file" I removed that part then replaced it and nothing is happening but I replaced it back and still nothing is happening
If you want to look at the site your self it is http://the-fam.com