Jump to content

redbullmarky

Staff Alumni
  • Posts

    2,863
  • Joined

  • Last visited

    Never

Everything posted by redbullmarky

  1. [!--quoteo(post=354663:date=Mar 13 2006, 09:32 PM:name=curtm)--][div class=\'quotetop\']QUOTE(curtm @ Mar 13 2006, 09:32 PM) [snapback]354663[/snapback][/div][div class=\'quotemain\'][!--quotec--] but I don't get the code after preg_match_all - all the <'s and >'s and \'s - how does that stuff work? [/quote] haha welcome to regular expressions. i still don't fully understand them now, but all the bits you mention are patterns that will match to the information youre after. in the case of the < and </ etc, this is literally trying to match the opening and closing tags in HTML and returns the contents. as regex has certain operators that define the way a pattern is matched, a backslash (\) is used to let the parser know that the following character is literally the character you want to match, and not an operator. just like if you wanted to put an apostrophe in a string, you'd backslash it first to tell the php parser that you really want the apostrophe, and don't mean it to be the closing quote of a string: [code] $nameplural = 'mark's'; // will give an error $nameplural = 'mark\'s'; // is fine [/code] [!--quoteo(post=354663:date=Mar 13 2006, 09:32 PM:name=curtm)--][div class=\'quotetop\']QUOTE(curtm @ Mar 13 2006, 09:32 PM) [snapback]354663[/snapback][/div][div class=\'quotemain\'][!--quotec--] I think if I can get it to pull out everything between <form and </form> I can get the rest to work. Thanks! [/quote] well, you say that, but all you get left with when you've pulled out the bits between the form tags is a smaller version of the page you started with, which you'll then need to match INPUT and TEXTAREA and BUTTON tags, etc. without looking too heavily into the preg_match pattern you have, it appears youre very much on the right lines. but: [code] $result = preg_match("/\<form\>(.*?)\<\/form\>/i", $sFile, $resultsarray); print_r($resultsarray); [/code] should return all the info between the form tags. i'd personally stick with preg_match_all though and try and work it out. it aint easy, but once you've nailed it you can do some pretty tricky search and replace tasks in minimal amount of code. Hope that helps Cheers
  2. haha good to see you again james. i'm sure i'm not the only one who has a chuckle at some of your posts :)
  3. hmm you could probably squeeze several books out of web security, but i think the guidelines i kinda stick to, which kinda summarises everything i ever learnt about php/mysql security is: 1, guard against SQL injections if you use $_POST/$_GET/$_REQUEST, etc. not just talking about backslashes and apostrophes here, but the whole hog - make sure there's NO way of inducing an error message via user input/changing URLs, etc. 2, like you rightly point out, Dreamweaver automatically creates a 'Connections' folder. to be honest, i 'borrowed' some ideas from phpbb's mysql class, so i don't use dreamweavers recordset/database features at all anymore. also, i do not keep my username/password file within the web tree, but rather i access the details i need via an include. 3, which brings me onto another point i picked up on. i read once somewhere that if you don't want people to access something, don't upload it at all. seems a bit unpractical, so my compromise is - keep everything you don't want direct access to (even images, etc) OUTSIDE of the web tree, and use a script to access these files instead. i made an entire recruitment system that allows users to register and store their CVs (resume's). the details of the CV's are stored in a database, but the files themselves are stored OUTSIDE the web tree, and fed back to the browser if required via a seperate script. images too - imagecreatefromjpeg/gif, etc, are excellent functions to access images stored outside of the web tree. 4, error reporting - excellent whilst youre developing a site (for you), and excellent whilst the site is live (for a potential hacker). make a point of turning off error messages in your PHP.INI file (or via a htaccess file) when the site goes 'live'. on the same note, i really never use: die(mysql_error()) anymore either, as it reveals too much info as far as i'm concerned about the structure of my database for people to possibly try SQL injections. this is also one of the reasons i don't use dreamweavers custom recordset/database scripts anymore, and rather use ONE database accessing script that i can turn debugging on and off by changing one value in one file, not hundreds of values/lines of code sitewide. so in summary, i think it's important to remember not to have ANYTHING sensitive on a server at all, but if it has to be that way (as in most cases), then putting the files outside the web tree and bulletproofing the scripts that access them and feed them to the user is a good option.
  4. [!--quoteo(post=354505:date=Mar 13 2006, 02:37 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Mar 13 2006, 02:37 PM) [snapback]354505[/snapback][/div][div class=\'quotemain\'][!--quotec--] Apparently I underestimated myself. Using Andy's code, I'm showing 44,167 lines of code. And that's only the top level of each application, but it also includes a little over 2000 lines that I didn't write. So if it all balances out, I'd say I've written at least 43000 lines of PHP/JS/HTML in the past year and a half. Crazy. [/quote] who at the zend offices decides to make a function called 'glob'? lol lovely, but andy - thank you, i've been looking for something like that for another little project i'm testing out. ober, my guess is that if you want a more accurate guess, then unless you neve have blank lines between your lines of code, it maybe a good idea to do a check for lines that are literally just empty.
  5. at first glance, i think it's very well styled. it's only when you go into it a bit more you start to notice things, and maybe a possibility that you have priorities mixed up on each page. 1, the content that doesnt change as you click through different pages takes up far too much room, i think. the actual content sits right at the bottom of the screen, kinda pushed out of the way a bit. i think you could at lease make it half and half, instead of 2/3rd's static content and 1/3rd for the content of each page. 2, forms - one of my biggest expectations when presented with an <INPUT> or <TEXTAREA> field is that the first field of the form automatically focuses, so that i don't need to click it. minor point i know, but it makes alot of difference in my opinion 3, i really don't like the animated 'if you died today...'. it just kinda cheapens things a little bit. i'm not religious, but for a more 'serious' slogan like this, i think it needs to be treated a bit more delecately rather than scrolling, spinning and zooming. if that's the way it's got to be, at least slow it down. i'd probably suggest slow fade in/fade out if anything. 4, scroll bars. one of the biggest problem using frames is that these 'beauties' crop up all over the place. unfortunately though, it can have a detremental effect on the style, feel and professionalism of a site. maybe the 'if you died today...' bit could be a non-framed summary (ie, so it don't induce scrollbars at all) with a click through to it's own section in itself? seems there's enough content in it to warrant a new page. 5, the font on your search pages (where the form/submit buttons are) is different to the rest of the site, and because it seems like the default font, it just doesnt look great. i'd also replace the text of your 'Submit' buttons to something a bit less 'default', such as 'Search' otherwise, like i say, it's very clean and well laid out - literally a few minor bits of work, IMO Cheers Mark
  6. [!--quoteo(post=354571:date=Mar 13 2006, 05:19 PM:name=curtm)--][div class=\'quotetop\']QUOTE(curtm @ Mar 13 2006, 05:19 PM) [snapback]354571[/snapback][/div][div class=\'quotemain\'][!--quotec--] I need help creating a script please. I need a script where I could enter in a url, click submit, and have the script go to that url, look for "<form" and then pull out the method="xxxx" and the action="xxxxxxxxxxxxxxxxx" and all of the input name="xxxxx" and options and selects. Basically, I want an easy way to find out where a form is being submitted to, and all the form valune names. Can anyone help with this? Thanks! [/quote] you're asking alot in one go. there are a few things you need to look at here: 1, opening and reading the contents of a webpage into a variable. 2, regular expressions (preg_match, etc) to actually draw out the relevent info from the variable. unless you drop it in the freelance forum, i don't think you're gonna have much luck getting someone to write the whole script for you, as it's not a simple straightforward 'get this, do that' script. give it a blast, then post any code you have when you get into problems and we'd probably be able to help you much more. Cheers
  7. change this: [code] $get_last_row = mysql_query("SELECT * FROM shoutbox ORDER BY id asc limit 1"); [/code] to this [code] $get_last_row = mysql_query("SELECT * FROM shoutbox ORDER BY id asc limit 1") or die(mysql_error()); [/code] it won't solve your problem, but will tell you what the problem may be. the above line is failing you somewhere cheers
  8. [!--quoteo(post=354387:date=Mar 13 2006, 02:40 AM:name=sgb162)--][div class=\'quotetop\']QUOTE(sgb162 @ Mar 13 2006, 02:40 AM) [snapback]354387[/snapback][/div][div class=\'quotemain\'][!--quotec--] For any PHP to run the file has to be saved as a .php file. [/quote] whilst this is obvious, it's actually spot on - and unless something drastically wrong is going with your setup or your file naming, i'd run with this answer. i very much doubt that dreamweaver has anything to do with it - once the file is in the browser, dreamweaver has nothing to do with it. if you have PHP set up, and it works for PHP files, then my guess is the files youre embedding PHP into are HTM/HTML files or similar, in which case the server wont even bother parsing them as php. i kinda reckon that it's good practice to always use the same extensions throughout the site, even if a file uses no php in it at all.
  9. [!--quoteo(post=352816:date=Mar 8 2006, 12:25 PM:name=AV1611)--][div class=\'quotetop\']QUOTE(AV1611 @ Mar 8 2006, 12:25 PM) [snapback]352816[/snapback][/div][div class=\'quotemain\'][!--quotec--] Sometimes, Tables do make sense for layout... depends on what you are doing.. (Oh, I'm gonna get flamed for that...) [/quote] nah i'll agree with you there. ok, for more complex layouts, fine - use layers. but definitely for something like this, i reckon you'd be a million times better off with tables. at the end of the day, it's just a personal preference. but at least tables always have predictable results and can often hold things together very solidly, regardless of the "layers for layouts" and "tables for tabular data" arguments.
  10. [!--quoteo(post=352863:date=Mar 8 2006, 02:41 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Mar 8 2006, 02:41 PM) [snapback]352863[/snapback][/div][div class=\'quotemain\'][!--quotec--] [a href=\"http://lanparty.whproductions.com\" target=\"_blank\"]Lanparty Central[/a] I threw this together about a year ago for some buddies of mine to schedule lanparties and let other people know about times and what to bring, etc. I recently changed the look. What do you think? I know it's not super fancy, but I was kinda proud of how the banner image came out. [/quote] the banner image, just as you think, looks very good. there's only a few things that don't hit me as great. 1) the blue border kinda spoils the banner image. i think either lose the blue border, or make the banner stretch over the border so that the main area looks like a 'hanging container'. 2) i'm not mad about the style of each item on the LAN party schedule, although i like the way they work. i can't put my finger on it exactly, but my feeling is that again, it's something to do with its border. 3) i've mentioned this before, but i think you didnt take up on the idea as "not everyone has javascript". but something I like to do myself (and like to have happen on sites i visit) is for the first field of every form to focus automatically. in short, this saves me even having to use the mouse or press tab 20 times before i get to the first field. 4) as with number 3, this is my preference (as you'll know very much by now lol) but being able to click the banner image to go 'home' is always something i expect to be able to do on a site. in all, i think it's nice and clean, easy to get around, and understand, which i guess is the most important thing. apart from the above, it's pretty spot on. Cheers Mark
  11. i've been following this since you first posted it, and have watched it change quite alot. i haven't really commented because moberemk has really hit the nail on the head about most things he's stated and you've actioned them very well. all in all, the layout, presentation and usability of the site is up-front pretty nice, clean, easy to use and pretty darn good. my ONLY gripe is a really nit-picking thing - the 'links' that sit just under your main banner. well, i thought they were links cos they look a bit like links but they're not. also, 2 of the 6 items shown here are not anywhere to be seen in your 'real' navigation on the left hand side. i'd say do one of the following: 1) lose the part i'm on about totally 2) extend the part i'm on about to cover more of your subject matter and less of what's not anywhere to be seen 3) make sure your nav has Pascal and .NET in it. 4) actually turn them into proper links i like what you've got so far though for definite Cheers Mark
  12. [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=37442\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=37442[/a]
  13. [!--quoteo(post=350736:date=Mar 1 2006, 07:02 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Mar 1 2006, 07:02 PM) [snapback]350736[/snapback][/div][div class=\'quotemain\'][!--quotec--] I have a select box (multiple select) that I fill and it has about 200, give or take a few, items in it. In IE, the downward scroll button fails fairly consistently. The upward scroll button works fine all the time. Has anyone else seen this? Does anyone know why it might be doing this? Using the scroll wheel on the mouse works fine as well. [/quote] i have noticed it before but it's very hit and miss and has generally depended on if i've used any custom CSS on the list. try adjusting the height of the selectbox by 1 more or less item and try again, as that's also helped in the past.
  14. for the second step, you're only really gonna know your answer after you've compared what the person types to the database, in which case you're gonna need to let the submit go through and do your checks in php itself. all you need really is to make each field that requires an entry take on a default value, so that when the page reloads after submit, the user won't have to retype in all the fields again. then just set an error message in php if already exists, and when you draw your form, display the error message. validation is one of those things that i hate to use javascript for, just incase the user has it turned off - so as youre submitting the form, you'd be good to do another check (using php) to make sure the fields have been entered correctly. Cheers Mark
  15. spot on, thanks guys. unfortunately i've had to do the backtick workaround, as it was the difference between changing several hundred parts one by one or changing just a small section of code. but definitely one i'll keep in mind for future projects! Cheers Mark
  16. Hi all I'm not new to php/mysql, but have pretty much been working as I go along. I came across a problem today when i wanted to name one of my tables 'references'. I noticed that phpmyadmin was dealing with it fine, and my scripts were causing all sorts of trouble. The only difference between my scripts and phpmyadmin was that phpmyadmin was enclosing table and fieldnames with a ` mark (like a backwards apostrophe for anyone that can't see that) So ... my question(s) ... is it good practice to do this to ALL my table names? does it matter apart from when a tablename may share it's name with a mysql function/operator? Cheers Mark
  17. type 'htmlarea' into google. i'd give you a specific link, but there are so many that vary in quality, functionality, etc, that youre best looking for your own. there are some good freebies out there.
  18. ok before i start, just need to say that i'll be using tables for this, not divs... Hi all right then - in a situation where i have an unknown quantity of button tabs and a <TABLE> for each one, how do i cycle through a group of tables and hide them all bar one? - how do i setup the tables? (ie, name and ID) - what's the code to cycle through all the tables and hide them? ie, a nice, clean 'for' loop? in a nutshell, i know how to show/hide individual tables by referencing it by its ID and changing its style - display:none, etc, but how can i have an 'array' of tables where i can use one simple function to hide them all? hope someone can help Cheers Mark
  19. redbullmarky

    RANT!

    [!--quoteo(post=349604:date=Feb 26 2006, 05:43 PM:name=rgrne)--][div class=\'quotetop\']QUOTE(rgrne @ Feb 26 2006, 05:43 PM) [snapback]349604[/snapback][/div][div class=\'quotemain\'][!--quotec--] <RANT> To everyone out there who designs websites: Please, please, please. please. PLEASE! </RANT> There, that feels better. Think I'll try another one tomorrow [/quote] does the <rant> tag validate in XHTML 1.0 ? lol
  20. right, i'm gonna have a stab at critiquing a News site without sounding like a hypocrite, any any shameless plugs/references to my own site are unintentional... 1,starting from the top. the banner could use some work, as anything 'blurred' is really painful on the eyes. took me several attempts to get this backdrop effect, before giving up and giving it to someone else to do for me. i think the biggest problem with blurred backgrounds is that foreground items don't sit ontop too well. also, IMO, the main banner logo should always be a quick clickback to the main homepage, as it's kinda what people just expect. 2, the blurred grey background i've heard mentioned previously has crept back in, and it really makes the whole thing very hard on the eyes. same reason as number 1 above. 3, your nav. i'll be careful here, cos my own needs alot of work. but the 3D type buttons don't work so well, bold text doesn't look right, and greyed out items implys that the item is unavailable rather than having a submenu. can you use some form of right-aligned arrow instead of greying it out? also i think that you could get away with making the nav a bit wider and more prominent, as it kinda looks like it's squashed away and is floating on the page. 4, google ads. if you CAN afford to lose these, lose them. the easiest way to totally screw up a site is to use the bog-standard google text ads, especially for a more serious news site. 5, the content. you really need to come up with a better way to present the info. not just layout, but style. you literally just present all the text, headings, etc in bold text which doesnt really do much. i spend hours looking at news sites like the bbc, times online, the onion, the sun, etc before i even loaded dreamweaver to start mine off. you may benefit from an image or two in there too, especially for the headlines. 6, the footer. seperate this from your main content area, as it just looks like it kinda 'floats' on the page a bit. all in all, a site that's a portal to other sites can always be popular, as it can easily be used as a one-stop-shop that covers everything. however, do your research - maybe you should actually look around the sites that you link to, and see what makes them so good, nice and popular. once you've got your main style sheet and layout sorted, everything else just falls into place and evolves. Cheers Mark
  21. thank you for your comments! [!--quoteo(post=347696:date=Feb 20 2006, 07:33 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Feb 20 2006, 07:33 PM) [snapback]347696[/snapback][/div][div class=\'quotemain\'][!--quotec--] 1) I think the menu could use some work. [/quote] yeah i think youre right. it has been mentioned before that the menu is a bit rubbish, and considering it's the main way of getting around it could do with more work than it HAS had on it :) [!--quoteo(post=347696:date=Feb 20 2006, 07:33 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Feb 20 2006, 07:33 PM) [snapback]347696[/snapback][/div][div class=\'quotemain\'][!--quotec--] 2) Colors, colors, colors. I'll say it again, colors. [/quote] point taken. i've picked up more from you about colours than anyone, so a point not to be ignored. the green does actually look a bit out of place, especially since i added a newspaper-clipping theme behind the logo. it's just a solid block of colour surrounded by 'activity'. as for the FAVICON - that's just pure laziness on my behalf. basically, i was getting thousands and thousands of errors due to missing favicon file (still working out why) so i used one temporarily from my company website to keep things under control whislt i got on with other stuff. but yeah youre right - the logo looks stupid in a way and doesnt site in with anything lol [!--quoteo(post=347696:date=Feb 20 2006, 07:33 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Feb 20 2006, 07:33 PM) [snapback]347696[/snapback][/div][div class=\'quotemain\'][!--quotec--] 3) I do like the scroller thing you have at the top... it's not over-the-top annoying. However, it probably wouldn't hurt to throw a light grey border around that as well. [/quote] the latest news ticker? again, point taken. sometimes i actually thing it looks a bit odd sitting above the page title... [!--quoteo(post=347696:date=Feb 20 2006, 07:33 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Feb 20 2006, 07:33 PM) [snapback]347696[/snapback][/div][div class=\'quotemain\'][!--quotec--] 4) Fonts. [/quote] my font family in my CSS is Trebuchet MS, Tahoma, Verdana, Arial. i DID have Georgia, and it looked GORGEOUS on my mac when i first tested it. however, the PC (FF and IE) didnt agree so much and it looked a bit nasty. i'll have a play around with this - ideally, i need a quirky font that looks good on ALL browsers, that definitely ISNT comic sans lol [!--quoteo(post=347696:date=Feb 20 2006, 07:33 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Feb 20 2006, 07:33 PM) [snapback]347696[/snapback][/div][div class=\'quotemain\'][!--quotec--] 5) The concept: I'm not crazy about it, but it is sort of growing on me the more and more I use the site. It's definately not a typical forum setup, and I can't decide whether that's a bad thing or a good thing. What I think it may turn into is more of a comment system than a thread-response type system. I don't really see the migration of news-article + normal thread talk going on in a layout like that. It's almost unnatural. [/quote] yeah it's definitely odd, and i've resisted the temptation to 'normalise' it, as it seemed to fit well in with the concept of the entire site. the ability for a user to interact to everything on the site was the most important thing i was thinking about when putting things together. [!--quoteo(post=347696:date=Feb 20 2006, 07:33 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Feb 20 2006, 07:33 PM) [snapback]347696[/snapback][/div][div class=\'quotemain\'][!--quotec--] nitpicky: link to newest member in "stuff" area on main page is unreadable. [/quote] yeah the colour clashes with the BG if i'm right? [!--quoteo(post=347696:date=Feb 20 2006, 07:33 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Feb 20 2006, 07:33 PM) [snapback]347696[/snapback][/div][div class=\'quotemain\'][!--quotec--] search engine submission of nothing doesn't really do anything... it just seems to return me to the page I was on. There should be some kind of warning of incorrect usage. And if I put in some PHP code to the search engine, it kinda screws up the input box... you might want to check for <?php and ?> and scrap any results if you see em. [/quote] that's the ticket. after spending the entire today recovering my other computer from a complete wobbly and losing 2 years worth of stuff, i think i've learn a few lessons about backups and security so things like that definitely help alot!!! Cheers Mark
  22. [!--quoteo(post=346384:date=Feb 16 2006, 02:48 PM:name=Javizy)--][div class=\'quotetop\']QUOTE(Javizy @ Feb 16 2006, 02:48 PM) [snapback]346384[/snapback][/div][div class=\'quotemain\'][!--quotec--] Yeah buttons and stuff would cluster things. Something like a simple set of Index > Forum > Topic links at the bottom on one side, and the page numbers on the other would be good. [/quote] i got a breadcrumb-type thing at the top of the pages - you reckon then that i should also put it at the bottom of the pages?
  23. Hi all I've recently added some mod_rewrites to a htaccess file, turned of transparent session ID's, etc, with the aim of helping my pagerank and just to keep things alot tidier. here's one of them: RewriteRule ^news(/[0-9]*/[0-9]*)?/article([0-9]*).htm(l)?$ news/article.php?id=$2 [L] which basically allows things like: article345.htm -> article.php?id=345 now - all my articles have already been picked up by MSN Search and are starting to get crawled by google. how can i make sure that all these old pages are replaced in Google and MSN, etc with the new, user-friendly article names? i tried this: RewriteRule ^news/article.php?id=([0-9]*)$ news/article$1.htm [r=301, L] but i get 500 internal server errors. Anyone know what i can do? Cheers Mark
  24. cheers all moberemk, i've tried various things in the right hand column, such as related articles, links to other sections of the site, etc, but it does seem to detract from the whole concept and looks even more confusing. having said that though, i'm still looking at other ideas for the right hand column, but it's really gotta be right for the forum/site/uniformity/consistency throughout the site as a whole. Javizy, youre right about the nav so i'll have a look at things i can use to spruce things up and make things easier to skim around. only thing i don't want to do is to overcrowd things with buttons and stuff, as i think by sticking to my guns, the 'basic, no frills' approach could really work well. it's safe to assume that people who use phpfreaks, etc, are computer literate and just know how to get around complex forums. i'm actually targetting people from all walks - so that even someone who hardly ever uses a computer will be able to find their way around and get involved. glad you find the new way a bit better though! jcombs_31 i did at one point find my own eyes skimming all over the place to find stuff lol i think it's always harder when you make things yourself to actually see these things that make it confusing for other people. hopefully i've done enough to make it a bit more easy on the eyes. any more thoughts, feel free to comment! Cheers Mark
  25. [!--quoteo(post=345786:date=Feb 14 2006, 07:49 PM:name=Javizy)--][div class=\'quotetop\']QUOTE(Javizy @ Feb 14 2006, 07:49 PM) [snapback]345786[/snapback][/div][div class=\'quotemain\'][!--quotec--] Not sure if it works for me. Seems to take longer to scan through them, so I imagine that if there were lots of new topics and posts it would get annoying eventually. Good effort in trying something new, but with the way forums have been perfected I'm not sure this is an area you should try reinventing the wheel on. [/quote] valid comments from everyone here, and all taken on board. i'm solidly sticking my ground on the concept/theme of this one, but i've kinda had a (slight) compromise. here's the old one: [a href=\"http://www.thedinnertimes.com/forum/forumbak.php?fid=2\" target=\"_blank\"]Forums - Old Topic layout[/a] [a href=\"http://www.thedinnertimes.com/forum/forum.php?fid=2\" target=\"_blank\"]Forums - New Topic layout[/a] any thoughts on the new layout? slightly easier to digest?
×
×
  • 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.