Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. [code]<?php session_start(); //start a sessions :D $username = $_POST["username"]; //get the username from the form, as $username $password = md5($_POST["password"]); //get the password from the form in md5 $users = mysql_connect("localhost", "lov3dco_users", "test");     if(!$users) {           echo "<p>Sorry! We could not log you in at this time. Please Try again later!</p>";           exit();         } mysql_select_db("lov3dco_users");  //select what database to use $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $recieve = "SELECT * FROM users WHERE username =  '$username' AND password = '$password';"; $query = mysql_query($recieve) or die("Unable to peform query - " . mysql_error()); //do the query if($rows = mysql_num_rows($query)){     $_SESSION['password'] = $password; //store the users password in a sesions var     $_SESSION['username'] = $username; //store the username in a session var $page = "index.php";    header('Location: ' . $page); }else {     session_destroy(); } ?>[/code] Like that instead.  SOrry trying some stuff here, the paste put a space at the top, use this here and tlel me what happens.  If it remains blank I want you to try something else.
  2. Try those tell me what happens after that.  That should make it do what you are wanting it to, if not let me know.
  3. nevermind I looked at it, paste this over what you ahve and tell me what happens [code]<?php session_start(); //start a sessions :D $username = $_POST["username"]; //get the username from the form, as $username $password = md5($_POST["password"]); //get the password from the form in md5 $users = mysql_connect("localhost", "lov3dco_users", "test");     if(!$users) //error checking :D         {             echo "<p>Sorry! We could not log you in at this time. Please Try again later!</p>";         } mysql_select_db("lov3dco_users");  //select what database to use $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $recieve = "SELECT * FROM users WHERE username =  '$username' AND password = '$password';"; $query = mysql_query($recieve) or die("Unable to peform query - " . mysql_error()); //do the query if($rows = mysql_num_rows($query)) //if the query resulted with a row, start the sessions and go to the index {     $_SESSION['password'] = $password; //store the users password in a sesions var     $_SESSION['username'] = $username; //store the username in a session var $page = "index.php";    header('Location: ' . $page } else //if not, end incorrect sessions, and go to the index {     session_destroy(); // you don't need at here, it's pointless. } ?>[/code]
  4. Alright your header location is off [code]header('Location: ' . $page);[/code] That should get it to accept it. Change that to be safe. Now what is it doing, you said it's not working, is it not working at all, what error is coming up, the reason it worked for ron and not for you, could be his settings in relation to yours, or you could simply be having some sort of db interation error.  I need to know exactly what it's doing, what error it's giving you, everything.  If not then sprinkle echo mysql_error(); after each and every mysql db call, and tell me the output, run some of these tests on it, give me something to look at, something to work with, an error message something.
  5. That depends on what you mean by echo.  Echo should be fine, you have no choice on a fully functional live site.  I have session_start() header across the top of every page, and i have to fill my pages with a lot of echo's because almost everything is dynamic.  THat shouldn't have anything to do with it, unless it's simply the location of the echo.
  6. 1.  Open php.ini 2.  Click on find and replace 3.  Type in "display_errors" without quotation marks. 4.  You will come to a line that reads display_errors = off it if is set to this, change it to on. 5. again go to the type, use the find and replace function to find something. 6.  Search for "error_reporting" as you did before without quotation marks. you will see error_reporting = something here make sure that something here reads E_ALL & ~E_NOTICE After that tell me what errors you get. Also it's not necessary to have session above that, just right below it like <?php session_start(); ?> in it's own island, will make sure that is not the problem
  7. I do that a lot here, it helps me think.  most of the time even if someone doesn't respond, me talking with myself for a few hours it ends up making sense, adn I figure it out anyway. Sometimes one is one's own best friend.
  8. actually it works perfectly, if I had of known it was THat easy to learn htaccess I would have started it along time ago. One last question, is there a way to chain together file commands for isntance can I take. [code]<Files php.ini>   Order allow,deny   Deny from all </Files>[/code] and [code]<Files .htaccess> order allow,deny deny from all </Files>[/code] and do [code] <Files .htaccess php.ini> order allow,deny deny from all <Files> [/code] I tried it but i have no way of knowing whether it will actually work or not.,
  9. [code]<form name="test" id="test" action="samepage" method="post"> <input name="whatever" id="whatever" type="submit" value="change" /> </form>[/code] WHen they click that change button on the same page, it will refresh the page, have it run the following code or example. [code]<?php if (isset($_POST['whatever'])) { unset($variablename); } ?>[/code] Just modify it to meet your needs.
  10. ok I found something.  Is this formatted properly.  The reason I am still running this through php is to save space, you can move it if you want, but I will be changing back to php questions in just a second. Redirect /olddirectory http://yoursite.com/newdirectory/ I saw this so I am thinking if I put the following 2 lines of code in my htaccess file it should do what I want right. [code]Redirect /view/foundpost http://www.elostandfound.info/displayfound.php Redirect /view/lostpost http://www.elostandfound.info/displaylost.php[/code]
  11. and cut on display errors in the php.ini and you will probably notice it says headers already sent/
  12. session_start(); //start a sessions :D put that at the very very very top, that space is enough to kill it, just that one line of space, is enough to kill the entire script.
  13. [code]RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR] RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot@yahoo.com [OR] RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR] RewriteCond %{HTTP_USER_AGENT} ^Custo [OR] RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR] RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR] RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR] RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR] RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR] RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR] RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR] RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR] RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR] RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR] RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR] RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR] RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR] RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR] RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR] RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR] RewriteCond %{HTTP_USER_AGENT} ^HMView [OR] RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR] RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR] RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR] RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR] RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR] RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR] RewriteCond %{HTTP_USER_AGENT} ^larbin [OR] RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR] RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR] RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR] RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR] RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR] RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR] RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR] RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR] RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR] RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR] RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR] RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR] RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR] RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR] RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR] RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR] RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR] RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR] RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR] RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR] RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR] RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR] RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR] RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR] RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR] RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR] RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR] RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR] RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR] RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR] RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR] RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR] RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR] RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR] RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR] RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR] RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR] RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR] RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR] RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR] RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR] RewriteCond %{HTTP_USER_AGENT} ^Wget [OR] RewriteCond %{HTTP_USER_AGENT} ^Widow [OR] RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR] RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR] RewriteCond %{HTTP_USER_AGENT} ^Zeus RewriteRule ^.* - [F,L][/code] I did find something useful, I am still looking through I learnt a lot with that, I am about to get to redirects so this may have helped, and now I can start replicating this on every site.  This will help a lot, do you know of any more names of bad bot's I can add to this list.
  14. The reason I was asking by the way, I was going to do this /view/lostpost/id /view/foundpost/id and if I know the basic framework for doing this, but then that leads me to another question about php, I have heard about php, and working with directories, is this the same thing it's talking about or somethign else.
  15. I have 3 quick questions, 2 of them are related to php ideas. 1.  What is the real word for what I call universal pages.  They are 1 master page, that a lot of links go to.  I used it 3 times to far, and it seems to be my favorite.  I call them universal, or gateway pages, where it decides the outcome from a bunch of different links that pass variables to it.  I was given the idea on 2 accounts, one from a friend, and one from here, and I started adopting the idea almost excesively, what are they really called, I wanted to look up general information about how they were developed from wikipedia.  Another thing I wanted to ask was. 2.  I have a paypal system created, but I am scared of security, I have to payment notification system setup properly, but none of the information is encrypted, by what paypal says, and by waht I know the prices could be changed, but I don't care if a few people do it occassionally I would care however if a lot of people did, is this something the average user's are going to take the time to do. HTACCESS- 1 question. I am still learning htaccess, I am wanting to have something set up to where all the informaiton can be viewed through one page, using a directory.  I need to figure out how to block out one directory, and make it redirect anything going there to another page. I wanted to set the url's relative on the link like http://www.elostandfound.info is the site then I have the relative url set to <a href="/view/"> But the thing is on the /view/ after that trailing forward slash I am going to append the number of the post, the id number of it, and I Wanted to set it up to where it goes to a display.php and I can use the id, to retrieve the information from that post, and make them show up.  The thing is, it's not going to be view, there are 2 types of posts. Lost/found posts.  I need to display it properly to where that if someone wanted to see a lost one, the links are like this on the related url. <a href="/lost/id"> and then for the found it could be <a href="/found/id" How do I set this up with ht access.
  16. Good idea, I will set this up specifically.  What site did you work on for that system by the way.
  17. That's true, You should have had another use for it though, on almost any site that accepts information they end up asking for city/state/zipcode.  I would think it would get reused over and over again, that is why I am thinking of creating it.
  18. Well let me ask you this, when you finished the program could you resuse your code, and database information for all of your projects.  Was it easy to reproduce, if so then I probably will.
  19. Trying to figure out an idea here but things aren't coming together. It's goign to have mostly to do with php, because that is what is going to be cutting up the information.  I am wanting to get an advanced system in place here, something very/very deep, something that may take me a few days to get together.  I am going to learn ajax in like 2 weeks, but I don't know it yet, I am using Xhtml/css, and php to do what I need to do. Here is the thing, on the first page, they pick a generic title, and a category. Then they click next page, and they pick a sub-category(the sub-category display's based on the category choice on the other page).  Now here is the difficult part I want to incorporate, once I finish the system completely though, I can just copy and paste the general code and use it on all of my sites.  I am creating one drop down menu, that has every state in america, all 50 states.  That won't take very long to tell you the truth, just a few minutes.  Once I get the state information together.  Now they put in the state information, and based on what state they pick, when they click next page, the information is all carried over, including from the first page, and depending on what state they have picked, it will display a list of cities.  Every city in that given state, then they select that and enter the zip code information.  based on the state and zip code, I might create a database(one that I could use for various purposes) with all the city and state information, so I can check it all in the database, and make sure the zipcode's match the given state.  by the time I am finished developing that system for the website, I can have that as somethign I can replicate the specific database, adn then do even more when working with another project, I can just copy and paste the code, and it's my own original programming, and my own style.  This is going to be pretty easy programming wise, but may get a little technical informational wise, and I was wondering is this even going to be worth it.  I want to be able to have the type in a state, zipcode, and city.  But I didn't want them to be able to put in 100 state symbols, all states have 2 syllables, so I could get by with just setting maxlength to 2, and chances are they would type in the right thing, it would be easy as hell to validate the state anyway, but I want it to where people can search by city, like fayetville, or however you spell it, or austell, or something.  but Somebody could spell it wrong, and it would exclude it from the listing, also some people may be in another state, and in another icty, and they might spell it wrong.  Any advice.
  20. If I am going to be able to help at all unfortunatley you will have to use the same post, I am very busy the past few days with e-lost and found, and I try to only do posts when I have time.  So try and use the same one, or I can promise I won't get around to seeing it, I always help people when I start because I bookmark the page and have it email them to me, but sometimes I don't have time to hunt new posts.  Or either post a link to the new post in this one at least.
  21. I looked at these.  And I thank you for the advice, I think I will just build a custom system like I have been so far.  Using Javascript and php.  Thanks for the advice, if I get stuck I will look at these some more.  Thanks.
  22. I am trying to figure something out, it's in php because I am pretty sure php is what makes it happen.  I am creating a pretty advanced form right now, and one of the elements is the initial drop down list.  It ended up being a lost and found site, that has multiple categories and sub-categories.  What I am trying to do is something specific with the posting.  Because of the sheer size of the site itself, and number of possibilities, and possibly me adding more stuff when her funds get up there, I am creating one universal posting form.  One place that all the stuff can be posted, either lost and found, and it includes all categories, and everything.  You can post anything from just 1 form, by selecting the right choices. I am having a slight problem, I know enough about php to handle all of the actual form handling, and processing, and databasing, but I am stuck on one thing.  Since it's going to be one universal form all on one page, I have to take into account different account types.  and I just may have no choice but to make 2 types of posting areas.  There are some posts that can be made via paid, and some that can be made via unpaid.  THere are 2 things right now, and I will probably have to split them.  Lost posting's and found posting's.  There are a few things about this I don't get, and the question I don't currently understand is just one thing. One the drop down menu, there will be a category selection.  There are also numerous sub-categories for each category, and I would have to sort it out to where they appeared based on the category.  How do I create it to where, if they select the category, the sub-category show's up below it containing the sub-categories for that category.  How do I set this up.
  23. it's good practice to do section even above the db calls. the connection and everything it should be above everything else as far as sprintf(" I disagree with that usage, but it's partially personal preference.
  24. That may not slow it down but you won't believe this until it's too late, but 2 months down the road when you realize you need to do mathematical equations with it you will regret that you might want to take ken's advice and post that part of the code, so we can fix that issue, that will cause you headaches later on. 
×
×
  • 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.