Jump to content

Armed Rebel

  • Content Count

  • Joined

  • Last visited

Everything posted by Armed Rebel

  1. I have mark up at works, but I have no idea how to make the butons that insert them into a textarea.How do I do this?
  2. I have a file I want included ina page, the file I want to include is in the folder before the one that the file is currently in. (In in /1/2/page.php, I have to include a file in /1/)How can I do this without writing the full url? '^' and '.' don't work.
  3. Armed Rebel

    Upload Script

    Okay, the (first) problem was the submit wasn't working, bad tutorial I guess.Now that I got the submit working, I get the foloowing error trying to upload hte file:
  4. Armed Rebel

    Upload Script

    I'm using a tutorial this from PHPFreaks.com about uploading, and I've copied everything it said onto my upload.php page. For some reason I can't get it working. <html><head><title>Upload Test</title></head><body><form name="form1" method="post" action="" enctype="multipart/form-data"> <input type="file" name="imagefile"> <br> <input type="submit" name="Submit" value="Submit"> <? if(isset( $Submit )) { if ($_FILES['imagefile']['type'] == "image/gif"){ copy ($_FILES['imagefile']['tmp_name'], "[directory it will be placed in](This was written by me, only part of the code I changed)".$_FILES['imagefile']['name']) or die ("Could not copy"); echo ""; echo "Name: ".$_FILES['imagefile']['name'].""; echo "Size: ".$_FILES['imagefile']['size'].""; echo "Type: ".$_FILES['imagefile']['type'].""; echo "Copy Done...."; } else { echo "<br><br>"; echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")<br>"; } } ?> </form></body></html> Any reason it wouldn't be working?I do plan on rewriting this, I'm just doing it to see how it works.
  5. I'm testing a login system.Registration is perfect.Login is perfect. (The code was given to me, but I understand it, except the session part)Anyway, I need to know how to make a user stay logged in if he goes to an other page. (The whole point of this test, is to have a user register, login and edit their details, which can be viewed. Anyone can register if they wish, but it doesn't do anything apart from being able to log in).How can I do this?Also, how can I have a list that shows users that are logged in?Here is my login code: {connection}<html><head><title>Login Test Login</title></head><body><form action="" method="post">Username: <input name="username" type="text" maxlength="20" value="<? echo $_POST['username']; ?>" /><br />Password: <input name="password" type="password" maxlength="16" value="<? echo $_POST['password']; ?>" /><br /><input type="checkbox" name="auth_retention" /> Stay Logged In?<br /><input type="submit" value="Login" name="submit" /></form></body></html><?if ($HTTP_POST_VARS['submit']){ $un = $_POST['username']; $ip = $_SERVER['REMOTE_ADDR']; $pass = $_POST['password']; $authretention = $_POST['auth_retention']; if ($un) { if (eregi("&", $un)==1) { echo "<hr><br />DEBUG: request incorrectly received. Username/Password Invalid."; exit; } if ($un == "") { echo "<hr><br />DEBUG: request incorrectly received. You must enter a username."; exit; } if ($pass == "") { echo "<hr><br />DEBUG: request incorrectly received. You must enter a password."; exit; } $sql="SELECT * FROM users WHERE username='$un'"; $result=mysql_query($sql); $checkres=mysql_num_rows($result); if ($checkres == 0) { echo "<hr><br />DEBUG: request incorrectly received. Username doesn't exist! To register, <a href=register.php>click here</a>"; exit; } } if ((strlen($un)>20) || (strlen($un)<3)) { echo "<hr><br />DEBUG: request incorrectly received. Usernames must be between 3 and 20 characters!"; exit; } if ((strlen($pass)>16) || (strlen($pass)<3)) { echo "<hr><br />DEBUG: request incorrectly received. Passwords must be between 3 and 16 characters!"; exit; } else { $pass = md5($HTTP_POST_VARS['password']); echo "<hr><br />DEBUG: request properly received. ATTEMPTING TO LOGIN<br /><br /> UN: " . $un . "<br />PW: " . $pass . " (MD5 HASH) <br />IP: " . $ip . "<br />Tag Date: " . $date; $sql="SELECT * FROM users WHERE username='$un' AND password='$pass'"; $result=mysql_query($sql); $checkres=mysql_num_rows($result); if ($checkres == 0) { echo "<hr><br />DEBUG: request incorrectly received. Username/Password Invalid."; } else { while ($myrow=mysql_fetch_array($result)) { $_SESSION['username'] = $myrow['username']; $_SESSION['password'] = $myrow['password']; $_SESSION['uid'] = $myrow['uid']; $_SESSION['authver'] = 1; $cookieauthname = $myrow['username']; $cookieauthpass = $myrow['password']; } if ($authretention) { setcookie('userpermaauth', $cookieauthname, time() + 60 * 60 * 24 * 30); setcookie('passpermaauth', $cookieauthpass, time() + 60 * 60 * 24 * 30); ob_end_flush(); } echo "<hr><br />Authed as: " . $_SESSION['username'] . " Please wait while we forward you... "; }}}?>
  6. You just want a simple SQL setup.This should help you out.
  7. Thanks a nuch, Dan, but I need something more towards "Password system for dummies".Where do I place your code?
  8. Okay.Now how do I make it so it checks when the user submits?
  9. Yeah, I'm good with SQL and all that.I just, don't know where to start.i.e, how to check the password is correct (actualy, that's pretty easy)but then there is encoding the password on the SQL database (It's just too temping >.<).How to check if a user is logged in. ect
  10. I need The top 4 feilds to be filled out, and the email feild to be in email format. <html><head><title>Join New World Terror</title><link rel="stylesheet" type="text/css" href="css.css"></head><body><table width="100%"><tr valign="top"><td width="12%"><?php include("navbar.htm"); ?></td><td width="88%"><h2>Join New World Terror</h2><form name=form1 method=post action=register.php> <table width=100% border=0 cellpadding=4 cellspacing=0> <tr> <td width=24% align=left valign=top><b>Clan Information*</b></td> </tr> <tr> <td width=24% align=left valign=top>ESO Username</td> <td width=36%><input name=ESO_username type=text id=ESO_username></td> <td width=40%>This is the user name displayed on the site. Required.</td> </tr> <tr> <td width=24% align=left valign=top>Current ESO Games Played</td> <td width=36%><input name=ESO_gamesplayed type=text id=ESO_gamesplayed></td> <td width=40%>This also doesn't affect whether you are accepted, it is just for us to know how long you've been playing. Required</td> </tr> <tr> <td width=24% align=left valign=top>Current ESO Win Percentage</td> <td width=36%><input name=ESO_winpercent type=text id=ESO_winpercent></td> <td width=40%>This also doesn't affect whether you are accepted, it is just for us to know your relative skill level. Required.</td> </tr> <tr> <td width=24% align=left valign=top>Email Address</td> <td width=36%><input name=email_address type=text id=email_address></td> <td width=40%>You need to have a valid email address to join the clan and will be contacted though it. Required.</td> </tr> <tr> <td width=24% align=left valign=top><b>Profile Information</b></td> </tr> <tr> <td width=24% align=left valign=top>First Name</td> <td width=36%><input name=first_name type=text id=first_name2></td> <td width=40%>Required.</td> </tr> <tr> <td width=24% align=left valign=top>Last Name</td> <td width=36%><input name=last_name type=text id=last_name></td> <td width=40%>NOT Required.</td> </tr> <tr> <td width=24% align=left valign=top>Information about you:</td> <td width=36%><textarea name=info id=info></textarea></td> <td width=40%>Just to say a few things about yourself. Not Required.</td> </tr> <tr> <td align=left valign=top> </td> <td><input type=submit name=Submit value='Submit' onclick="check()" ></td> </tr> </table> </form><b>*All Clan Information Feilds Requered.</b></td></body></html> I've looked over the W3schools tutorial, and even look at other topics about this, but I can't figure it out. Thanks goes out to whoever helps.
  11. Armed Rebel


    Those are the only two?
  12. Armed Rebel

    Password System

    How do I set one up?I've seen on at PHPFreaks.com and it really doens't explain anything and I ened up copy/pasteing everything.
  13. Armed Rebel

    What is better?

    I've just started learning PHP and I was wondering. Would it be a better idea to set a varible such as "$_GET[user_name]" as $user_info?Does it really matter? I've just been keeping it as $_GET[user_name].
  • Create New...