Jump to content

vendlus

Members
  • Posts

    141
  • Joined

  • Last visited

Everything posted by vendlus

  1. Ok, I think I've got it. I pulled this from the comments at the bottom of substr() in the manual. >$fieldtype = $field['Type']; $start = '('; $end = ')'; if( $fieldtype != 'text') //since there is no number with 'text' $maxlength = get_string($fieldtype, $start, $end); else $maxlength = '100'; //I'll actually put something useful here later echo $maxlength; echo "<br />"; function get_string($h, $s, $e) { $sp = strpos($h, $s, 0) + strlen($s); $ep = strpos($h, $e, 0); return substr($h, $sp, $ep-$sp); } Anyone see any problems with this code? It seems to work correctly when I echo the variable.
  2. I'm pulling a list of the columns from a table using 'SHOW COLUMNS FROM tablename' This returns a field called 'Type' which has values such as 'varchar(255)', 'int(10)', 'tinyint(4)', and 'text', etc. I need to pull the numbers out of these values. I was looking at doing something such as but with the differing length of values I can't hardcode those numbers. Does anyone know of a function to pull out the characters between the ( )'s?? I can use substr("$fieldtype", 0, -1) to get rid of the rightmost one, but I'm not sure what to do about the left one. I was looking at ltrim, but it seems to be for whitespaces and tabs and such. Any thoughts?? Or did I miss something wtith substr or ltrim?? - Vendlus
  3. Looks great, but the specs for the "Expert" and "Platinum" are the same (they show the MB and transfer for the expert package). And the Platinum Plan has an extra "plan" in the title (it reads "Platinum Plan Plan").
  4. Should all of the servers have switched over by now? I ask because mine are still both using bluelagoon (servers 35 and 36). Not that I mind at all, just wondering.
  5. Oh yeah? Mine has only happened on my invision forums (and only on one site, my other two are fine, even though one of them has much greater traffic), and are always with one of invision's default tables. What server are you on? Maybe it's a server issue? I'm on Server35. (but I think I used to be on Server33, so that's probably not it)
  6. Thanks. I did know that varchar only goes to 255 if I had been thinking. Didn't remember that it only uses space as it's needed though (from the link surefire posted). I'm currently using htmlspecialchars in a few places. Almost all of my forms will be in staff sections of the site which check for permission levels before loading the page though, so I'm not as worried about malicious content in this particular form. I certainly will look into some more security measures though once I get the functionality I want working.
  7. and you'll find plenty of info. The one bit that I would add to Wilexa's post is that if you are going to use sessions to pass variables, then you should have a testing script that makes sure the user can accept cookies (or sessions) and have a back up plan if they can't. Some ultra high security sessions will disable the sessions feature of php. oh yeah... I knew there was a reason my brain was rejecting something about sessions. I'll certainly try that search out. Thanks for your help guys.
  8. I was just about to send a help desk ticket about this. This has happened to me three times, all on the same forum, but always to a different table. The latest time it happened was around 2am this morning from what I can tell. The only time I was doing anything with the forum was when I was changing some permission settings and adding a new board. I ended up having to repair the forums table and lost my main board plus the new one I had created. I was able to just add the entry back to that table to get my boards back, but still. Do you have any mods or anything on your forum?? I have a couple of minor mods on mine that add ibf codes and such, but I can't imagine how they would cause this.
  9. Surefire, You're awesome. I haven't had a chance to install yet, but I've got it downloaded and looked over some of the code to see how it all works. I've been looking for a new form script and it looks like you have saved me the trouble to creating my own. You've even allowed me to use my own stylesheet instead of having to edit the code. Thanks again, you own. - Vendlus
  10. I'm wondering if anyone can give me an idea of how mySQL handles text fields. I've got a field that could be 30 characters or 250, or anything inbewteen (or possibly more, but unlikely). With space and speed as the main considerations, is it better to use 'text' as the type or like 'varchar(250)'?? I need to dynamically create pages from this table, but not search off of this field or anything. Any queries run on this table will be select queries based on an id field, so I don't think speed will be a big deal either way. My main thing is whether I should just use 'text', since to use 'varchar' I have to use the max number of characters for the field, even though most of the entries won't be that large.
  11. What method do you all use to pass your variables between pages?? I've been using query strings like "additem.php?gameid=2", but I know google doesn't like dynamic naming for it's indexing. What do you use to either stay with a static address, or what do you do to make it look like a static address to google at least. - Vendlus
  12. Indeed.
  13. Yeah, what Frylock said was the first thing to come to mind when i saw your code as a possibility. The only other thing I could think of was to check the scope of your variables, but they're all fine from the looks of things. Good luck.
  14. I started because I wanted to write a new website and needed a database to run it. I used the three sites the first poster mentioned, plus random information from anywhere I could get it. I found that the best way for me to learn it (besides just getting in and coding) was to get either mods for my forum and look at how they worked and affected the rest of the pages, or to go to HotScripts and download someone's code and go over it (and of course, seeing what I could do to break it and change things). *edit* oh yeah, I have a background in Java, VB, and C++, so that made pulling the scripts apart easier since I already knew the standard programming constructs. I probably would have resorted to an actual book if I was a true beginner. (Overall, I find the O'Reilly books good, as well as the Java book by Deitel & Deitel.)
  15. echo simply copies what you have written into the html the user gets. so typing this in php.... >echo("<h1>Header for page</h1>"); is the same as typing this in html ><h1>Header for page</h1> --------------------------------- It's useful for when you want to dynamically update a page or have a form or something that you can't do in standard html.
  16. Thanks Deverill. I'm looking at doing that for a new site I'm in the process of writing. At least for the first little while, it'd be nice to know exactly what googlebot is up to.
  17. Thanks borfast. I do a mix of styles depending on how much php or html I have like you mentioned. I've just always wondered if technically I should be chosing one way other another. Thanks for your help.
  18. Ok, I didn't think it would effect enough to make much difference. Thanks. Rock Sign
  19. Awesome, thanks.
  20. Is it better to have all of your HTML echo'ed to the screen or jump in and out of php to code your HTML straight without needing echo?? Does it affect the processing speed enough to matter when the server has to gkepp getting into and out of php mode?? (I hope this question makes sense, if not, I'll try and post an example.)
×
×
  • Create New...