Jump to content

Parse Error


Joshv1288

Recommended Posts

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/h3swat/public_html/livereg.php on line 13

 

line 13 at the top

 

 

$user = $_POST[\'username\'];
$pass = $_POST[\'password\'];
$pass2 = $_POST[\'password2\'];
$name = $_POST[\'name\'];
$age = $_POST[\'age\'];
$loc = $_POST[\'loc\'];
$gender = $_POST[\'gender\'];
$email = $_POST[\'email\'];
$gt = $_POST[\'GT\'];

Link to comment
Share on other sites

this file is like big so i just post to the end of the varibles the rest just verify the user has wrote in the input fields

 

<?php

$url = "http://h3swatlg.exofire.net/profile.php\";

 

 

$user = $_POST['username'];

$pass = $_POST['password'];

$pass2 = $_POST['password2'];

$name = $_POST['name'];

$age = $_POST['age'];

$loc = $_POST['loc'];

$gender = $_POST['gender'];

$email = $_POST['email'];

$gt = $_POST['GT'];

 

Link to comment
Share on other sites

ok that fixed all that now i get this

 

Warning: Cannot modify header information - headers already sent by (output started at /home/h3swat/public_html/livereg.php:9) in /home/h3swat/public_html/livereg.php on line 87

if (empty($gender))
{
header("Location: error-gender.php"); //the user will be sent to this page
Die();
}

Link to comment
Share on other sites

//PASSWORD VERIFICATION
if (($pass)!=($pass2)) 
{
header("Location: register.php"); 
Die();
}
//EMAIL VERIFICATION
function CheckMail($email) 
{
if(eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,4}$",$email)) 
{ 
	return true;
}
else 
{ 
	return false; 
}
}
if ((empty($email)) || (!CheckMail($email))) 
{
header("Location: register.php"); 
Die();
}
//Age VERIFICATION
function CheckAge($age) 
{
if (eregi("[0-9]", $age)) 
{
	return true;
}
else 
{ 
	return false; 
}
}
if ((empty($age)) || (!CheckAge($age)) || (strlen($age)!=2))

{
header("Location: register.php"); 
Die();
}
//NAME VERIFICATION

if (empty($name))
{
header("Location: register.php"); 
Die();
}
//GENDER VERIFICATION

if (empty($gender))
{
header("Location: register.php"); 
Die();
}
//LOCATION VERIFICATION

if (empty($loc))
{
header("Location: register.php");
Die();
}
//GAMERSTAG VERIFICATION

if (empty($gt))
{
header("Location: register.php"); 
Die();
}

//USER AND PASSWORD LENGTH CHECK
$min_lenngth = 6; /
if(strlen($user) < $min_lenngth || strlen($pass) < $min_lenngth)
{
header("Location: register.php"); 
Die();
}
//Connects to Database
$connection = mysql_connect("localhost", "h3swat_test", "kwdb39");
@mysql_select_db("h3swat_test") or die( "Unable to select database");

$check = mysql_query("select username from users where username=\"$user\"");
$returned = mysql_fetch_array($check);

if(!empty($returned))
{
header("Location: register.php"); 
mysql_close($connection); 
}
else
{

$check = mysql_query("select email from users where email=\"$email\"");
$returned = mysql_fetch_array($check);

if(!empty($returned))
{
header("Location: register.php"); 
mysql_close($link); //
Die();
}
else /
$pass=md5($pass); /
$request = "INSERT INTO users values(NULL,\'$name\',\'$user\',\'$pass\', \'$email\',\'$gt\',\'$age\',\'$gender\',\'$loc\')";
$results = mysql_query($request);
if($results) 
{
header("Location: profile.php"); 
}
else {
header("Location: register.php");

}
mysql_close($link); 
Die();

echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL=.$url.">';[/quote]

 

Wat do i do with all this then sry im not really understanding output

Link to comment
Share on other sites

<?php 
$url = "http://h3swatlg.exofire.net/profile.php";


$user = $_POST['username'];
$pass = $_POST['password'];
$pass2 = $_POST['password2'];
$name = $_POST['name'];
$age = $_POST['age'];
$loc = $_POST['loc'];
$gender = $_POST['gender'];
$email = $_POST['email'];
$gt = $_POST['GT'];



//PASSWORD VERIFICATION
if (($pass)!=($pass2)) 
{
header("Location: register.php"); 
Die();
}
//EMAIL VERIFICATION
function CheckMail($email) 
{
if(eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,4}$",$email)) 
{ 
	return true;
}
else 
{ 
	return false; 
}
}
if ((empty($email)) || (!CheckMail($email))) 
{
header("Location: register.php"); 
Die();
}
//Age VERIFICATION
function CheckAge($age) 
{
if (eregi("[0-9]", $age)) 
{
	return true;
}
else 
{ 
	return false; 
}
}
if ((empty($age)) || (!CheckAge($age)) || (strlen($age)!=2))

{
header("Location: register.php"); 
Die();
}
//NAME VERIFICATION

if (empty($name))
{
header("Location: register.php"); 
Die();
}
//GENDER VERIFICATION

if (empty($gender))
{
header("Location: register.php"); 
Die();
}
//LOCATION VERIFICATION

if (empty($loc))
{
header("Location: register.php");
Die();
}
//GAMERSTAG VERIFICATION

if (empty($gt))
{
header("Location: register.php"); 
Die();
}

//USER AND PASSWORD LENGTH CHECK
$min_lenngth = 6; /
if(strlen($user) < $min_lenngth || strlen($pass) < $min_lenngth)
{
header("Location: register.php"); 
Die();
}
//Connects to Database
$connection = mysql_connect("localhost", "h3swat_test", "kwdb39");
@mysql_select_db("h3swat_test") or die( "Unable to select database");

$check = mysql_query("select username from users where username=\"$user\"");
$returned = mysql_fetch_array($check);

if(!empty($returned))
{
header("Location: register.php"); 
mysql_close($connection); 
}
else
{

$check = mysql_query("select email from users where email=\"$email\"");
$returned = mysql_fetch_array($check);

if(!empty($returned))
{
header("Location: register.php"); 
mysql_close($link); //
Die();
}
else /
$pass=md5($pass); /
$request = "INSERT INTO users values(NULL,\'$name\',\'$user\',\'$pass\', \'$email\',\'$gt\',\'$age\',\'$gender\',\'$loc\')";
$results = mysql_query($request);
if($results) 
{
header("Location: profile.php"); 
}
else {
header("Location: register.php");

}
mysql_close($link); 
Die();

echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL=.$url.">';
?>

here ya go

Link to comment
Share on other sites

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>

 

this is b4 it

Link to comment
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.