Jump to content

dean012

Members
  • Posts

    86
  • Joined

  • Last visited

dean012's Achievements

Member

Member (2/5)

0

Reputation

  1. Notice: Undefined variable: con in F:\xampp\htdocs\l.php on line 223 Warning: mysql_close() expects parameter 1 to be resource, null given in F:\xampp\htdocs\l.php on line 223 <?php ini_set('session.use_only_cookies',1); session_start(); ?> <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.googlea...=Oswald:400,300' rel='stylesheet' type='text/css'> <link href='http://fonts.googlea...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="homepage.php">Homepage</a></li> <li><a href="trip.php">Destinations</a></li> <li><a href="contact.php">contact </a></li> <li><a href="login1.php">Login</a></li> <li><a href="adminlogin.php">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"> <!--Introduction Paragraph--> <?php $host = "localhost"; $user = "root"; $pass = ""; $db = "kayaks_club"; // VALUES ('$_POST[User_ID]', '".$trip_ID."', $_POST[surname]', '".$trip."', '".$difficulty."', '".$when."', '".$cost."')"; $name = $_POST['firstname']. ' '. $_POST['surname']; $firstname = $_POST['firstname']; $surname = $_POST ['surname']; $age = $_POST['age']; //$gender = $_POST['gender']; $number = $_POST['number']; $email = $_POST['email']; $password = $_POST['password']; $confirmpassword = $_POST['confirmpassword']; //Setting up an array of all the possible errors $errors = array();{ //If inputed varaible is NOT empty then assign it a value EMAIL if(!empty($_POST)) { $email = $_POST['email']; //If inputed varaible IS empty then, then a FIRSTNAME needs to be entered if (empty($_POST['firstname']) or is_numeric($_POST['firstname'])){ $errors [] = 'Please enter a valid Firstname.'; } //Otherwise if Firstname is longer than 25 "name is too long" elseif(strlen($_POST['firstname']) > 25) { $errors[] = "Name is too long"; } //If a value has been inputed and is less than 25 characters then assign it to FIRSTNAME else{ $firstname = $_POST['firstname']; } //If inputed varaible is NOT empty then assign it a value SURNAME if (!empty($_POST['surname']) and !is_numeric($_POST['surname'])){ $surname = $_POST['surname']; } //Othwrwise if it is empty, then "A surname must be entered" else{ $errors [] = 'Please Enter a valid Surname.'; } //If inputed varaible is NOT empty and is a number then assign it a value AGE if (!empty($_POST['age']) and is_numeric($_POST['age'])) { $age = $_POST['age']; } //Othwrwise if it is empty, then "A valid age must be entered" else{ $errors [] = 'Please Enter a valid age.'; } //If inputed varaible is NOT empty then assign it a value GENDER if (!empty($_POST['gender'])){ $gender = $_POST['gender']; } //Othwrwise if it is empty, then "A Gender must be selected" else{ $errors [] = 'Please Select a Gender.'; } //If inputed varaible is NOT empty and is a number then assign it a value NUMBER if (!empty($_POST['number']) and is_numeric($_POST['number'])) { $number = $_POST['number']; } //Othwrwise if it is empty, then "A valid age must be entered" else{ $errors [] = 'Please Enter a valid Telephone Number.'; } //If inputed varaible is NOT empty then assign it a value PASSWORD if (!empty($_POST['password']) and ($_POST['password']) == ($_POST['confirmpassword'])) { $pasword = $_POST['password']; } //Othwrwise if it is empty or dont match, then "A valid password must be entered and must match" else{ $errors [] = 'A valid password must be entered and both fields must match.'; } //To check if the email entered is a valid email address if(filter_var($email, FILTER_VALIDATE_EMAIL) === false) { $errors[] = "Please enter a valid email address."; } if(!empty($errors)){ print_r($errors); echo " Click your Browser back button to go back."; } else{ //Connect to database server $con=mysqli_connect('localhost','root','','kayaks_club'); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } //Which Table and cell to insert the new information $sql= "INSERT INTO users (firstname, surname, age, gender, number, email, password) VALUES ('$_POST[firstname]', '$_POST[surname]', '$_POST[age]', '$_POST[gender]', '$_POST[number]', '$_POST[email]', '$_POST[password]')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } //mysqli_close($con); echo '<h1> Registration succecfull!</h1><br/><br/>'; echo 'Hello '. $name . '. Thank you for Registering With Canoe & Kayak Club.<br />'; echo 'You can now log in to view to find out the trip information.<br/>'; $query = "SELECT * FROM `users` WHERE `Surname` LIKE 'King' LIMIT 0 , 30"; /*SELECT * FROM `kayaks_club`.`users` WHERE ( CONVERT( `User_ID` USING utf8 ) LIKE '".$surname."' OR CONVERT( `Trip_ID` USING utf8 ) LIKE '".$surname."' OR CONVERT( `Surname` USING utf8 ) LIKE '".$surname."' OR CONVERT( `Trip` USING utf8 ) LIKE '".$surname."' OR CONVERT( `Difficulty` USING utf8 ) LIKE '".$surname."' OR CONVERT( `When` USING utf8 ) LIKE '".$surname."' ) LIMIT 0 , 30*/ //Result = the query $result = mysql_query($query) or die (mysql_error()); if(!mysql_affected_rows() >= 1) { echo 'You Have not signed up for any trips. Please go to the "Join A Trip" page under the "Home" tab '; } while($row = mysqli_fetch_array($result)) { //Display this in a table echo '<tr>'; echo '<td>'. $row['User_ID'].'</td>'; echo '<td>'. $row['Firstname'].'</td>'; echo '<td>'. $row['Surname'].'</td>'; echo '<td>'. $row['Age'].'</td>'; echo '<td>'. $row['Password'].'</td>'; '</centre>'; } echo '</table>'; } } } mysql_close($con); ?> </div> <div id ="footer"> <a href="Admin_Index.html"><br/>The Wellington Canoe & Kayak</a><br/>PO Box 23456<br/>Wellington<br/>Telephone:04 4776911<br/>Email: wellington@canoeandkayak.co.nz<br/> </div> </div> </div> </body> </html>
  2. Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in F:\xampp\htdocs\s.php on line 105 <!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 name = "description" content = "Admin Log In Section"/> <meta name = "keywords" content = "Admin, Log In, Canoe & Kayak, Hidden Section"/> <title> Admin Log In </title> <link rel = "stylesheet" type = "text/css" href = "Style.css"/> </head> <body> <div id = "wrapper"> <div id = "container"> <div id = "banner"> <h1><center> <a href="Index.html"><img src="Images/CanoeAndKayakLogo.png" width="215" height="75" alt="Canoe & Kayak Logo" /></a> Wellington Canoe & Kayak - Discover Our World! <a href="Index.html"><img src="Images/CanoeAndKayakLogo.png" width="215" height="75" alt="Canoe & Kayak Logo" /><br></a> <div id="menu"> <!--Home Drop Down--> <ul> <li><a href="Index.html"> Home </a> <ul> <li><a href="Sign_Up.html"> Sign Up</a></li> <li><a href="Log_In.php"> Log In</a></li> <li><a href="Log_Out.php"> Log Out</a></li> </ul><!--closure of inner Ul tag--> </li><!--Closing the main li tag--> </ul><!--End of ul tag--> <!--Trips Drop Down--> <ul> <li><a href="Trips.html"> Trips </a> <ul> <li><a href="Abel_Tasman.html"> Abel Tasman</a></li> <li><a href="Fiordland.html"> Fiordland</a></li> <li><a href="Marlborough.html"> Marlborough</a></li> <li><a href="Nelson_Lakes.html"> Nelson Lakes</a></li> <li><a href="Solomons.html"> Solomons</a></li> <li><a href="Taupo.html"> Taupo</a></li> <li><a href="Whanganui.html"> Whanganui</a></li> </ul><!--closure of inner Ul tag--> </li><!--Closing the main li tag--> </ul><!--End of ul tag--> <!--others Drop Down--> <ul> <li><a href="Others.html"> Others </a> <ul> <li><a href="Contact_Us.html"> Contact Us</a></li> <li><a href="Photos.html"> Photos</a></li> </ul><!--closure of inner Ul tag--> </li><!--Closing the main li tag--> </ul><!--End of ul tag--> </div><!--End of main Menu--> </center></h1> </div> <div id = "left"> </div> <div id = "right"> <br/> <!--Contents header--> <h2>Admin Log In</h2> <!--Introduction Paragraph--> <p> <form action="Admin_Log_In.php" method="POST"> <table border="0.1"> <tr> <td><label for="email">Email Address:</label></td> <td><input type="text" id="email" name="email"/> <br/> </td> </tr> <tr> <td> <label for="password">Password:</label> </td> <td> <input type="password" id="password:" name="password"/> <br/> </tr> </tr> </table> <input type="submit" value="Log In" name="LogIn" /> </form> <!--PHP Coding Begins here--> <?php //defining Varables $host = "localhost"; $user = "root"; $pass = ""; $db = "kayaks_club"; $admin = "wellington@canoeandkayak.co.nz"; mysql_connect ($host, $user, $pass); mysql_select_db ($db); //Checking to see if the user has inputed any information if(isset ($_POST['email'])) { $email = $_POST['email']; $password = $_POST['password']; $sql = "SELECT * FROM users WHERE email = '".$email."' AND password = '".$password."' LIMIT 1 "; $res = mysql_query ($sql); if ((mysql_num_rows($res) == 1) and ($email == $admin)) { header ("Location: Admin_Index.html"); exit(); } else { echo 'Sorry you do not have access to this part of the site. Please use the general "Log In" under the "Home" Tab.'; exit(); } } ?> </div> <div id ="footer"> <a href="Admin_Log_In.php"><br/>The Wellington Canoe & Kayak</a><br/>PO Box 23456<br/>Wellington<br/>Telephone:04 4776911<br/>Email: wellington@canoeandkayak.co.nz<br/> </div> </div> </div> </body> </html>
  3. Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in F:\xampp\htdocs\contact.php on line 91 Thank you for your message
  4. Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in F:\xampp\htdocs\contact.php on line 91 Thank you for your message
  5. Deprecated: Function session_register() is deprecated in F:\xampp\htdocs\login33.php on line 67 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR...l1-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.googlea...=Oswald:400,300' rel='stylesheet' type='text/css'> <link href='http://fonts.googlea...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="homepage.php">Homepage</a></li> <li><a href="trip.php">Destinations</a></li> <li><a href="contact.php">contact </a></li> <li><a href="registration.php">Login</a></li> <li><a href="adminlogin.php">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 Admin</a></h2> <form action="" method="post"> <table align="center" style="cellpadding: 10px; cellspacing: 10px;"> <tr><td>username:</td> <td><input type="text" name="username"/></td></tr> <tr><td>password:</td> <td><input type="password" name="password"/></td></tr> <tr><td> </td><td><input type="submit" name="submit"/></td></tr> </table> </form> </body> </html> <div class="entry"> </div> </div> </div> <?php session_start() ; if (!session_register('pass')){ ; } $username=$_POST['username']; $password=$_POST['password']; ?> <?php if ($username==('admin') && $password==('123') ) { $SESSION['username']; $SESSION['password']; header('location:login33.php'); } else echo 'something went wrong! Try again. Thanks.' ; ?> </body> </html>
  6. Fatal error: Call to undefined function dean-ueki@hotmail.com() in F:\xampp\htdocs\contact.php on line 87
  7. Fatal error: Call to undefined function deanong96@gmail.com() in F:\xampp\htdocs\contact.php on line 87
  8. when i hit submit it wont echo Thank you for your message <!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="homepage.php">Homepage</a></li> <li><a href="trip.php">Destinations</a></li> <li><a href="contact.php">contact </a></li> <li><a href="registration.php">Login</a></li> <li><a href="adminlogin.php">Leader</a></li> <li></li> <li></li> </ul> </div> </div> <blockquote> <blockquote> <p> <center><img src="../../Documents/Unnamed Site 2/IMG_1913.jpg" width="999" height="388" alt=""/></center> </p> </blockquote> </blockquote> <div id="page"> <div class="post"> <h2 class="title"><a href="#">Contact US</a></h2> <div class="entry"> <table border='1'> </div> <table width="400" border="0" acellpadding="3" cellspacing="1"> <tr> <td><strong>Contact Form </strong></td> </tr> </table> </body> </html> <?php if (isset($_POST['submit'])){ $name = $_POST['name']; $mail = $_POST['email']; $message = $_POST['message']; $to = "dean-ueki@hotmail.com"; $subject = "New Contact us form"; $message = "A new message has been sent by $mail \n Their message was $message \n \n Their Details: \n Name: $name \n Email: $mail From:email@email.com\r\n\n"; if ($name) { if($mail) { if ($message){ $mail ($to, $subject, $message); echo "Thank you for your message"; } else { echo "Please enter some comments"; } } else { echo "Please enter an email address"; } } else { echo "Please enter your name"; } } else { //Form Built by TPGS ?> <form action="contact.php" method="post"> Name: <input type="text" name="name" /><br /><br /> Email: <input type="text" name="email" /><br /><br /> Message: <textarea name="message" rows="20" cols="40"></textarea><br /><br /> <input type="submit" name="submit" value="Submit" /> </form> <?php } ?>
  9. still nt working <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR...l1-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.googlea...=Oswald:400,300' rel='stylesheet' type='text/css'> <link href='http://fonts.googlea...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="homepage.php">Homepage</a></li> <li><a href="trip.php">Destinations</a></li> <li><a href="contact.php">contact </a></li> <li><a href="registration.php">Login</a></li> <li><a href="adminlogin.php">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 Admin</a></h2> <form action="adminlogin.php" method="post"> <table align="center" style="cellpadding: 10px; cellspacing: 10px;"> <tr><td>username:</td> <td><input type="text" name="username"/></td></tr> <tr><td>password:</td> <td><input type="password" name="password"/></td></tr> <tr><td> </td><td><input type="submit" name="submit"/></td></tr> </table> </form> </body> </html> <div class="entry"> </div> </div> </div> <?php session_start() ; if (!session_is_registered('pass')){ header('location:adminlogin.php'); } $username=$_POST['username']; $password=$_POST['password']; if ($username==('admin') && $password==('123') ) { $session_register['username']; $session_register['password']; } else echo 'something went wrong! Try again. Thanks.' ; ?> </body> </html>
  10. <!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="homepage.php">Homepage</a></li> <li><a href="trip.php">Destinations</a></li> <li><a href="contact.php">contact </a></li> <li><a href="registration.php">Login</a></li> <li><a href="adminlogin.php">Leader</a></li> <li></li> <li></li> </ul> </div> </div> <blockquote> <blockquote> <p> <center><img src="../../Documents/Unnamed Site 2/IMG_1913.jpg" width="999" height="388" alt=""/></center> </p> </blockquote> </blockquote> <div id="page"> <div class="post"> <h2 class="title"><a href="#">Contact US</a></h2> <div class="entry"> <table border='1'> </div> <table width="400" border="0" acellpadding="3" cellspacing="1"> <tr> <td><strong>Contact Form </strong></td> </tr> </table> </body> </html> <?php if (isset($_POST['submit'])){ $name = $_POST['name']; $mail = $_POST['email']; $message = $_POST['message']; $to = "dean-ueki@hotmail.com"; $subject = "New Contact us form"; $message = "A new message has been sent by $mail \n Their message was $message \n \n Their Details: \n Name: $name \n Email $mail \n"; if ($name) { if($mail) { if ($message){ mail ($to, $subject, $message); echo "Thank you for your message"; } else { echo "Please enter some comments"; } } else { echo "Please enter an email address"; } } else { echo "Please enter your name"; } } else { //Form Built by TPGS ?> <form action="contact.php" method="post"> Name: <input type="text" name="name" /><br /><br /> Email: <input type="text" name="email" /><br /><br /> Message: <textarea name="message" rows="20" cols="40"></textarea><br /><br /> <input type="submit" name="submit" value="Submit" /> </form> <?php } ?>
×
×
  • 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.