Jump to content

What did i do wrong?


Butler

Recommended Posts

<?php
include('connection.php');

$test1=$_POST('firstname');
$test2=$_POST('lastname');
$test3=$_POST('username');

if (!eregi("([^A-Za-z0-9]"),$test1)){

if (!eregi("([^A-Za-z0-9]"),$test2)){
	if (!eregi("([^A-Za-z0-9]"),$test3)){
	$query="SELECT * FROM vendors WHERE username = '$_POST(username)'"
	$result=mysql_query($query);
	$num=mysql_num_rows($result);
	if ($num == 0) {
	$query1="SELECT * FROM vendors WHERE email = '$_POST(email)'"
	$result1=mysql_query($query2);	
	$num1=mysql_num_rows($result1)
	if ($num1 == 0) {
		if (($_POST['password']==$_POST['password1'])&&($_POST['email']==$_POST['email1']))
		{
		$name=strip_tags($_POST['username']);
		$first=strip_tags($_POST['firstname']);
		$last=strip_tags($_POST['lastname']);
		$pass=strip_tags($_POST['password']);
		$country=strip_tags($_POST['country']);
		$address=strip_tags($_POST['address']);
		$email=strip_tags($_POST['email']);
		$city=strip_tags($_POST['city']);
		$zip=strip_tags($_POST['zipcode']);
		$state=strip_tags($_POST['state']);
		$phone=strip_tags($_POST['phonenumber']);
		$aql="INSERT INTO vendors SET username='$name', firstname='$first', lastname='$last', email='$email', Country='$country', zipcode='$zip', password='$pass', city='$city', state='$state', phonenumber='$phone', address='$address'"
		$result=mysql_query($sql)
		if ($result){
		header(location:http://www.digitaldesignersmall.com/ffx.html)
		}
		else {
			header(location:http://www.digitaldesignersmall.com/fff.html)
			}

	}
	else(
	header(location:http://www.digitaldesingersmall.com/afx.html)
	}

		}
		else {
		Header(location:http://www.digitaldesingersmall.com/afx.html)
		}

		}
		else{
header("location:http://www.digitaldesignersmall.com/cxs.html")
}

}

else{

header("location:http://www.digitaldesignersmall.com/cxs.html")

}
}
else{
header("location:http://www.digitaldesignersmall.com/cxs.html")
}


?>

Link to comment
https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/
Share on other sites

wow you made so many errors ...

 

Line 8, 10, 11 the double quote was one character off the line ...

Line 12, 16, 18, 33, 34 fogot the ;

Line 36, 39, 44, 49 forgot to put the data inside a " and also forgot the ;

Line 43 you put a ( instead of a {

Line 54, 61, 66 forgot the ;

Line 68 forgot a }

 

I think you need some sleep lol

 

<?php
include('connection.php');

$test1=$_POST('firstname');
$test2=$_POST('lastname');
$test3=$_POST('username');

if (!eregi("([^A-Za-z0-9])",$test1)){

   if (!eregi("([^A-Za-z0-9])",$test2)){
      if (!eregi("([^A-Za-z0-9])",$test3)){
      $query="SELECT * FROM vendors WHERE username = '$_POST(username)'";
      $result=mysql_query($query);
      $num=mysql_num_rows($result);
      if ($num == 0) {
      $query1="SELECT * FROM vendors WHERE email = '$_POST(email)'";
      $result1=mysql_query($query2);   
      $num1=mysql_num_rows($result1);
      if ($num1 == 0) {
         if (($_POST['password']==$_POST['password1'])&&($_POST['email']==$_POST['email1']))
         {
         $name=strip_tags($_POST['username']);
         $first=strip_tags($_POST['firstname']);
         $last=strip_tags($_POST['lastname']);
         $pass=strip_tags($_POST['password']);
         $country=strip_tags($_POST['country']);
         $address=strip_tags($_POST['address']);
         $email=strip_tags($_POST['email']);
         $city=strip_tags($_POST['city']);
         $zip=strip_tags($_POST['zipcode']);
         $state=strip_tags($_POST['state']);
         $phone=strip_tags($_POST['phonenumber']);
         $aql="INSERT INTO vendors SET username='$name', firstname='$first', lastname='$last', email='$email', Country='$country', zipcode='$zip', password='$pass', city='$city', state='$state', phonenumber='$phone', address='$address'";
         $result=mysql_query($sql);
         if ($result){
         header("location:http://www.digitaldesignersmall.com/ffx.html");
         }
         else {
            header("location:http://www.digitaldesignersmall.com/fff.html");
            }
      
      }
      else{
      header("location:http://www.digitaldesingersmall.com/afx.html");
      }
         
         }
         else {
         header("location:http://www.digitaldesingersmall.com/afx.html");
         }

         }
         else{
header("location:http://www.digitaldesignersmall.com/cxs.html");
}

}

else{

header("location:http://www.digitaldesignersmall.com/cxs.html");

}
}
else{
header("location:http://www.digitaldesignersmall.com/cxs.html");
}
}

?>

Link to comment
https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/#findComment-1204589
Share on other sites

Ah yeah missed that part lol

Line 4, 5, 6, 12, 16 used () inseatd of [] for the $_POST

 

<?php
include('connection.php');

$test1=$_POST['firstname'];
$test2=$_POST['lastname'];
$test3=$_POST['username'];

if (!eregi("([^A-Za-z0-9])",$test1)){

   if (!eregi("([^A-Za-z0-9])",$test2)){
      if (!eregi("([^A-Za-z0-9])",$test3)){
      $query="SELECT * FROM vendors WHERE username = '".$_POST['username']."'";
      $result=mysql_query($query);
      $num=mysql_num_rows($result);
      if ($num == 0) {
      $query1="SELECT * FROM vendors WHERE email = '".$_POST['email']."'";
      $result1=mysql_query($query2);   
      $num1=mysql_num_rows($result1);
      if ($num1 == 0) {
         if (($_POST['password']==$_POST['password1'])&&($_POST['email']==$_POST['email1']))
         {
         $name=strip_tags($_POST['username']);
         $first=strip_tags($_POST['firstname']);
         $last=strip_tags($_POST['lastname']);
         $pass=strip_tags($_POST['password']);
         $country=strip_tags($_POST['country']);
         $address=strip_tags($_POST['address']);
         $email=strip_tags($_POST['email']);
         $city=strip_tags($_POST['city']);
         $zip=strip_tags($_POST['zipcode']);
         $state=strip_tags($_POST['state']);
         $phone=strip_tags($_POST['phonenumber']);
         $aql="INSERT INTO vendors SET username='$name', firstname='$first', lastname='$last', email='$email', Country='$country', zipcode='$zip', password='$pass', city='$city', state='$state', phonenumber='$phone', address='$address'";
         $result=mysql_query($sql);
         if ($result){
         header("location:http://www.digitaldesignersmall.com/ffx.html");
         }
         else {
            header("location:http://www.digitaldesignersmall.com/fff.html");
            }
      
      }
      else{
      header("location:http://www.digitaldesingersmall.com/afx.html");
      }
         
         }
         else {
         header("location:http://www.digitaldesingersmall.com/afx.html");
         }

         }
         else{
header("location:http://www.digitaldesignersmall.com/cxs.html");
}

}

else{

header("location:http://www.digitaldesignersmall.com/cxs.html");

}
}
else{
header("location:http://www.digitaldesignersmall.com/cxs.html");
}
}

?>

Link to comment
https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/#findComment-1204636
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.