Jump to content

Recommended Posts

I am most likely missing an ending parameter but I have been trying to get this script to work a few days now. I also get an error when trying to pull data from the database and sending it to an email.

 

<?
//Submit Button Command
if(isset($_POST['submit'])) {

//SQL QUERIES & CONNECTION
$con = mysql_connect("localhost","nwrepai1_x54abs","1225ff5d1c");
if (!$con)
{
	die('Could not connect: ' . mysql_error());
}

mysql_select_db("nwrepai1_chanreq", $con);
//Query to submit to database
$sql ="INSERT INTO VIP (vent_user, email, country, number_of_users, number_of_chan_ad, payment_term, payment_type)
VALUES
('$_POST[vent_user_vip]','$_POST[vip_email]','$_POST[country]','$_POST[num_users]','$_POST[num_chan_ad]','$_POST[term]','$_POST[pay_type]')";
//Data submitted to database
if (!mysql_query($sql,$con))
{
	die('Error: ' . mysql_error());
}

//Pull ID field from table VIP
if(isset($_POST['submit'])) {
$database = "nwrepai1_chanreq";
$table = "VIP";
$connection = @mysql_connect("localhost","nwrepai1_x54abs","1225ff5d1c")
or die(mysql_error());
$db = @mysql_select_db($database, $connection) or die(mysql_error());
$chk_id = "SELECT id FFROM $table";
$chk_id_res = @mysql_query($chk_id,$connection) or die(mysql_error());
$chk_id_num = mysql_num_rows($chk_id_res);
if ($chk_id_num !=1) {
	$error = "COULD NOT PULL";
} else {
	$sql = "SELECT id FROM $table";
	$result = @mysql_query($sql,@connection) or die(mysql_error());
	while ($row = mysql_fetch_array($result)) {
		$client = $row['id'];
	}
}

//Subject of email
$subject = "VIP Quote/Request";
$email = $_POST['vip_email'];
$vent_user = $_POST['vent_user_vip'];
$country = $_POST['country'];
$num_users = $_POST['num_users'];
$num_chan_ad = $_POST['num_chan_ad'];
$term = $_POST['term'];
$paytype =$_POST['pay_type'];
$address = getenv("REMOTE_ADDR");
$agent = getenv("HTTP_USER_AGENT");

//Mail To These Address
//$to = "[email protected], [email protected]";
$to = "[email protected]";
//$to = "[email protected]";


//Information gathered on the form will be emailed as seen here
$body = "Ventrilo Username: 
$vent_user

Email:
$email

Country:
$country

Number of that will be using the channel (Estimated):
$num_users

Number of channel admins
$num_chan_ad

Payment Term:
$term

Payment Type:
$paytype

IP Address:
$address

ID:
$client

Other Misc Facts
$agent";

mail($to, $subject, $body);
header("Location: http://www.gameservers.com/clanpay/?clanid=5ed9e75b6153801770a6490db2fcc960");
} else {
echo "Could Not Send";
}
mysql_close($con)
?>

 

Parse error: syntax error, unexpected $end in /home/nwrepai1/public_html/ventrilox.com/vipmailer.php  on line 98

 

I dont know what I am doing wrong and I have asked some of buds to help but they havent figured it out yet.

Link to comment
https://forums.phpfreaks.com/topic/203594-error-submitted/
Share on other sites

OK I did, well now I am getting a completely different error.

 

Could Not Send
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /home/nwrepai1/public_html/ventrilox.com/vipmailer.php on line 96

 

The Could Not Send is an output by the else statement

Link to comment
https://forums.phpfreaks.com/topic/203594-error-submitted/#findComment-1066474
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.