Jump to content

SieRobin

Members
  • Posts

    212
  • Joined

  • Last visited

    Never

Everything posted by SieRobin

  1. [quote author=businessman332211 link=topic=108657.msg437365#msg437365 date=1158685991] regex? like str_replace, and other things??  That might work have you thought of that. [/quote] I was using str_replace lol, that's what I said in the post to begin with :P If you're speaking of something else, please elaborate, I'm brain dead.
  2. [quote author=wildteen88 link=topic=108657.msg437366#msg437366 date=1158685996] Umm missed that! What code do you use to get the post out of the database when you display the post? The code you posted is fine. However I strongly suggesst you validate your user input. As at the moment your code is can be exploited with SQL Injection attacks, which can cause damage to your database! [/quote] Just posted the rest, and yeah I'm not THAT advanced with PHP, but I know most of the ins and outs.
  3. Oh sorry forgot the other part, lol [code]elseif (isset($msg)) {   mysql_query("UPDATE f_thread set views=views+1 where bname='$brd' AND ID='$msg'") or die("Could not log views");       $post="SELECT * from f_post where bname='$brd' AND msg='$msg' order by ID ASC";     $post2=mysql_query($post) or die ("Could not display threads"); print "<center><table class='ftable'><tr class='headline'><td colspan='2'><center>Forum</center></td></tr> <tr class='mainrow'><td bgcolor='ababab' width='20%' rowspan='2' class='mainrowf'><a href='profile.php?id=$thread3[UID]'>"; if ($pstats3['uimage']=="") { print "<img src='image.php?img=images/nophoto.jpg' border='0'><br>"; } else { print "<img src='image.php?img=userimages/$pstats3[uimage]' border='0'><br>"; } $newtext=wordwrap($thread3['post'], 83); print "$thread3[author]</a><br> Race: $pstats3[race]<br>Level: $pstats3[level]</td><td class='mainrowb'>$thread3[title]</td></tr> <tr class='mainrow'><td class='mainrowf'><pre>$newtext</pre><br>"; if ($userstats3['ID']==$thread3['UID']||$userstats3['acctype']>2) { print "<div align='right'>[<a href='forum.php?brd=$brd&msg=$msg&tquote=$thread3[ID]#bottom'>Quote</a>] [<a href='forum.php?brd=$brd&del=$thread3[ID]'>Delete</a>]</div>"; } else { print "<div align='right'>[<a href='forum.php?brd=$brd&msg=$msg&tquote=$thread3[ID]#bottom'>Quote</a>]</div>"; } print "<hr>$pstats3[quote]</td></tr> <tr height='14' class='spacing'><td colspan='2'></td></tr>";[/code]
  4. [quote author=wildteen88 link=topic=108657.msg437350#msg437350 date=1158685174] SieRobin have you posted your code yet which I requested? :) [/quote] Yes, it's right above you in the code boxes.
  5. [quote author=Destruction link=topic=108657.msg437348#msg437348 date=1158684779] Sorry I meant to say textarea.  Which are you using for the entered text you're trying to break up? Also, you could use a BBCode style solution where they could but [code][p][/code] or [code][br][/code] and have the code filter and replace those as [code]<br/>[/code] instead Dest [/quote] I'm using a textarea, and I'd kinda like them to just be able to hit enter and it automates a linebreak for them.
  6. [code]elseif (isset($sthread)) { if (empty($titlet)) { print "<center><table class='table'><tr class='headline'><td align='center'>New Thread</td></tr> <tr class='mainrow'><td align='center'>To post a new thread, you must have a title.<br> <a href='forum.php?brd=$brd'>Back To Board</a></tr></td></table>"; } else { print "<center><table class='table'><tr class='headline'><td align='center'>New Thread</td></tr> <tr class='mainrow'><td align='center'>Your thread has been posted.<br> <a href='forum.php?brd=$brd'>Back To Board</a></tr></td></table>"; mysql_query("INSERT f_thread set author='$userstats3[playername]', UID='$userstats3[ID]', title='$titlet', post='$postt', bname='$brd', timep='$nowtime'") or die ("Could not post reply");   }[/code] $postt shows as. [code]$postt=$_POST['postt'];[/code] There ya go, lol.
  7. [quote author=Destruction link=topic=108657.msg437342#msg437342 date=1158684541] If you have a textbox, a newline is added when return/enter is pressed.  To get it to display that in output you'll need to nl2br($output) the output ($output being whatever output variable you would be using).  This will convert any new line to <br/> Hope this helps Dest [/quote] I've tried this, sorry it doesn't work :[
  8. I believe yes I can use the .htaccess files, it's just a matter of finding them lol. And yes I'll post that in just a second.
  9. Ehhh, I've never used var, my understanding was that "var" doesn't really exist in PHP. I just use $variablename and that distinguishes that it's a variable, [the dollar sign that is].
  10. Ok here's the problem, I've posted about this before, but the problem was solved with a bad idea. The problem is, that on my forum, when you're writing your reply/thread post, I want the person to be able to just hit the enter key to line break when it shows the output on the actual forum itself. Now, when you do this, EVERY linebreak shows as "rn", whatever that's supposed to mean? The solution I came up with was a str_replace just replacing "rn" with "\n", problem is, what if they use the word "turn" or "learn"? Well then it would output this. [b]"Do you have anymore tu s?"[/b] Instead of. [b]"Do you have anymore turns?"[/b] Now if you don't use the str_replace and you use linebreaks, this is what happens. [b]"Hey, did you hear about that awesome new game?[i]rnrn[/i]It's pretty cool."[/b] Instead of. [b]"Hey did you hear about that awesome new game? It's pretty cool."[/b] So what exactly do I have to do, to fix this? Because I think I'm going to have a brain aneurism, lol.
  11. I'm still having this problem, sure str_replace works good, but what if I wanted to post the word "turn" in? Then I would have a line break at the "rn" in turn.. therefore it doesn't work very well. I thought in PHP when you use a linebreak it's supposed to just output /n? I don't know, I need some help please, I'd like to have line breaks when you hit the enter button lol.
  12. SieRobin

    IP

    It limits the accounts used per IP address, usually they don't renew that often in most senses, I already tested it with the 85 members I have.
  13. I re-wrote the entire script, a little late aren't you? And I don't know moberemk, I was thinking the same thing.
  14. Right the number I set is when it's adjusted to wrap the words, correct? Well the way it's set up is with an if else statement, but the else continuously kicks in, the if statement is pretty much useless. If you actually look at the script, you'll see where it basically says, if the text exceeds the count forget everything thereafter and input "..." else output nothing. Doesn't work.
  15. I see, it works fine but the only problem I have with it is, if it doesn't word wrap, then it just puts the "..." in there anyhow, for no apparent reason lol.
  16. K, so basically all I want to do is that when it gets to the end of the wrap, just to output "..." instead of just doing a line break and continuing the rest of the text. Is there a way to do that?
  17. SieRobin

    IP

    Yep and like I said there was, there was :P I found a way to do it easier, just a while loop and an exit.. BAM done. Thank you for the help though :]
  18. SieRobin

    IP

    Isn't there just an easier way to do this? Seems so.. I had it working but it was only pulling the first user from the database, I just want it to check every person.
  19. SieRobin

    IP

    Not understanding here, if I do a query doesn't it technically only pull one result?
  20. SieRobin

    IP

    Hello all, I'm having some trouble with duplicate IP addresses. What I'm trying to do is limit the user to one account per IP address, the way I've tried to work it out obviously doesn't work or I'd actually just do it that way. Here's my script of what I have, not that it works but, it may spark ideas on the easiest way this can be done. [code]$dupip=mysql_query("SELECT IP from users");   $dupip2=mysql_fetch_array($dupip);   $IP=$_SERVER['REMOTE_ADDR']; if($IP==$dupip2['IP']) {       print "<br><table class='table'><tr class='headline'><td><center>Register</center></td>   <tr class='mainrow'><td><center>There is already an account containing that IP address, one account per IP address. <a href='index.php'>Login</a> to your already existing account.</center></td></tr></table>";   }[/code] All it really does is after it's done all the checking if the username is taken so on and so forth, is it logs your IP into the database, then if you try and sign up again under the same IP, it won't allow you to. I think it has something to do with my array, would an assoc do anything different or do I need a while loop?
  21. Yeah I'm in serious trouble. Long story short, I went to go save my file.. and it only saved half of the damn file, is there ANYWAY possible I can retrieve this file again. I've down it before I just don't remember where I went to get it. SOMEONE HELP PLEASE!
  22. [quote author=redarrow link=topic=103556.msg413098#msg413098 date=1155206652] insert and update chage and try ok ['alt'] . "', '" . $_POST['url'] . "', '" . $_SESSION['firstname'] . " " . $_SESSION['lastname'] . "', NOW())"; to ['alt'] . "', '" . $_POST['url'] . "', ' " . $_SESSION['firstname'] . " ', ' " . $_SESSION['lastname'] . " ', NOW())"; [/quote][quote author=redarrow link=topic=103556.msg413098#msg413098 date=1155206652] insert and update chage and try ok ['alt'] . "', '" . $_POST['url'] . "', '" . $_SESSION['firstname'] . " " . $_SESSION['lastname'] . "', NOW())"; to ['alt'] . "', '" . $_POST['url'] . "', ' " . $_SESSION['firstname'] . " ', ' " . $_SESSION['lastname'] . " ', NOW())"; [/quote] That's the exact reason why I don't use '" . It's so sloppy and messy, when all you really need is a single quote.
  23. Why wouldn't that work? I do it all the time Orio. He wants to make a ShoutBox, meaning he basically wants to update the text in the marquee everytime he submits a new piece of information in the textarea. After he hits the button, it posts the data into his database making the variable, $shoutbox visible to everyone, instead of manually going into the database everytime to update the shout out.
×
×
  • 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.