Jump to content

Solar

Members
  • Posts

    145
  • Joined

  • Last visited

Everything posted by Solar

  1. Yes! I got it! I just forgot to look at my session.php Hehe! I'm so tired. And when you said I said to myself, where do I add it. Until I totally forgot. Thanks a lot dude!
  2. I have a feeling something belongs in here since this is where the form is being submitted after you hit "Edit Account" but I have no idea what, I've tried several things. This is the process.php <? /** * Process.php * * The Process class is meant to simplify the task of processing * user submitted forms, redirecting the user to the correct * pages if errors are found, or if form is successful, either * way. Also handles the logout procedure. * * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC) * Last Updated: August 19, 2004 */ include("include/session.php"); class Process { /* Class constructor */ function Process(){ global $session; /* User submitted login form */ if(isset($_POST['sublogin'])){ $this->procLogin(); } /* User submitted registration form */ else if(isset($_POST['subjoin'])){ $this->procRegister(); } /* User submitted forgot password form */ else if(isset($_POST['subforgot'])){ $this->procForgotPass(); } /* User submitted edit account form */ else if(isset($_POST['subedit'])){ $this->procEditAccount(); } /** * The only other reason user should be directed here * is if he wants to logout, which means user is * logged in currently. */ else if($session->logged_in){ $this->procLogout(); } /** * Should not get here, which means user is viewing this page * by mistake and therefore is redirected. */ else{ header("Location: main.php"); } } /** * procLogin - Processes the user submitted login form, if errors * are found, the user is redirected to correct the information, * if not, the user is effectively logged in to the system. */ function procLogin(){ global $session, $form; /* Login attempt */ $retval = $session->login($_POST['user'], $_POST['pass'], isset($_POST['remember'])); /* Login successful */ if($retval){ header("Location: ".$session->referrer); } /* Login failed */ else{ $_SESSION['value_array'] = $_POST; $_SESSION['error_array'] = $form->getErrorArray(); header("Location: ".$session->referrer); } } /** * procLogout - Simply attempts to log the user out of the system * given that there is no logout form to process. */ function procLogout(){ global $session; $retval = $session->logout(); header("Location: index.php"); } /** * procRegister - Processes the user submitted registration form, * if errors are found, the user is redirected to correct the * information, if not, the user is effectively registered with * the system and an email is (optionally) sent to the newly * created user. */ function procRegister(){ global $session, $form; /* Convert username to all lowercase (by option) */ if(ALL_LOWERCASE){ $_POST['user'] = strtolower($_POST['user']); } /* Registration attempt */ $retval = $session->register($_POST['user'], $_POST['pass'], $_POST['email']); /* Registration Successful */ if($retval == 0){ $_SESSION['reguname'] = $_POST['user']; $_SESSION['regsuccess'] = true; header("Location: ".$session->referrer); } /* Error found with form */ else if($retval == 1){ $_SESSION['value_array'] = $_POST; $_SESSION['error_array'] = $form->getErrorArray(); header("Location: ".$session->referrer); } /* Registration attempt failed */ else if($retval == 2){ $_SESSION['reguname'] = $_POST['user']; $_SESSION['regsuccess'] = false; header("Location: ".$session->referrer); } } /** * procForgotPass - Validates the given username then if * everything is fine, a new password is generated and * emailed to the address the user gave on sign up. */ function procForgotPass(){ global $database, $session, $mailer, $form; /* Username error checking */ $subuser = $_POST['user']; $field = "user"; //Use field name for username if(!$subuser || strlen($subuser = trim($subuser)) == 0){ $form->setError($field, "* Username not entered<br>"); } else{ /* Make sure username is in database */ $subuser = stripslashes($subuser); if(strlen($subuser) < 5 || strlen($subuser) > 30 || !eregi("^([0-9a-z])+$", $subuser) || (!$database->usernameTaken($subuser))){ $form->setError($field, "* Username does not exist<br>"); } } /* Errors exist, have user correct them */ if($form->num_errors > 0){ $_SESSION['value_array'] = $_POST; $_SESSION['error_array'] = $form->getErrorArray(); } /* Generate new password and email it to user */ else{ /* Generate new password */ $newpass = $session->generateRandStr(; /* Get email of user */ $usrinf = $database->getUserInfo($subuser); $email = $usrinf['email']; /* Attempt to send the email with new password */ if($mailer->sendNewPass($subuser,$email,$newpass)){ /* Email sent, update database */ $database->updateUserField($subuser, "password", md5($newpass)); $_SESSION['forgotpass'] = true; } /* Email failure, do not change password */ else{ $_SESSION['forgotpass'] = false; } } header("Location: ".$session->referrer); } /** * procEditAccount - Attempts to edit the user's account * information, including the password, which must be verified * before a change is made. */ function procEditAccount(){ global $session, $form; /* Account edit attempt */ $retval = $session->editAccount($_POST['curpass'], $_POST['newpass'], $_POST['email']); /* Account edit successful */ if($retval){ $_SESSION['useredit'] = true; header("Location: ".$session->referrer); } /* Error found with form */ else{ $_SESSION['value_array'] = $_POST; $_SESSION['error_array'] = $form->getErrorArray(); header("Location: ".$session->referrer); } } }; /* Initialize process */ $process = new Process; ?>
  3. Hello PHPFREAKS! I am using the PHP Login System that can be found; http://www.evolt.org/PHP-Login-System-with-Admin-Features I am having troubles adding more fields to the edituser.php I've inserted into the edituser.php; <td>About:</td> <td><input type="text" name="about" maxlength="50" value=" <? if($form->value("about") == ""){ echo $session->userinfo['about']; }else{ echo $form->value("about"); } ?>"> </td><br> I've Inserted to show about the user in userinfo.php; echo "<b>About:</b> ".$req_user_info['about']."<br>"; And I'm pretty sure I am missing something, but have know idea what. Something that will insert into the mysql database called "login". When I manually insert something by using phpmyadmin into my "About" Section, it does show in the userinfo.php. But what the problem here is that the About Field is not properly submitting. Any ideas and help is appreciate! Thanks in advanced! Solar
  4. Or now that I think of it, the only possible way that your music will still play is frames.. Have your javascript inside a file, and it will be on the top frame, then your website can be below in the mainFrame. Therefor, when someone clicks a link or explore your website, the topFrame won't refresh <frameset rows="89,*" cols="*" framespacing="0" frameborder="no" border="0"> <frame src="The URL of your music player / or the script in a php file" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" /> <frame src="The whole entire site="mainFrame" id="mainFrame" title="mainFrame" /> </frameset>
  5. The header.php is going to reload everytime someone clicks a new link or refreshes the page. The only ways I could think of you have the music play is on an acutal page, or in a popup window. Hopefully someone who isn't tired like me will think of a way.
  6. Wouldn't you want to use a; global $session; $retval = $session->logout();
  7. Should it be? $data_path = "/voc/chat/data/";
  8. Okay, I've setted up a blog on my website so that users are to post their own news. Of course it was a simple blogging scrip so theirs no protection. I also use a simple login. The login script I am using uses mysql and can be found here; http://www.evolt.org/PHP-Login-System-with-Admin-Features I have a folder called blogs, That will show the new posts on anyones blogs. A sub folder called users, that will have the list of users folders/blogs. Each person who wants a blog, I will create them a new folder with their name inside the Users folder. My question is; In the code below; post.php; is their away to only allow the user who owns the folder to access the post.php? Example; Solar wants to make a new post. He goes to the site/blogs/users/Steven/post.php Allow him to make a new post while John wants to post in Solar's to make himself funny so he decides to go to site/blogs/users/Steven/post.php and is alloud to. I do not want that to happen ??? <?php require_once("News.class.php"); $newsHandler = new maxNews(); if (!isset($_POST['submit'])) { ?> <?php $newsHandler->displayAddForm(); ?> <?php } else { $newsHandler->insertNews(); } ?> Thanks for your help!
  9. This is what I was looking for, Maybe I can fiddle around and get exactly what I need. Zina. Thanks a lot!
  10. Okay, lets not worry about the out side the server question. I've made a script that will allow users to upload there files to my website, but only with my permission. With the site I gave you, I want to be able to see all the peoples names, and their folders. I've allready made their folders.. so the my site would have.. sitelink/files/theusername/ So instead of me having to update the page with the new user all the time, is there a browser script that will allow me to see everyones folder at once?
  11. Hello Once again, my favourite site to ask PHP Questions. I've looked all over but it's hard to google a specific question. Is there a script that will allow me to view a folder in my computer if my website/apache is running off my own computer? Like lets say if I made a "page" for people to upload there files, is there a way to display all the files for them? Or like if I wanted to display pictures on my website but keep the pictures in the "My Picture" folder of my computer? Like this browser for example; http://beta.armagetronad.net/resource-browser/resource/ Thanks!
  12. Is it possible to put coding inside the quotation marks of this code? For example if I wanted to put a flash game inside where it says; "Games are not available at this time, please check back soon" I've tried many ways and still can not succeed. Or is there a more proper way of doing it? if($session->logged_in){ echo "Welcome <b>$session->username</b>. <br><br>" ."Games are not available at this time, please check back soon.<br>";
  13. Thanks for all your help once again; PHPFREAKS. I love this website!
  14. $username = $_SESSION['username']; $target = "./files/$username/"; Works perfectly of what I was looking for. Now to make it (Figure out how to) when someone registers an account, it makes a folder for their uploads.
  15. This may be tricky to explain but hopefully I can get through.. I've taken a simple upload script from the net. The Browse/Uploader Form; The Upload comfim; I'm making a simple website with some flash games, videos, and other things. I have a simple login page that is coded from this website; http://www.evolt.org/PHP-Login-System-with-Admin-Features Is there anyway to get that upload script to migrate into finding the username and having a folder named by their username so they can upload files to their own folder? Instead of having an open one where people can tamper with files and overright them to be jerks. Thanks!
  16. Sorry for double posting, wouldn't let me re-edit; The Text File is like this; Score Username Score Username Score Username ...etc As you can see there a two spaces and the score comes first before the username. Fiddling with the script, I still can't figure it out.
  17. Hehe, Almost! I really appreciate this. Seems like its backwards. As you can see, the first number has no person beside, Because the person below has the score of the person below that! I'm going to fiddle untill you respond with it and see if I can fix it. To see for yourself; http://sweb.redirectme.net/ss/ladder.php EDIT: Reading an above post; Example; Score Username Score Username Score Username ... etc.
  18. Sorry I should have been more specific.. I'm using a line like this in my ladder.php file. Anyway of editing something in between or after that will allow it to have a next line instead of updating the .txt file which will get overwrited because of server status updates?
  19. Hello, I am new to the forums and I am looking for some help. Hehe, This is the right place I hope. I am running a server on a game and wanting server stats. This game automatically generates itself to a certain folder, I've placed it on my hosting files, which I am using apache. So there automatically generated into the same folder. Which still can be viewed because I have it set up. But with this text file, The beginning of a new line, doesn't always seem to work. Let me point you to a example; http://sweb.redirectme.net/ss/ladder.php As you can see that the points, and the user are bunched up together without starting a new line. My question is; Is there a way of putting a command line into the .php file that will make the Score and the Username beside eachother and a way to make it "Begin A New Line" instead of having to edit the .txt Because it automatically generates itself and will erase whats being put? Thanks PHPFREAKS, Solar P.S. I am new at php, go easy on me
×
×
  • 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.