Jump to content

volatileboy

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Everything posted by volatileboy

  1. Hey there people I was hoping someone can help me out. im making something like this form im using to post this message, trying to make buttons that insert text/bbcode into the textarea, ive manage to get basic ones to work but now im stuck. how would I for example do either side of highlighted text or if no text was highlighted to just place and put the cursor inbetween them? any help is appreciated!
  2. Probably a simple one you hear all the time but it's kicking my ass. I got a wierd 2-3px padding around a flash object in firefox, displays fine in IE. I tried changing the relevant padding on <TD> and the object but it has no effect, can someone help me please!
  3. Just a pointer, can't be bothered doing all of it lol, you could do this: Instead of just putting this: <li class=jobdata><?=$jobreq1 ?></li> try this: if(!empty($jobreq1)) { echo '<li class=jobdata>' . $jobreq1 . '</li>' }
  4. Try: { foreach ($rows as $val) { if (!empty($val)) { echo $val;} } }
  5. sorry use single quotes =) echo "clean int= ".clean($_POST['test'], 'int');
  6. echo "clean int= ".clean($_POST['test'], int); make it: echo "clean int= ".clean($_POST['test'], "int");
  7. Correction: if(!empty($row->data1)) { echo $row->data1; }
  8. I didnt quite understand what you were propperly saying but something like this would only output something that wasn't empty if(empty($row->data1)) { echo $row->data1; }
  9. PHP version 5.2.5 So basically I will have to scrap my captcher script then? It's wierd how it's been working for so long and now it doesn't.
  10. Hey people I have been working on a website for a month or so now, I have a captcher script that in the last couple of days has started showing an error: Fatal error: Call to undefined function imageloadfont() This is a standard php function so I am baffled as to why it's showing this error, especially since it has previously been working perfectly. Any ideas?
  11. If you have already set $_SESSION['username'] you don't need this: $user = $_SESSION['username']; you can just do this: echo 'User: ' . $_SESSION['username']; and like the guy above me says, if you closed the browser window your session data is gone
  12. Sorry, my post was a little confusing, not to mention I didnt use code tags lol. Basically in user posts they can insert image urls like this forum with [ img] [ /img] tags, this is then converted with preg_replace, a shortened version of which is shown below: $patterns = array("/\[url\](.*?)\[\/url\]/","/\[img\](.*?)\[\/img\]/"); $replacements = array("<a href=\"\\1\">\\1</a>","<img border=0 src='\\1'>"); $str = preg_replace($patterns,$replacements, $str); This conversion from bbcode to html is done on page load and the images come out like this: <img border="0" src="http://www.url.com/picture.jpg"> I want to scan through the post and check for legit image tags or [img ] tags, use getimagesize() to find out it's dimensions and calculate it's new width and height and then replace the initial image string with a new one that won't destroy my page. If this can be done easier with CSS that would be great, I can't say im a pro with CSS but it would be a much easier option. Thanks!
  13. Hey just a quick question, I have made a forum and I am using a standard bbcode method which include , I am stumped in finding a way to resize the dimensions of the image when the code is loaded onto the page. My problem isn't with the actual image resize, it's searching through the post text for the string match, getting out the parts I need and changing it with the new width and height. Does anyone have any help on this cos it's kicking my ass? Thanks for reading!
  14. I just realised the lack of info, I am trying to wordwrap a messageboard post, is there anyway of splitting only words and leaving the html alone?
  15. Try this: if ($_POST['mailer'] =='y'){ $body = 'you have a new message from a user.' ; $from = 'blah@blah.com' ; mail($_POST['email'], 'Message from user', $body, "From: $from");
  16. Hey there, I am stumped trying to get wordwrap to ignore html. However it is splitting the html is well, anyone got any ideas on how I can get around that? Thanks
  17. Hey there, I just have a quick question, I looked through all the image related functions but could not find one that I think suits what I need. I am looking to make 1 large image from lots of small ones, each image is 20x20 and I want to bind for example 25 together to make a single 100x100 image, is there a way in php to perform this kind of task? Thanks in advance!
  18. set a session variable and increment it by 1 each time the page is loaded
  19. hmmm its not working for me, i slimmed the query down to test it against yours and its still not working: $sql = "SELECT ip, INET_ATON(ip) AS sip FROM log ORDER BY sip ASC"; $result = mysql_query($sql); $num = mysql_num_rows($result); $i = 0; while($i < $num) { $ip = mysql_result($result,$i,"ip"); echo "$ip<br />"; $i++; } Any ideas as to why its working for you and not for me?
  20. ORDER BY INET_ATOM(ip) cause an error. The ip field is varchar, might inet_atom work better with another type?
  21. ignore the # on the end of the code too, thats a typo =)
  22. $sql = "SELECT ip, alias, INET_ATON(ip)AS sortedip FROM log WHERE normal='1' AND cheat='0' ORDER BY sortedip ASC"; $result = mysql_query($sql); $num = mysql_num_rows($result); $i = 0; while($i < $num) { $ip = mysql_result($result,$i,"ip"); $alias = mysql_result($result,$i,"alias"); echo '' . $ip . ' - ' . $alias . '<br />'; $i++; }# that is outputting like this: 75.137.119.226 - alias 24.222.124.140 - alias 74.139.130.140 - alias 86.94.134.62 - alias 24.200.202.244 - alias 84.105.63.207 - alias 84.105.63.207 - alias 74.97.3.24 - alias I replaced the aliases with alias just incase you think thats an error, INET_ATOM doesnt appear to be working for that, I had previously been using SELECT * FROM table actually but I dunno its late. Any other ideas?
  23. I am outputting the ip addresses, but im also outputting other data as well and for the record im doing nothing illegal with the ip's, im writing a script that parses server log files for a game and I need to sort log entries into an ordered list
  24. The problem is that im not selecting the ip address in the query, natsort() seems like the perfect function to use but I have no idea how I can envoke it into making this work. To be a little clearer lets say my initial query is this: "SELECT name, ip, log FROM table ORDER BY ip ASC" because im not only outputting the ip i think it needs to be done a different way, I might be wrong. I do appreciate your help though
×
×
  • 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.