Butler Posted April 21, 2011 Share Posted April 21, 2011 <?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") } ?> Quote Link to comment https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/ Share on other sites More sharing options...
Maq Posted April 21, 2011 Share Posted April 21, 2011 In the future, please use tags around your code. Quote Link to comment https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/#findComment-1204587 Share on other sites More sharing options...
drisate Posted April 21, 2011 Share Posted April 21, 2011 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"); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/#findComment-1204589 Share on other sites More sharing options...
Maq Posted April 21, 2011 Share Posted April 21, 2011 Quote Link to comment https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/#findComment-1204590 Share on other sites More sharing options...
Butler Posted April 21, 2011 Author Share Posted April 21, 2011 Thank you. I am very new to this and self taught. the only thing left is this error: Fatal error: Function name must be a string in /home/swirish/public_html/registernext.php on line 4 Quote Link to comment https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/#findComment-1204625 Share on other sites More sharing options...
Maq Posted April 21, 2011 Share Posted April 21, 2011 Thank you. I am very new to this and self taught. the only thing left is this error: Fatal error: Function name must be a string in /home/swirish/public_html/registernext.php on line 4 Can you post the relevant code for this error? Quote Link to comment https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/#findComment-1204626 Share on other sites More sharing options...
PFMaBiSmAd Posted April 21, 2011 Share Posted April 21, 2011 You have an extra $ in front of a function call, something like $var = $function_name(); It should be $var = function_name() Quote Link to comment https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/#findComment-1204628 Share on other sites More sharing options...
Maq Posted April 21, 2011 Share Posted April 21, 2011 Kind of what like Mabismad said, you are using POST as a function rather than an array. Change these to: $test1=$_POST['firstname']; Quote Link to comment https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/#findComment-1204632 Share on other sites More sharing options...
drisate Posted April 21, 2011 Share Posted April 21, 2011 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"); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/#findComment-1204636 Share on other sites More sharing options...
Butler Posted April 22, 2011 Author Share Posted April 22, 2011 the only issue i got now and i dont know if you can help with it is that the error pages dint show up when i purposely make the test fail. Quote Link to comment https://forums.phpfreaks.com/topic/234376-what-did-i-do-wrong/#findComment-1204702 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.