Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

HELP! submit button counter

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

HELP! submit button counter

Postby tomer10 » Sun Mar 03, 2013 7:51 am

hey everybody
I've been looking for a code for my script that can really help me
i'm no php pro
i built a site with a e-mail form , i want to make a counter that count
the amount that people sent a mail (clicked submit)
i guess that if the value will be saved to a text file on the server it will be good enough!
this is my php code:
<html>
<body>

<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail("user@domain.com", $subject,
$message, "From:" . $email);
header("Location: wish3.html?page=home");
exit();
}
else
//if "email" is not filled out, display the form
{
echo "<form method='post' action='wish2.php'>
Email: <input name='email' type='text'><br>
Subject: <input name='subject' type='text'><br>
Message:<br>
<textarea name='message' rows='15' cols='40'>
</textarea><br>
<input type='submit'>
</form>";
}
?>

<form method="post" action="write.php">
<input class="input" type="text" name="norobot" />
<img src="captcha.php" />
<input type="submit" value="Submit" />
</body>
</html>



and i want to add in another place in the site the value of the counter
any1 know how to do it ?
tomer10
New php-forum User
New php-forum User
 
Posts: 1
Joined: Sun Mar 03, 2013 7:38 am

Re: HELP! submit button counter

Postby seandisanti » Mon Mar 04, 2013 10:30 am

Here's an 8 minute video on File IO that should help you out. http://jream.com/learning/videos/php-ba ... e-handling
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 6 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.