Jump to content


  • Posts

  • Joined

  • Last visited

Contact Methods

  • AIM
  • MSN
  • Website URL
  • ICQ
  • Yahoo

Profile Information

  • Location
  • Interests
    Programing <br />HTML<br />C#<br />C++<br />Movie Making<br />You Tube<br />Video game making <br />Flash mx <br />web desine<br />javascript <br />

mikemanx2's Achievements


Newbie (1/7)



  1. i got a friend that can help me now but when i added the error code it gose to a blank page ill have my friend help me now he runs an online game make with php so he can help me with the script problumes but thx for the help so far
  2. theres no error mesages its just not adding the info its conecting i added the table and it still dident work
  3. ok i tryed addin all the table and it still dident work
  4. hey i run the website mikemanx.com but ive been trying ever sens i made it to make people be abole to login and register im predy sher i got my login script right but when it comes to the register i have everything working right but it does not save the user into my database so you cant login because theres no user heres my login and register codelogin script login.php <?php// database connect script.require 'db_connect.php';if($logged_in == 1) { die('You are already logged in, '.$_SESSION['username'].'.');}?><html><head><title>Login</title></head><body><?phpif (isset($_POST['submit'])) { // if form has been submitted /* check they filled in what they were supposed to and authenticate */ if(!$_POST['uname'] | !$_POST['passwd']) { die('You did not fill in a required field.'); } // authenticate. if (!get_magic_quotes_gpc()) { $_POST['uname'] = addslashes($_POST['uname']); } $check = $db_object->query("SELECT username, password FROM users WHERE username = '".$_POST['uname']."'"); if (DB::isError($check) || $check->numRows() == 0) { die('That username does not exist in our database.'); } $info = $check->fetchRow(); // check passwords match $_POST['passwd'] = stripslashes($_POST['passwd']); $info['password'] = stripslashes($info['password']); $_POST['passwd'] = md5($_POST['passwd']); if ($_POST['passwd'] != $info['password']) { die('Incorrect password, please try again.'); } // if we get here username and password are correct, //register session variables and set last login time. $date = date('m d, Y'); $update_login = $db_object->query("UPDATE users SET last_login = '$date' WHERE username = '".$_POST['uname']."'"); $_POST['uname'] = stripslashes($_POST['uname']); $_SESSION['username'] = $_POST['uname']; $_SESSION['password'] = $_POST['passwd']; $db_object->disconnect();?><h1>Logged in</h1><p>Welcome back <?php echo $_SESSION['username']; ?>, you are logged in.</p><?php} else { // if form hasn't been submitted?><h1>Login</h1><form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"><table align="center" border="1" cellspacing="0" cellpadding="3"><tr><td>Username:</td><td><input type="text" name="uname" maxlength="40"></td></tr><tr><td>Password:</td><td><input type="password" name="passwd" maxlength="50"></td></tr><tr><td colspan="2" align="right"><input type="submit" name="submit" value="Login"></td></tr></table></form><?php}?></body></html> Heres my register, register.php <?phprequire('db_connect.php'); // database connect script.?><html><head><title>Register an Account</title></head><body><?phpif (isset($_POST['submit'])) { // if form has been submitted /* check they filled in what they supposed to, passwords matched, username isn't already taken, etc. */ if (!$_POST['uname'] | !$_POST['passwd'] | !$_POST['passwd_again'] | !$_POST['email']) { die('You did not fill in a required field.'); } // check if username exists in database. if (!get_magic_quotes_gpc()) { $_POST['uname'] = addslashes($_POST['uname']); } $name_check = $db_object->query("SELECT username FROM users WHERE username = '".$_POST['uname']."'"); if (DB::isError($name_check)) { die($name_check->getMessage()); } $name_checkk = $name_check->numRows(); if ($name_checkk != 0) { die('Sorry, the username: <strong>'.$_POST['uname'].'</strong> is already taken, please pick another one.'); } // check passwords match if ($_POST['passwd'] != $_POST['passwd_again']) { die('Passwords did not match.'); } // check e-mail format if (!preg_match("/.*@.*..*/", $_POST['email']) | preg_match("/(<|>)/", $_POST['email'])) { die('Invalid e-mail address.'); } // no HTML tags in username, website, location, password $_POST['uname'] = strip_tags($_POST['uname']); $_POST['passwd'] = strip_tags($_POST['passwd']); $_POST['website'] = strip_tags($_POST['website']); $_POST['location'] = strip_tags($_POST['location']); // check show_email data if ($_POST['show_email'] != 0 & $_POST['show_email'] != 1) { die('Nope'); } /* the rest of the information is optional, the only thing we need to check is if they submitted a website, and if so, check the format is ok. */ if ($_POST['website'] != '' & !preg_match("/^(http|ftp):///", $_POST['website'])) { $_POST['website'] = 'http://'.$_POST['website']; } // now we can add them to the database. // encrypt password $_POST['passwd'] = md5($_POST['passwd']); if (!get_magic_quotes_gpc()) { $_POST['passwd'] = addslashes($_POST['passwd']); $_POST['email'] = addslashes($_POST['email']); $_POST['website'] = addslashes($_POST['website']); $_POST['location'] = addslashes($_POST['location']); } $regdate = date('m d, Y'); $insert = "INSERT INTO users ( username, password, regdate, email, website, location, show_email, last_login) VALUES ( '".$_POST['uname']."', '".$_POST['passwd']."', '$regdate', '".$_POST['email']."', '".$_POST['website']."', '".$_POST['location']."', '".$_POST['show_email']."', 'Never')"; $add_member = $db_object->query($insert); if (DB::isError($add_member)) { die($add_member->getMessage()); } $db_object->disconnect();?><h1>Registered</h1><p>Thank you, your information has been added to the database, you may now <a href="login.php" title="Login">log in</a>.</p><?php} else { // if form hasn't been submitted?><h1>Register</h1><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"><table align="center" border="1" cellspacing="0" cellpadding="3"><tr><td>Username*:</td><td><input type="text" name="uname" maxlength="40"></td></tr><tr><td>Password*:</td><td><input type="password" name="passwd" maxlength="50"></td></tr><tr><td>Confirm Password*:</td><td><input type="password" name="passwd_again" maxlength="50"></td></tr><tr><td>E-Mail*:</td><td><input type="text" name="email" maxlength="100"></td></tr><tr><td>Website:</td><td><input type="text" name="website" maxlength="150"></td></tr><tr><td>Location</td><td><input type="text" name="location" maxlength="150"></td></tr><tr><td>Show E-Mail?</td><td><select name="show_email"><option value="1" selected="selected">Yes</option><option value="0">No</option></select></td></tr><tr><td colspan="2" align="right"><input type="submit" name="submit" value="Sign Up"></td></tr></table></form><?php}?></body></html> and heres my database conection db_connet.php <?php$db_engine = 'mysql';$db_user = '**********;$db_pass = '**********';$db_host = '**********';$db_name = '*********';$datasource = $db_engine.'://'. $db_user.':'. $db_pass.'@'. $db_host.'/'. $db_name;$db_object = DB::connect($datasource, TRUE);/* assign database object in $db_object, if the connection fails $db_object will containthe error message. */// If $db_object contains an error:// error and exit.if(DB::isError($db_object)) { die($db_object->getMessage());}$db_object->setFetchMode(DB_FETCHMODE_ASSOC);// we write this later on, ignore for now.include('check_login.php');?> Plz help ive been trying to do this for two years i would realy like to finish it soon plz help also i think this is the problume i dont have any tables in my data base i couldent figure out the sql code to put all the tables in...
  5. lol i just fond it in examples in the javascript section its this<html><body><script type="text/javascript">var r=Math.random()if (r>0.5) {document.write("<a href='http://www.w3schools.com'>Learn Web Development!</a>")}else{document.write("<a href='http://www.refsnesdata.no'>Visit Refsnes Data!</a>")}</script></body></html>
  6. ok and ya i no its not hard it takes like 5min to write i just like dident program js for like a year so i forgot most of it but i still remember my other lang.. Mikemanx.comthis is the site im desining so take a look i started it 5hours ago i did all the programming and all the images im working on the database stuff and login stuff right now but i just wanted to post it so i can get the code so i can move on in the java script standpointAll you kinda have to do is make a random array
  7. Are you just trying to do a list like http://w3schools.com/html/html_lists.aspHTML CODE<ul><li>Coffee</li><li>Milk</li></ul> Or if your trying to do it like a playlist maybe somthing like <ul><li><a href="SomeMovieTitle.wmv">Some Movie Title</li><li><a href="SomedifrentMovieTitle.wmv">Some difrent Movie Title</li></ul>
  8. hey im remaking my site i use to have this code but i lost it so can you gets help me with this...a random picture in js plz help
  9. or you can just do the Ctrl alt Print Screen buttons open up paint and do ctrl v
  10. right click on the file and click properties and see whare it says what file type or what it opens in and click change to like what ever program you want to use i like notepad but its your chose
  11. Hi, ok well i have 4 php scripts that i need help fixing ok the first one is my register.php with this one i need help puting in the part ware it says if a user alredy has that username it will say username alerdy taken but i dont know that part of the script.Register.php <?php// Define variables and connect to database$Account_Username = $_POST['Account_Username'];$Account_Password = $_POST['Account_Password'];$Account_PasswordConfirm = $_POST['Account_PasswordConfirm'];$Contact_FullName = $_POST['Contact_FullName'];$Contact_ZipCode = $_POST['Contact_ZipCode'];$Contact_Country = $_POST['Contact_Country'];$Contact_Email = $_POST['Contact_Email'];$Contact_URL = $_POST['Contact_URL'];// Connect to database$dbuser = "*****";$dbpass = "*****";$host = "*****";$db_connect = mysql_connect($host, $dbuser, $dbpass) or die("Could not connect to database");$select_db = mysql_select_db("******", $db_connect) or die("Could not select database");// Check values of First password and Second password to see if they are the same.if($Account_Password != $Account_PasswordConfirm) {echo "Your passwords do not match. <a href='java script: history.go(-1)'>Click Here</a> to go back.";die;}// Check values of First password and second password to see if they are nullif($Account_Password == '' || $Account_PasswordConfirm == '' || $Account_Username == '' || $Contact_FullName == '' || $Contact_Email == '') {echo "You must enter all *Required spaces. <a href='java script: history.go(-1)'>Click Here</a> to go back.";die;}// Encrypt the password with a hash.$encrypted_pass = md5($Account_Password);// Write and execute the query.$query = "INSERT into members (member_id,username,memberpass) VALUES ('','$Account_Username','$encrypted_pass')";$result = mysql_query($query) or die ("Could not execute query." . mysql_error());// Check if the result was successful.if($result) {echo "You registered successfully!<p><a href='memberlogin.php?PHPSESSID=b1491388a4ad30f954d8d92267706d9d'>Click Here</a> to login.";die;}?> The next one is my login.php ok when you try to login its a blank page like theres nothing on it thats thats the thing i need help to fix on that page.login.php <?php// Define variables and connect to database$Account_Username = $_POST['Account_Username'];$Account_Username = $_POST['Account_Username'];// Connect to database$dbuser = "****";$dbpass = "****";$host = "****";$db_connect = mysql_connect($host, $dbuser, $dbpass) or die("Could not connect to database");$select_db = mysql_select_db("******", $db_connect) or die("Could not select database");// Now to encrypt the password.$encrypted_pass = md5($pass);// Define the query:$query = "SELECT username, memberpass FROM members WHERE username='" . mysql_escape_string($Account_Username) .' AND memberpass='{$encrypted_pass}'";// Run the query and check if it worked.$result = mysql_query($query) or die("Could not execute query." . mysql_error());if (mysql_num_rows($result) > "0"){ session_start(); $_SESSION['Account_Username'] = $Account_Username; $_SESSION['pass'] = $encrypted_pass; if ($the_user_wants_to_be_logged_in_for_a_year) { setcookie("siteuser", $user, time() + (86400 * 365), "/", $_SERVER["HTTP_HOST"], 0); setcookie("sitepass", $encrypted_pass, time() + (86400 * 365), "/", $_SERVER["HTTP_HOST"], 0); } write_session();}else{ // bad login, send them back to the login page with an error header("Location: login.php?error=" . urlencode("Username or password incorect"); exit();}?> the next thing is my index.php ok on this page i want it to be ware the login part of the page if your logged in and theres a cookie it will say your logged in as "username"but it is also a blank page when you go to it index.php <html><head><STYLE TYPE="text/css"><!--FORM { margin-bottom : 0px; margin-top : 0px; }bodya { text-decoration: none; }a:link { color: #FF0000; }a:visited { color: #FF0000; }a:active { color: #FF0000; }a:hover { color: #FF0000; }body, div, td{ scrollbar-face-color: #000000; scrollbar-highlight-color: #FF0000; scrollbar-3dlight-color: #000000; scrollbar-darkshadow-color: #000000; scrollbar-shadow-color: #000000; scrollbar-arrow-color: #FF0000; scrollbar-track-color: #FF0000;}.font_contact{ font-family: Arial,Helvetica; font-size: 10px;}.font_vd_small{ font-family: Verdana,Arial,Helvetica; font-size: 10px;}.font_a2{ font-family: Arial,Helvetica; font-size: 13px;}a.header:link { color: #00FF00; }a.header:visited { color: #00FF00; }a.header:hover { color: #00FF00; }a.header:active { color: #00FF00; }.font_header{ font-family: Arial,Helvetica; font-size: 10px; font-weight: bold; letter-spacing: 1px;}.font_small_header{ font-family: Arial,Helvetica; font-size: 9px;}//--></STYLE><title>Mikemanx A Programers Dream</title></head><body bgcolor="#000000" text="#00FF00"><div align="center"> <center> <table border="1" width="948" height="4"> <tr> <td width="674" height="4"> <form action="--WEBBOT-SELF--" method="POST"> <p> Mikemanx.com Home Language: English</td> <td width="258" height="4"> Search For <b> </b> <input type="text" size="14" maxlength="256" name="searcht"> <input type="submit" value="Search"></td> </tr> </table> </center></div><div align="center"> <center> <table border="0" width="948" height="150"> <tr> <td width="698" height="146"><img border="0" src="logo.png" width="700" height="153"></td> <td width="230" height="146"> <h5 class="heading"> <?php if(ISSET("siteuser")) {?> You are Loggedin as <a href="userpage.php"><?php echo $_POST["siteuser"]; ?></a><?php }else {echo "<font color="#FF0000">Member Login</font></h5> <form action="memberlogin.php" method="post"> <div class="row"> <label for="user">Username:</label> <input type="text" name="user"><br/> </div> <div class="row"> <label for="password">Password:</label> <input type="password" name="pass"><br/> </div> <div align="center"> <input type="submit" value="Login" alt="Log In"> </div> <div align="center"> <font color="#FF0000"> <a id="ctl00_Main_SplashDisplay1_login1_HyperLink1" href="register.html">Register A New User</a><br> <a href="http://www.mikemanx.com/passforget.html">Forgot your password?</a> </font> </div> </form>";die;}?> </td> </tr> </table> </center></div><div align="center"> <center> <table border="1" width="948" height="265"> <tr> <td width="151" height="253"><img border="0" src="Navbar.png" width="151" height="46"> <font size="3"><a href="index.html">Home</a><br> <a href="programpics.php"> Programming Photos</a> <a href="register.html">Register</a><br> <a href="download.html"> Downloads</a><br> <a href="submittut.php"> Submit Tutorial</a><br> <a href="userlookup.php"> All Users</a><br> <a href="walloffame.php"> Wall Of Fame</a><br> <a href="programmissions.php"> Programming Missions</a><br> <a href="http://www.mikemanx.com/fourm"> Forums</a><br> <a href="subbug.php"> Submit Bug </a><br> <a href="help.php"> Help</a></font> <p><img border="0" src="Navtutbar.png" width="150" height="35"></p> <p><font size="3"><u><a href="c++.php">Tutorial</a></u> <a href="c++.php"> C++</a><br> <u><a href="html.php">Tutorial</a></u> <a href="html.php"> Html</a><br> <u><a href="php.php">Tutorial</a></u> <a href="php.php"> Php</a><br> <u><a href="sql.php">Tutorial</a></u> <a href="sql.php"> Sql</a><br> <u><a href="java.php">Tutorial</a></u> <a href="java.php"> Java</a><br> <u><a href="javascript.php">Tutorial</a></u> <a href="javascript.php"> Javascript</a><br> </font><br> <a href ="Http://www.hackthissite.org"><img border="0" src="hacksitelogo.gif" width="151" height="34"></a> </p> </td> <td width="778" height="265"> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </td> </tr> </table> </center></div></body></html> and the last thing i need help with is my c++w.php ok im trying to make a thing ware you can submit a tutorail but when you click submit the the submition page it goos to this page and its blank we need to fix that and i want it ware it dusent stop on that page it redirecs to the page it is supost to write the tutoail on.C++w.php <?php$name = $_POST['name'];$text = $_POST['text'];$file = "c++.php";$f = fopen($file, 'a');$write = fwrite($f, $name "<p>" . $text . "<hr>");header("location: c++.php");?> I hope you guys will plz help me with my problomes thxs
  12. They say they wont take php files
  13. ok ill fix those errors but do i just send my file to that page and they will go through and fix all the errorsWhat dose it meen by mark up
  • Create New...