Jump to content

IchBin

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

IchBin's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, thanks for the input gentlement. I'll go ahead and mark this solved. Just wanted to make sure there wasn't something I was missing.
  2. That's just it, I don't really want to strip any tags. I want to allow these two people to post any html they want. I just want to make sure I am able to protect my server as much as possible. I'm guessing as long as I lock it down to them and make sure I do the appropriate escaping/cleaning before putting it into the database, that might be all I can do.
  3. I have a script that I'm creating which allows users to submit news articles. I realize the caveats of allowing users to input such data, but the couple users who I allow to post I trust. These two like to design in their own apps which use some type of wysiwig to create their HTML layout. What I don't know as a coder, is the proper method of doing my best to sanitize this data. I don't really want to try and include some library that does all of this stuff. I'd like just a run down on how it could be done with my own coding. I've done a few searches, but I'm not sure I know the right search terms to get what I'm looking for. If you have any links to other topics, that would be great. Should all the HTML characters be converted to entities? Is it necessary? That would mean I'd have to decode the HTML for display. Do I gain any security from having to do that? It doesn't sound like it to me. Should I use addslashes()? Of course mysql_real_escape_string() would be used on the query to insert. But I'm thinking I need to do more with the data before it gets inserted. Basic steps to protect myself is all I'm looking for. Thanks for any input. --edit-- Sorry, posted in installation. Would a mod please move me to the PHP code board...
  4. Yeah, that's pretty much where I'm at now mjdamato. Only now my query isn't returning all the results I need. At this point I'll have to come back to this when I've figured that out. Thanks!
  5. If I do that, how are you proposing the option to sort things? There are about 7 different groupnames. Sorry, I'm just having trouble wrapping my brain around how this can be sorted. I'm trying to figure out a way to sort the array before I do any output. I could of course do an if check to see what the groupname is, but if I can sort the array then there's no need to do any checks. Trying to do less code isn't always the easiest of course. Thanks for the help so far everyone.
  6. Well, here's the SQL if that gives you enough explanation. Let me know if you need the actual structure. SELECT IFNULL(lo.log_time, 0) AS isOnline, IFNULL(a.id_attach, 0) AS ID_ATTACH, a.filename, a.attachment_type, mem.personal_text, mem.avatar, mem.id_member, mem.member_name, mem.real_name, mem.last_login, mem.website_title, mem.website_url, mem.location, mem.posts, mem.id_group FROM ". $db_prefix."members AS mem LEFT JOIN ".$db_prefix."log_online AS lo ON (lo.id_member = mem.id_member) LEFT JOIN ".$db_prefix."attachments AS a ON (a.id_member = mem.id_member) WHERE mem.id_group IN (". implode(",", $groupIds) .") GROUP BY mem.id_group"; Although, I've ran into a weird problem so my query is likely to change. It would seem after adding the group by statement that I'm not getting the results I want.
  7. Ok, so I was a little a miss when I could have been grouping the results in my query. So I now have them grouped, I just need to do some sort of custom sorting on the groups.
  8. I have an array that looks like this with the print_r() function: Array ( [0] => Array ( [username] => IchBin [name] => IchBin [posts] => 12975 [location] => [href] => link here [link] => IchBin [blurb] => [avatar] => Array ( [name] => [image] => [href] => [url] => ) [last_login] => Today at 04:19:43 PM [last_login_timestamp] => 1278886783 [website] => Array ( [title] => [url] => ) [online] => Array ( [is_online] => 1278886783 [text] => [image_href] => link here ) [groupname] => Admin ) [1] => Array ( [username] => Stu [name] => Stu [posts] => 2713 [location] => Laville [href] => link here [link] => Stu [blurb] => [avatar] => Array ( [name] => [image] => [href] => link here [url] => ) [last_login] => Today at 04:07:38 PM [last_login_timestamp] => 1278886058 [website] => Array ( [title] => Our Site [url] => http://www.website.org ) [online] => Array ( [is_online] => 1278886075 [text] => [image_href] => link here ) [groupname] => Support ) ) Each section is associated to a user. In this example you can see there are two users. But I have many more which I am working with (about 12 or so). At the end of each user you can see that they belong to a group where it says [groupname]. I would like to sort my output of this array so that all users who belong to the same group will be grouped together. Is there a way I can custom sort the array to my specification? I'm not sure how I can arrange the array to group those together before I do the output. Any tips would be great. Thanks!
  9. There are a ton of PHP backup scripts out there. If I were you I would download one, test it out to see if you like it, and then put it in the cronjob to run that file as much as you need.
  10. Are you getting an execution timeout? How long is IIS set to run until it times out on a process? Don't forget the post_max_size should be slightly more than your upload limit.
  11. So I'm writing an upload script for images. Once the image is uploaded and copied to a directory, it then resizes the image and makes it less than 500px wide/tall. After getting the code to actually run for the first time it gave me an out of memory error. I found this gem after reading up on imagecreatefromjpeg on the PHP site. $imageInfo = GetImageSize($imageFilename); $memoryNeeded = Round(($imageInfo[0] * $imageInfo[1] * $imageInfo['bits'] * $imageInfo['channels'] / 8 + Pow(2, 16)) * 1.65); It calculates the amount of memory needed for creating an image-resource out of and image-file. According to this code I need just over 30MB. The image that I uploaded is 1.5MB. Is this right? I mean seriously, 30+MB to process a single image of 1.5MB? I know that other scripts do this with half that, and probably even less. How can I figure out what is using up the memory? I'm basically doing the process the same way this guy wrote his class. http://us.php.net/manual/en/function.imagecopyresampled.php#85929 Any thoughts? Thanks!
  12. I do agree, the colors look great in matching your site. Was just thinking to make the theme look more like your site, like the little headers for each block section, and the side borders etc on the frontpage. Maybe I'll whip something up on my test install of beta4 and show you guys how it would look.
  13. Bah... never mind I figured it out. For some reason I thought that implode was separating the array by the already existing \n that I input when I add the links. I removed the \n in the implode function and everything is functioning normally. Thanks!!!
  14. Some sites depending on their setup require a user agent. You can set that in your php script possibly by doing this. ini_set('user_agent', 'PHP'); Hope that helps.
×
×
  • 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.