redbullmarky
Staff Alumni-
Posts
2,863 -
Joined
-
Last visited
Never
Everything posted by redbullmarky
-
yeah that was a good article that kinda helps put weight behind a cost argument. i did disagree with some of the comments regarding people who do it for a cheaper price are damaging other people, etc. i'm charging a rate that personally i'm happy with, but is much less than the "standard" (relating the article to coding here, not design). however, it feeds my kids, pays the bills and i get repeat work, and leaves me feeling satisfied, not cheated - so i'm not all that arsed. i did like one comment though: [quote] "There was an engineer who had an exceptional gift for fixing all things mechanical. After serving his company loyally for over 30 years, he happily retired. Several years later the company contacted him regarding a seemingly impossible problem they were having with one of their multi-million dollar machines. They had tried everything and everyone else to get the machine to work but to no avail. In desperation, they called on the retired engineer who has solved so many of their problems in the past. The engineer reluctantly took the challenge. He spent a day studying the huge machine. At the end of the day, he marked a small "x" in chalk on a particular component of the machine and stated, "This is where your problem is". The part was replaced and the machine worked perfectly again. The company received a bill for $50,000 from the engineer for this service. They demanded an itemized accounting of his charges. The engineer responded briefly: * One chalk mark $1 * Knowing where to put it $49,999" [/quote]
-
akitchen mentioned it, but i have a certain rule of thumb these days. if it needs protecting from access, put it below the web root. all my framework and other scripts go here. i actually do this with images too in the event that i want to restrict access to certain files. anything to be served directly to the user goes above the web root. once you get used to how to serve these files and include them, etc, you'll find it gives a little more peace of mind than just protecting a directory.
-
there's also the chance that (if you had an site before the current one) that certain pages are still in the bots/web crawlers index so they still try to index them. accesses, successful or not, all show up in your log files.
-
[quote author=heckenschutze link=topic=112507.msg456745#msg456745 date=1161689759] [url=http://php.net/session_set]session_set()[/url]; MUST be called before any output is sent to the browser (eg spaces or HTML), [url=http://php.net/session_set]session_set()[/url] should idealy be the topmost thing in your website. The manual also mentions this :) hth. [/quote] session_set doesnt exist as a function, but otherwise you're right. it's [url=http://www.php.net/session_start]session_start[/url] instead. cheers
-
[quote author=jeffpoulsen link=topic=112522.msg456741#msg456741 date=1161689379] I'm having trouble getting the new line \n to work in a simple fwrite line. The code is below: fwrite($fh,$today) This Works fwrite($fh,$today"\n") This does not These line are straight out of the book I'm using to learn PHP. I have read about using <br> instead but can't get that to work either. [/quote] you need to seperate the quotes and the variable. either way here will do: [code] fwrite($fh,$today."\n") // does now! fwrite($fh,"$today\n") // does now! [/code]
-
it's not pretty. it has a charm about it, but mostly a nostalgic one that takes things back to the 90's. having a look around, it's apparent that you probably have a useful understanding of coding, but really, the design itself is pretty grim. back to the days of default fonts, hit counters, grey, etc. add a few animated GIF's and you truly have a 90's staple site. i wont comment on what i think of txt spk used anywhere else apart from a conversation. i think you should take a look at CSS and try and work somewhat on your layout. I'm not a massive fan at all of frames, personally. the [url=http://www.phpfreaks.com/forums/index.php/topic,79168.0.html]Resources[/url] at the top of the 'Website Critique' forum for some ideas. Pick yourself some colours, find a site you like, and try and figure out why you like it.
-
maybe if photos arent too possible right now: what about your 'vote' panels? those could easily be jazzed up. a touch of colour in your site elements would give them seperation from the actual content - still leaving a busy site and maintaining the point, but just making things easier to follow around. your logo/nav/top panel in general/vote panels, etc, all fall into this category. it's pretty amazing how much those green arrows do to liven things up (i didnt notice them when i first looked, so not sure if they've recently been added). looking forward to seeing it develop further! cheers Mark
-
again, the links on the google search i mentioned previously also discuss other issues and solutions - most notably the user comments that go with the articles. take another look.
-
i'd post a handful of stuff/links, but a quick google search bring up some better explained reasons, all on page 1: http://www.google.co.uk/search?hl=en&q=mysql_real_escape_string+vs+addslashes
-
i'm not sure of your question here, if there is one. however, i'd suggest that a function that turns register_globals on or off is a waste of time - mainly because you should always code without needing it on, and because it's gonna be disappearing with the next version of php anyway. same goes for magic quotes - the problem with having a function that turns it on or off is that you'll wind up coding different projects in different ways depending on whether you 'decide' to have it on or not. keeping coding consistency will help you expand the project in the future when you come back to it. i never personally touch the php.ini file after one initial setup. turning display_errors off, register_globals off, magic_quotes_runtime, etc, all off. the only thing i EVER need to change in terms of PHP settings is error_reporting/display_errors/display_startup_errors all go on, but i always do these in a htaccess file so that if i move my project to a different server (which is 99% the case when developing for a client on your machine before putting it on theirs) - that way, i dont need to remember what settings in my PHP.ini file i need to set on a clients server. also, using ini_set for errors doesnt really work for me. in the event, for example, i get a file that has a parse error - missing bracket, etc. as this means the file wont be parsed at all, neither will the ini_set line - meaning you're gonna be facing a blank page facing the mundane task of debugging your code. seriously, if you can't beat 'em, join 'em - i've mentioned it before, but i chose the [url=http://www.codeigniter.com]CodeIgniter[/url] framework to model my own framework on, because its very simple, mostly well written, and (with a few slight changes to the structure) very easy to build around, with a plugin architecture so that things only get included if they're required by certain scripts. also based on the MVC pattern (which i dont know what i was ever doing without it) and tidy URL's. i have a single copy of my framework on my server, and so far i have about 3 development sites that are using it already. and adding extra functionality just requires me digging into its code, making some changes, without worrying about breaking a thing. seriously, take a look at it - even if just for educational purposes. you'll pretty soon realise that incorporating your own custom error handling routines, debugging scripts, logging scripts, etc, is as easy as pie and far outweighs mucking around with settings all the time. cheers Mark
-
this one's even easier. in HTML, EVERYTHING is relative to the docroot - so just use a trailing slash to reference the root of your website. works for anything HTML - css, javascript, etc. [code] <link rel="stylesheet" type="text/css" href="/css/global.css" /> [/code] hope that helps cheers Mark
-
when it comes to using 'common' files, i always tend to find $_SERVER['DOCUMENT_ROOT'] works quite well, as it then doesnt matter whether the common file is included from a file in the root, a sub dir, a sub sub dir, etc. common.php: [code] <?php $docroot = $_SERVER['DOCUMENT_ROOT']; include($docroot . '/master/config/config.php'); include($docroot . '/master/somethingelse.php'); include($docroot . '/helloworld.php'); ?> [/code]
-
it's from BBSpot.com, but it says in the article: [quote] When contacted by BBspot.com, Brett Tyson said [/quote] pretty funny :)
-
[quote author=neoform link=topic=112435.msg456347#msg456347 date=1161616367] what's the encoding issues? [/quote] take a look: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.newsique.com%2F that'll probably give you a bit of a clue of what's going on. not sure on the photos thing. even the BBC seem to get plenty of their photos from Getty, so youre right - would prob cost a hefty sum unless you use relevent free stock photos. however, photos aside, maybe a touch of colour would still have the desired effect of livening it up slightly. it's not bad - just think that it could be improved slightly that way.
-
[quote author=Daniel0 link=topic=112251.msg456332#msg456332 date=1161614183] Yeah. It would require a ****load of satellites. [/quote] and kleenex.
-
[quote author=Daniel0 link=topic=112251.msg456316#msg456316 date=1161613140] "Google Earth Real-time" would be cooler :D [/quote] I doubt google could keep up with everyone accessing the 'live' maps of the nude beach at the same time. however, when you see the geeks outside with their laptops, waving at the sky, it means Google managed it.
-
hmmm i actually like it. very concise, etc. my only gripe is that the huge amount of content makes things appear a little too busy. i think an image or two and/or maybe even a touch of extra colour just to break things up a bit may do the trick. i think you could use a logo, too. whilst what you have is not bad, generally it seems only 'parking' sites use text as their logo. i also have a problem with including the ".com" in the logo, but that's another story and a personal preference, rather than a major issue. there are also encoding issues which prevent the site validating. otherwise, good job me thinks cheers Mark
-
i kinda feel that the way you've presented your code there is gonna make it hard on you to get your head around. if you're gonna open/close php tags, then close PHP and use HTML in this case: [code] <?php ...blahblahblah ?> <div class="homebar2"><h1><?php echo $name; ?></h1></div> <div class="hotel"><?php echo $image; ?></div> <div class="hotelcontent"><?php echo substr($description, 0, 300); ?>...</div> <h3><img src="<?php echo $star; ?>" hspace="2"></h3> <?php } ... blahblahblah ?> [/code] that'll make it a million times easier to debug/change in the future and you'll see that all i've done is added three dots right after the description is echo'd cheers Mark
-
have you actually tried just putting [url=http://uk2.php.net/strip_tags]strip_tags[/url] around the relevent part? [code] <?php // List the hotels echo "> <div class=\"homebar2\"><h1>".$name."</h1></div><div class=\"hotel\">".$image."</div><div class=\"hotelcontent\">".strip_tags($description)."</div><h3><img src=\"".$star."\" hspace=\"2\"></h3> \n"; }?> [/code] however, i have a nagging feeling that when you say 'strip tag' and 'more info button', you actually want to limit the amount of text that shows in the description, like just a summary? if so, have a look at [url=http://uk2.php.net/substr]substr[/url] as it's pretty common to use when showing a summary with a 'more' link/button. [b]ps:[/b] the open/closing php tags for no reason are caused by Dreamweaver after you've inserted several of their built-in server behaviours. if you see back to back tags, you can safely get rid of them to tidy things up a little.
-
ok it's pretty safe to say that you have an error, only your PHP.INI is probably set up to not display errors. i've not gone through the code with a fine toothcomb, but in your PHP, you have this: [code] $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $name\n" . "Email of sender: $email\n" . "Photo ID: $pid\n" "House Name: $housename\n" "Adress : $ad\n" "Adress 1: $ad1\n" "Adress 2: $ad2\n" "Adress 3: $ad3\n" "County: $county\n" "Postcode: $pc\n" "Phone number: $phone\n" "A4 quantity: $A4Q\n" "A5 quantity: $A5Q\n" "A6 quantity: $A6Q\n" "Format : $format\n" [/code] which has no dot (.) at the end of each line to join the strings together, and no semicolon (;) at the end. put a dot at the end of the rest of the lines (the first 5 already have them) apart from this line: [code] "Format : $format\n"; <-- i added a semicolon [/code] if you have the means to do it, open your PHP.INI file and find a line that says 'display_errors' and make sure it says [b]On[/b] which will make it easier as you'll at least get a proper description of your error. cheers Mark
-
[quote author=AndyB link=topic=112142.msg455943#msg455943 date=1161549175] When the mighty IT speaks by email ... everybody listens, nobody asks :) [/quote] lol reminds me of a brilliant scene in The Office: http://www.youtube.com/watch?v=5DMV5e8I34Q hilarious stuff, and probably sums up many IT Techs the world over...
-
[quote author=lazi link=topic=112356.msg455912#msg455912 date=1161546362] whenever i press the submit button on the form it just trys to link to the script as a page. I am also unsure of whether the script proofreads right not being an experianced php writer! [/quote] can you elaborate on this a little? also,be a little more patient :) you've posted a fair bit of code which is mindnumbing to go through to "guess" what the problem is if you dont explain the problem exactly. imagine how many times a script gets posted on here with the claim "it dont work" without anything else... drop a better description of errors, etc here, crack open a beer, put your feet up and chill :)
-
the best place to start is the mysql LIMIT clause, which you tag onto the end of your SELECT. it takes either 1 or 2 parameters - 1 if you just want to pick a certain number of rows, 2 if you want to pick a certain number of rows starting from a particular record - which is what you need for pagination. there's a tutorial right here on phpfreaks that describes the basics well: http://www.phpfreaks.com/tutorials/43/0.php this, for example, will pick 5 records starting from the very first record (0 signifies the first record, not 1): SELECT * FROM mytable LIMIT 0, 10 this would pick 5 rows on "page" 3: SELECT * FROM mytable LIMIT 20, 10 pagination generally involves passing the page number in the URL and passing the resulting $_GET['page'] into your LIMIT clause. http://php.about.com/od/mysqlcommands/g/Limit_sql.htm here's a little example pseudocode to set you on your way: [code] <?php // how many results per page? $num_per_page = 10; // what record shall we start at? $offset = ($_GET['page'] - 1) * $num_per_page; $query = "SELECT * FROM mytable LIMIT $offset, $num_per_page"; ... etc ... ?> <a href="/mypage.php?page=1">Page 1</a> <a href="/mypage.php?page=2">Page 2</a> <a href="/mypage.php?page=3">Page 3</a> etc etc [/code] cheers Mark
-
unfortunately, it's not as straightforward as it would seem, as IE7 completely overwrites IE6. had a quick google search and came up with this that you can try: http://www.tech-recipes.com/internet_explorer_ie7_tips1188.html not sure if the rules changed since IE7 officially launched
-
the problem with your code is that the error suppressor (@) makes it hard to see what's going on in the event of something going wrong. remove it for the time being and try it again to see what error you're getting, if any. also, variables contained within single quotes will not be parsed. so you need to change your 'if' line to use double quotes: [code] if(!file_exists("$host_dir/$host_lang/$panel_id")) [/code] example: [code] <?php $test = 'hello world'; echo '$test'; // outputs: $test echo "$test"; // outputs: hello world ?> [/code]