Jump to content

mikemanx2

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by mikemanx2

  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
  14. Thx for all the help guys im still trying to get that to work but i have a friend that i can see if he can help me but thx guys you really helped but i have one more thing im trying to put this pice of php into my frount page i have it as a .php but it shows up as a blank page can you look anhd see whats wrong with it. <html><body bgcolor="#333333"><title>Mikemanx.com-A Flash Fantasy</title><STYLE TYPE="text/css"><!--FORM { margin-bottom : 0px; margin-top : 0px; }body{ background-color: #2F3238; color: #C2C7CB; background-image: url(/images2006/bg_gradient.gif); background-repeat: repeat-x; margin-top: 0px; margin-left: 0px; margin: 0px;}a { text-decoration: none; }a:link { color: #FFAB0D; }a:visited { color: #B47101; }a:active { color: #FFAB0D; }a:hover { color: #FFEE70; }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;}.global_field{ font-family: Arial; color: #000000; font-size: 11px; font-weight: bold; background-color: #FFCC00; background-image: url('/layout04/newhf/tf_bg_sm.gif'); border-left: #000000 2px solid; border-top: #000000 2px solid; border-right: #45494F 1px solid; border-bottom: #45494F 1px solid;}.global_field_sm{ font-family: Arial; color: #000000; font-size: 10px; background-color: #FFCC00; background-image: url('/layout04/newhf/tf_bg_sm.gif'); border-left: #000000 2px solid; border-top: #000000 2px solid; border-right: #45494F 1px solid; border-bottom: #45494F 1px solid;}.button_normal{ font-family: Arial; color: #FFCC00; font-size: 11px; font-weight: bold; background-color: #41464E; border-left: #20252A 1px solid; border-top: #20252A 1px solid; border-right: #5F656B 1px solid; border-bottom: #5F656B 1px solid;}.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: #ffcc00; }a.header:visited { color: #ffcc00; }a.header:hover { color: #ffffff; }a.header:active { color: #ffab0d; }.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><table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="black"> <tr> <td width="771"> <a href="index.html" onmouseover="RollOver('nav_b1');window.status='';return true;" onmouseout="RollOut('nav_b1');window.status='';return true;"><img src="logo.png" width="770" height="130" alt="MikeManx.com" name="nav_b1" border="0"></a></td> </tr> <tr> <td> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td><a href="Flash.html" onmouseover="RollOver('nav_b1');window.status='';return true;" onmouseout="RollOut('nav_b1');window.status='';return true;"><img src="flash.png" width="138" height="42" alt="Flash Movies" name="nav_b1" border="0"></a></td> <td><a href="tutorail.php" onmouseover="RollOver('nav_b2');window.status='';return true;" onmouseout="RollOut('nav_b2');window.status='';return true;"><img src="fourms.png" width="127" height="42" alt="Forums" name="nav_b2" border="0"></a></td> <td><a href="videos.html" onmouseover="RollOver('nav_b3');window.status='Games';return true;" onmouseout="RollOut('nav_b3');window.status='';return true;"><img src="video.png" width="74" height="42" alt="Videos" name="nav_b3" border="0"></a></td> <td><a href="games.html"><img src="game.png" alt="Games" name="nav_b4" width="68" height="42" border="0"></a></td> <td><a href="downloads.html" onmouseover="RollOver('nav_b5');window.status='';return true;" onmouseout="RollOut('nav_b5');window.status='';return true;"><img src="download.png" width="121" height="42" alt="Downloads" name="nav_b5" border="0"></a></td> <td><a href="mailto:mikemanx2@hotmail.com"><img src="email.png" width="73" height="42" alt="Email Me" name="nav_b6" border="0"></a></td> <td><a href="login.html"><img src="tutorial.png" alt="Tutorials" name="nav_b8" width="83" height="42" border="0"></a></td> <td><a href="Submit.html"><img src="submit.png" alt="Submit" name="nav_b8" width="86" height="42" border="0"></a></td> </tr> </table> </td> </tr> <tr> <td background="bg_full.gif" align="center"> <!---------- END GLOBAL HEADER ----------><table width="770" border="0" align="" cellpadding="0" cellspacing="0" bgcolor="#000000"> <td width="10" background="/layout04/main_side_1.gif" valign="top"></td> <!-- Left Hand Side --> <td background="" width="771" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="220" align="left"> <font color="red"> <div align="center"><div align="top"><OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://active.macromedia.com/flash2/cab5/swflash.cab#version=2,1,0,12" HEIGHT=300 WIDTH=300 ID="Shockwave5"> <PARAM NAME="Movie" VALUE="flashadd.swf"> <PARAM NAME="Quality" VALUE="High"> <PARAM NAME="Loop" VALUE="1"> <PARAM NAME="Play" VALUE="1"> <PARAM NAME="Scale" VALUE="ShowAll"> <PARAM NAME="SAlign" VALUE="L"> <EMBED ID="Shockwave5" SRC="flashadd.swf" HEIGHT=300 WIDTH=300 PALETTE=BACKGROUND Quality=High Loop=true Play=TRUE Scale=ShowAll SAlign=L PLUGINSPAGE="http://www.macromedia.com/shockwave/download/"></OBJECT> <OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://active.macromedia.com/flash2/cab5/swflash.cab#version=2,1,0,12" HEIGHT=50 WIDTH=300 ID="Shockwave5"> <PARAM NAME="Movie" VALUE="musiccontrol.swf"> <PARAM NAME="Quality" VALUE="High"> <PARAM NAME="Loop" VALUE="1"> <PARAM NAME="Play" VALUE="1"> <PARAM NAME="Scale" VALUE="ShowAll"> <PARAM NAME="SAlign" VALUE="L"> <EMBED ID="Shockwave5" SRC="musiccontrol.swf" HEIGHT=50 WIDTH=300 PALETTE=BACKGROUND Quality=High Loop=true Play=TRUE Scale=ShowAll SAlign=L PLUGINSPAGE="http://www.macromedia.com/shockwave/download/"></OBJECT> <?php if(ISSET($_COOKIE['siteuser'])) {echo " You are signed in as $user "} else { echo "<h5 class="heading">Member Login</h5> <form action="memberlogin.php" method="post"> <div class="row"> <label for="email">Username:</label> <input type="text" name="user"><br/> </div> <div class="row"> <label for="password">Password:</label> <input type="password" name="pass"><br/> </div> <br /> <div align="center"> <input type="submit" value="Login" alt="Log In"> <a id="ctl00_Main_SplashDisplay1_login1_HyperLink1" href="signup.html"><img src="signup.png" style="border-width:0px;" /></a><br /> <a href="http://www.mikemanx.com/passforget.html">Forgot your password?</a> </div> </form> "} ?> </tr> </td> </table> <font color="red"> <table border="0" cellpadding="0" cellspaceing="0" width="400" align="center"> <td><tr> <h5 class="heading">MikeManX.com News</h5><p>Sry i havent updated in a wile ive been realy busy latly...<p><b>New Update</b>: ReDesined logo and new pages.. i got rid of the old movies because they wernt that good buti put in the on that i finish that ive been working on for two weeks also i got the submit page working so youcan submit movies and it will got right into the flash movies page, the same with the tutorial page im not goingto suply the this web site with tutorails because im not good with writing tutorials so i have it ware you can submit the. Dont submit the tutorails in the flash movie submition thats the one on the navbar dont submit thetutorials in the submition you can submit them by going to the tutorial page and there will be a butten that sayssubmit tutorials in the submit page... THX</p><b>New Work</b>: Im curently working on new updates for the site and more ideas for movies.<br><p><b>Flash Movie of the month...<b><p><a href="Clockwars001.html"><img src="clocklogo.png" width="70" height="50" border="0"> StarWars(Clock)</a></p> <br /> </div></font></td> </tr> <tr> <td width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td><img src="" width="8" height="25"></td> <td background="" class="font_vd_small"><b></td> <td></td> </tr> </table> </td> <td align="right"></td> </tr> </table> </td><font size="2"> <center> Copywrite © 2006 Mikemanx Production All Rights Reserved,<br>Special Thx To Jeremy B. For helping me with most of my php code. </html>
  15. ok i get it now but this code dosent work on my site <?php// Define variables and connect to database$user = $_POST['user'];$pass = $_POST['pass'];// 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($user) .' 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['user'] = $user; $_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_form.php?error=" . urlencode("Sorry sucker, your username and password are wrong! You fail it!"); exit();}?><html> <head> <title>Sweet login processor</title> <meta http-equiv="refresh" content="2; url=http://www.yourdomain.com/user_menu.php"> </head> <body> show some sweet "you are being redirected" thing </body></html>
  16. Ok sry im like totaly confused can you explan why i need a program to cheack if there loged in see i dont no what thats for i only needed unless i figure out why i need somthing to cheack if there logedin i was asking for a program that will make the cookie and log the person in
  17. Well sry i asked for help with my logining in php page not a page that would check if a user was loged inoya i tryed the login page and i always asyed could not login
  18. Well then wares the code for the people to login
  19. <?php$siteuser = "";$sitepass = "";// check in the session firstsession_start();if (isset($_SESSION['siteuser']) && isset($_SESSION['sitepass'])){ $siteuser = $_SESSION['siteuser']; $sitepass = $_SESSION['sitepass'];}// check in the cookie (cookie overwrites the session)if (isset($_COOKIES['siteuser']) && isset($_COOKIES['sitepass'])){ $siteuser = $_COOKIES['siteuser']; $sitepass = $_COOKIES['sitepass'];}// check in the databaseif ($siteuser != "" && $sitepass != ""){ // 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"); // Define the query: $query = "SELECT username, memberpass FROM members WHERE username='" . mysql_escape_string($siteuser) . "' AND memberpass='" . mysql_escape_string($sitepass) . "'"; // Run the query and check it it worked. $result = mysql_query($query) or die("Could not execute query." . mysql_error()); if (mysql_num_rows($result) == "0") { $siteuser = ""; $sitepass = ""; }}// at this point, if $siteuser and $sitepass are empty, the user is not logged inif ($siteuser != "") echo "You are logged in as {$siteuser}";else echo "You are not logged in. You fail it.";?> So is this the new code that should work and redirest to a new page
  20. <body bgcolor="#000000"><font color="#FF0000"><?php// Define variables and connect to database$user = $_POST['user'];$pass = $_POST['pass'];// 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='$user' AND memberpass='$encrypted_pass'";// Run the query and check it it worked.$result = mysql_query($query) or die("Could not execute query." . mysql_error());if (mysql_num_rows($result) != "0") {{session_register($user); // session register the usernamesetcookie ("siteuser",$user,time()+604800); // set cookie containing username echo "You are logged in as $user";} else {echo "Could not log you in. Check your username and password and try again."}?> Well thats my login code i dont knnow how to make somthing redrect so i have it ware it gose to the page and you click a link.
  21. Hi I have a web site that you can sign up on and loginbut when you sigh up it always says you are now sucsesfuly registered even if the same user name and every thing i want it to say this user name has already been taken. i dont thing its saving into my database.And my login when i login with an existing user and click login it gos to a black page not say you are now loged in or wrong username or password it just gos to a black page.PLZ Help
  22. mikemanx2

    Form/PHP

    sry... But thx for the code
  23. mikemanx2

    Form/PHP

    Hi i have 2 questions 1 about my login stuff and another a tutorial submiton thing thats basicly a blog ok qustion 1 , 2 thigs about qustion 1 when people login it go's to a blank page,and when someones signed in and there viewing my front page insted of login here i want it to say you are signin as "blobloblo" and my last question is with my submition thing i have an html form calles enter.html ware you type in all the stuff and then it gose to my php file enter.php and then go's to my submitions page but when it gets to my submition page its sumost to post it but it dustint post can you guys send me some code or help me plz.
×
×
  • Create New...