
dean012
Members-
Posts
86 -
Joined
-
Last visited
Everything posted by dean012
-
<form action ="trip1.php" method="post"> <p><input type="checkbox" name="agree" /> Auckland</p> <form action ="trip.php" method="post"> <p><input type="checkbox" name="agree" /> North Shore</p> <p><input type="checkbox" name="agree" /> Waikato</p> <p><input type="checkbox" name="agree" /> Taranaki</p> <p><input type="checkbox" name="agree" /> Toupo</p> <p><input type="checkbox" name="agree" /> Wellington/p> <p><input type="checkbox" name="agree" /> Bay of Plenty</p> <p><input type="checkbox" name="agree" /> Manukau</p> <p><input type="submit" value="submit" /></p> </div> i put different action but when i hit submit it still bring me to the same page
-
still got the same message
-
i tried to put in <body><html> it still display the same thing
-
when i open this in chrome/browser it cam out this at the bottom alert('Please enter your Username')"; exit(); } if($users_pass==''){ echo ""; exit(); } if($users_email==''){ echo ""; exit(); } $check_email="select*from users where users_email='$users_email'"; $run = mysql_query($check_email) or die(mysql_error()); if(mysql_num_rows($run)>0){ echo""; exit(); } $query = "insert into users (users_name,users_pass,users_email) values(' $users_name','$users_pass','$users_email')"; { $result = mysql_query($query) or die(mysql_error()); } echo""; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Yakity Yak</title> <link href='http://fonts.googleapis.com/css?family=Oswald:400,300' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Abel|Satisfy' rel='stylesheet' type='text/css'> <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <p><!-- end #header --></p> <div id="header" class="container"> <div id="logo"> <h1><a href="#">Yakity Yak</a></h1> </div> <div id="menu"> <ul> <li class="current_page_item"><a href="file:///D:/blackpolish/index.html">Homepage</a></li> <li><a href="file:///D:/blackpolish/trip.html">Destinations</a></li> <li><a href="file:///D:/blackpolish/Contact.html">contact </a></li> <li><a href="file:///D:/blackpolish/login.html">Login</a></li> <li><a href="#">Leader</a></li> <li></li> <li></li> </ul> </div> </div> <blockquote> <blockquote> <p> <center><img src="sd.jpg" width="999" height="300" alt=""/></center> </p> </blockquote> </blockquote> <div id="page"> <div class="post"> <h2 class="title"><a href="#">Welcome to Yakity yak club</a></h2> <form method='post' action='login.php'> <table width='400' border='5' align='CENTER'> <tr> <td><h1>Login</h1></td> </tr> <tr> <td>User Name:</td> <td><input type='text' name='name'/></td> </tr> <tr> <td>Password:</td> <td><input type='password' name='pass'/></td> </tr> <tr> <td>Email:</td> <td><input type='text' name='email'/></td> </tr> <tr> <td><input type='submit' name='login' value='login'/></td> </tr> </table> </form> </body> </html> <div class="entry"> </div> </div> </div> </body> </html> <?php $connect=mysql_connect("localhost","root",""); $db_selected = mysql_select_db("users_db", $connect); if(isset($_POST['submit'])){ $users_name = $_POST['name']; $users_pass = $_POST['pass']; $users_email = $_POST['email']; if($users_name==''){ echo "<script>alert('Please enter your Username')</script>"; exit(); } if($users_pass==''){ echo "<script>alert('Please enter your password')</script>"; exit(); } if($users_email==''){ echo "<script>alert('Please enter your email')</script>"; exit(); } $check_email="select*from users where users_email='$users_email'"; $run = mysql_query($check_email) or die(mysql_error()); if(mysql_num_rows($run)>0){ echo"<script>alert('Email $users_email is already exist in our databse, please try another one')</script>"; exit(); } $query = "insert into users (users_name,users_pass,users_email) values(' $users_name','$users_pass','$users_email')"; { $result = mysql_query($query) or die(mysql_error()); } echo"<script>alert window.open('','_self')</script>"; } ?>
-
Warning: mysqli_query() expects at least 2 parameters, 1 given in G:\xampp\htdocs\Registration\registration.php on line 64 Warning: mysql_num_rows() expects parameter 1 to be resource, null given in G:\xampp\htdocs\Registration\registration.php on line 66
-
I see.. Thank you very much. I will try it out
-
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\registration\registration.php on line 66
-
What do you mean correct? I got error on line 66 abt the parameter
-
error on line 66 <html> <head> <title>Registration Form</title> </head> <body> <form method='post' action='registration.php'> <table width='400' border='5' align='center'> <tr> <td><h1>Registration Form</h1></td> </tr> <tr> <td>User Name:</td> <td><input type='text' name='name'/></td> </tr> <tr> <td>Password:</td> <td><input type='password' name='pass'/></td> </tr> <tr> <td>Email:</td> <td><input type='text' name='email'/></td> </tr> <tr> <td><input type='submit' name='submit' value='Sign Up'/></td> </tr> </table> </form> </body> </html> <?php mysql_connect("localhost","root",""); mysql_select_db("user_db"); if(isset($_POST['submit'])){ $user_name = $_POST['name']; $user_pass = $_POST['pass']; $user_email = $_POST['email']; if($user_name==''){ echo "<script>alert('Please enter your Username')</script>"; exit(); } if($user_pass==''){ echo "<script>alert('Please enter your password')</script>"; exit(); } if($user_email==''){ echo "<script>alert('Please enter your email')</script>"; exit(); } $check_email="select *select* from users where user_email='$user_email'"; $run = mysql_query($check_email); if(mysql_num_rows($run)>0){ echo"<script>alert('Email $user_email is already exist in our databse, please try another one')</script>"; exit(); } $query = "insert into users (user_name,user_pass,user_email) values(' $user_name','$user_pass','$user_email')"; if(mysql_query($query)){ echo "<script>alert('Registration Successfull!')</script>"; } } ?>
-
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in E:\xampp\htdocs\signup.php on line 2 Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in E:\xampp\htdocs\signup.php on line 3 FailedNo database selected <?php $conn= mysql_connect("localhost","root","login"); $db = mysql_select_db("login",$conn); ?> <?php $user =$_POST['n']; $pass =$_POST['p']; $id =$_POST['id']; $sql = "INSERT into phplogin values (".$id.",'".$user."','".$pass."')"; $qury = mysql_query($sql); #INSERT into phplogin values ( #1, #'satish', #'satish'); if(!$qury) echo "Failed". mysql_error(); else echo "successful"; ?>
-
1. Set up a website to display proverbs for people who might be in need of encouragement or wise words. Think about the colours (representing happiness, prosperity, goodness and love etc). Think about an image (lots of cultures – but don’t spend time creating one at this stage). 2. Create a log in for your friends only (later on they will be able to add proverbs). If you wish use the same password and whisper it to them. This is to enable your friends (whom you should trust) to add to your proverb database whilst protecting your database from outsiders (whom you should distrust). 3. Use provided data files (proverbs and countries) to set up a database. There are a few ; errors which should be corrected so it will not insert correctly into the database. NOTE: poor basic design eg Scottish listed many times … don’t worry about correcting this … 62 000 entries would take forever! 4. Test that your database is working by creating queries such as: (1) view proverbs from a particular country. (2) randomise the proverbs from a particular country but print a limited number eg 1 or 10. SELECT proverb FROM proverbs WHERE origin = “Scottish” ORDER BY RAND() LIMIT 10; (3) proverbs about money, love etc. 5. Connect the database, re-run the queries to check everything is working. 6. Add two Maori proverbs and delete a proverb. Test by re-running your queries. 7. Ask two of your select group to sign in and add a proverb. 8. Comment your code.1. Set up a website to display proverbs for people who might be in need of encouragement or wise words. Think about the colours (representing happiness, prosperity, goodness and love etc). Think about an image (lots of cultures – but don’t spend time creating one at this stage). 2. Create a log in for your friends only (later on they will be able to add proverbs). If you wish use the same password and whisper it to them. This is to enable your friends (whom you should trust) to add to your proverb database whilst protecting your database from outsiders (whom you should distrust). 3. Use provided data files (proverbs and countries) to set up a database. There are a few ; errors which should be corrected so it will not insert correctly into the database. NOTE: poor basic design eg Scottish listed many times … don’t worry about correcting this … 62 000 entries would take forever! 4. Test that your database is working by creating queries such as: (1) view proverbs from a particular country. (2) randomise the proverbs from a particular country but print a limited number eg 1 or 10. SELECT proverb FROM proverbs WHERE origin = “Scottish” ORDER BY RAND() LIMIT 10; (3) proverbs about money, love etc. 5. Connect the database, re-run the queries to check everything is working. 6. Add two Maori proverbs and delete a proverb. Test by re-running your queries. 7. Ask two of your select group to sign in and add a proverb. 8. Comment your code. im stuck from number 2