Jump to content

peranha

Members
  • Posts

    878
  • Joined

  • Last visited

Everything posted by peranha

  1. $epost = nl2br(stripslashes($row['post']));
  2. nl2br() is what you are looking for I believe
  3. what exactly is it doing/not doing and is supposed to??
  4. charset is set to utf-8 I will look into this. Thanks.
  5. Yes it does, it is something with the hyperlink that is causing it to happen, if I call the page directly, it only inserts once.
  6. Positive it is I am calling if from a hyperlink. That is the complete page, minus the database connection, and selecting the database.
  7. I have the following code on a page, and this is inserting data twice to the sql database, and I cannot figure out why. If I execute it in myadmin, it only inserts 1. <?php // Create query and execute query. $bquery = mysql_query("INSERT INTO " . $pregm . "positions (position_1, position_2, position_3) VALUES ('{$position1}', '{$position2}', '{$position3}')"); // redirect back to the index page. header ("Location: index.php"); exit(); ?>
  8. yeah, sorry I wasnt clearer on that, I knew the || meant OR, but I wasnt sure about having 2 curly brackets.
  9. the "'a' OR 1=1 " is a sort of hack, if you dont clean your variables before you use them, people can get all sorts of information from your database, in this case, they would delete all your data. Look up "SQL injections" in google, and it will tell you about it.
  10. May be a stupid answer, but can you have 2 conditions after an if statement, I have never seen it before. //Find Dead Values if($P_HP1== 0 || $P_Name1=="None") { $B_Dead= round($B_Dead + 1); } { //If All Pokémon Have Fainted if($B_Dead=="1") { echo "You have lost.. <html> <FORM method='GET' action='index.php' target='_blank'> <input type='submit' name='Lost' value='Continue'> </html>"; Battle_Unset(); } }
  11. $letter = 'letter'; $system = 'system'; SELECT * FROM mastergamelist WHERE `Description` LIKE '$letter%'AND 'System'='$system' Something like that would work. Just use variables. how you set them is up to you.
  12. Thanks sasa, that will work for any number of links that I specify.
  13. Here is the final code. Had to change the second if statement as when page 3 was clicked on, the links disappeared Thanks <?php if ($this->p > 3 && (($this->p + $this->show) - 2) > $this->totalpages) { $this->p = ($this->p - (($this->show + $this->p) - $this->totalpages)) + 1; }elseif ($this->p >= 3) { $this->p = $this->p - 2; }elseif ($this->p < 3 && $this->p != 1) { $this->p = $this->p - 1; } ?>
  14. Does not work correctly for pages under 3. If you go to page 2, then the link for page 1 disappears. Also when on page 5, it only displays 3,4,5,6 not 2,3,4,5,6.
  15. Yes, the $this->show I can set to any number, right now I have it at 5. I want it to show the current page and 2 before and 2 after. But if it is on page 1, 2 or 3, to show 1-5. on page page 4 show 2,3,4,5,6 and so on. right now if I am on page 1 it shows 1,2,3,4,5. page 2 shows 2,3,4,5,6. page 3 shows 3,4,5,6. page 4 shows 4,5,6. etc. Sorry by links I meant pages. so the ideal thing is current page in the middle unless it is 1,2 or it is one of the last 2 pages. In my case right now 5,6.
  16. How can I get this to display 5 links on the bottom of the page. EG. I have a query that produces 6 pages. when I go to page 3, it only displays from page 3 to page 6, and page 4 will display page 4 to page 6. Can I get it to display 2,3,4,5,6 ? and so on. <?php for($i =1; $i <= $this->show; $i++) // show ($show) links { if($this->p > $this->totalpages){ // if p is greater then totalpages then display nothing echo ""; } else if($_GET["p"] == $this->p){ //if p is equal to the current loop value then dont display that value as link echo $this->p ; } else{ echo " <a href=?p=".$this->p."> ".$this->p." </a>"; // else display the rest as links } $this->p++; //increment $p } ?>
  17. Store their member id in a variable and use that in the sql query. UPDATE members SET price = '0' WHERE member_id = '$membid'
  18. You are not setting $problist anywhere that is why. // execute query $result = mysql_fetch_array(mysql_query($query)) or die(mysql_error()); //Set problist to a variable. $problist = $result['problist']; Try that and see what happens.
  19. Just do <?php if ($_POST['problist'] == $problist) { // Put what you want done here is they are equal } else { // if they are not equal, put what you want done here. } ?>
  20. Are you running windows or linux? In windows there is also a hosts file you need to edit. http://en.wikipedia.org/wiki/Hosts_file
  21. puting an HTML line break will force to the next line <br />
  22. You can say that I am wrong, what ever you want, but this is where I end my end of this discussion as this is not the place for it. As I see it, coming from this kind of situation (Not exactly, but kind of close). The mother should have a job to start with, and as a 16 year old, where I live you can have a job at 14. Get out and get one even if it is part time. I had one when I was 12, and working full time when I was 16 to help out my parents. I paid for some of their bills (so they as well as I) could live. From my growing up, that is the way that I see it. Also, to get kind of back on subject, look at Mr. Obama, he grew up with just his mother as his father walked out on them. This is the same as your senario above, and look at him now. He is "The most powerful man in the world" so to say as everyone else does. I have nothing against him as it was a close election, and everyone was sick of the republican party as they think that it was them that caused all these problems. The way that I see it it is only going to get worse before it gets better, and I dont see that happening in the near future. So that is where I leave this discussion and if you have issues with what I said you can pm me if you want me to reply. To steelmanronald, if your last post was a stab at me (may not have been, but just saying) and thinking that I am not able to vote, I am 24, and have followed the election as I was going to vote, but decided not to as neither of the candidates on my ballat were worth voting for in my opinion.
  23. It's really easy for you to say that when you're not in that situation. It's the proverbial "What would you (or wouldn't you do) if you had a gun pointed at your head or were offered a million bucks." People have a tendency to say one thing in theory and have a total change of heart in practice. To tell you the truth, the only reason that I have health insurance is because the company requires that I have it to work there. The only reason that I have auto insurance is because it is illegal to not have it. The last time that I was at the hospital, I was unconscious and 8 years old. If I cannot get over it myself, then I was not meant to survive it, and was meant to die.
  24. For me I would rather die that rely on others to keep me going. I am one that if I cant do it myself, then it doesnt need to be done for me. I would love to help others out that can help themselves, or want to help themselves, but it they dont what to help themselves, why should we give them everything. Because they deserve a life just as anyone else? They just happened to not be fortunate enough to get a good life like many others. They deserve a chance for a good life. But do you just think you should only get help if you have the money to get it? May I ask why you are on this site then? This site is about helping other people for free without getting anything in return. It seems to contradict with your view on life. You should get help if you deserve it, no because you dont want to do anything for yourself. It has nothing to do with not having enough money. For me I would rather die that rely on others to keep me going. I am one that if I cant do it myself, then it doesnt need to be done for me. I would love to help others out that can help themselves, or want to help themselves, but it they dont what to help themselves, why should we give them everything. Nobody doesn't want to help themselves. There are alot of people out there that just want to have everything paid for, and not have to work for it.
×
×
  • 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.