redbullmarky
Staff Alumni-
Posts
2,863 -
Joined
-
Last visited
Never
Everything posted by redbullmarky
-
cool. doesnt seem to do what i need it to though - it'll stretch the screen down, but no wider than my current screen size, and it's the width i need to blow up. still, a useful tool nonetheless for otherstuff so i'm keeping it - thanks for the tip! Cheers Mark
-
Solved (thanks red)flush, then redirect
redbullmarky replied to Ninjakreborn's topic in PHP Coding Help
if youre using a 'header: location', it will not be actioned until the script ends. so if you have anything after the redirect line that displays, you'll end up with the error. after your header line, stick an 'exit': [code] <?php header("Location: /somewhere.php"); exit; ?> [/code] in an ideal world, you should never do any validation like this after ANY form of content has been written to the screen. all your logic should be done and dusted before you even contemplate using echo or outputting HTML. this way, you can use the code I posted without too many issues and without even needing to use output buffering. so [code] <?php // ... all your validation stuff goes here // ... if any errors, redirect code goes here // ... include your header here // ... body here // ... footer here ?> [/code] -
anyone know of any plugins for either IE7/FF/Opera (PC) that allow you to simulate different screen resolutions? I'm not talking about a simple Zoom here. I'm talking about rendering my page with my page believing that it's actually being viewed at a larger resolution. I'm only on a 1024x768 and cant up it any further, but it'd be useful to see what those with bigger monitors sees. Cheers Mark
-
you could do much worse than download a copy of [url=http://tinymce.moxiecode.com/]TinyMCE[/url]. A nice little cross platform wysiwyg editor.
-
first impressions are pretty good. however - your graphical elements far outweigh the text, etc for quality. the images kinda give a 'quirky' and friendlyness, whereas the text undoes it somehow. i think maybe the bold, solid black is possibly one of the reasons. there are two sites that might be worth looking at for inspiration on how you can make things a little better. http://www.toysrus.co.uk/ http://www.tomy.co.uk/ ok, so they're both kids toys sites, but they have a similar feel to them and both employ shopping carts. hope that helps Cheers Mark
-
personally - Cake and CodeIgniter, but only because 'under the bonnet' is nice and simple and the manuals/support is pretty good on both. My interests were to write my own framework, rather than use either, so my reasoning maybe a little different. I liked the structure/workflow of both. Installing both properly (including first configuration) is the only tricky bit. Actually using them is much easier as long as the 'restrictiveness' of MVC makes sense to you. Read the parts of the CI manual concerned with M/V/C itself, not just CI's features, and eventually things will click into place. Don't be put of by the learning curve of frameworks in general. Enough gets said about the Zend Framework, but personally I think it's more of an overblown, heavy demonstration of best-practice, rather than something i'd enjoy using (ZF fans - not trying to start a debate in this thread - start another if you wanna go ;) ). There are others, but Cake and CI are the only ones that truly stuck.
-
shaggy, good call. i've been a fan of that for months. having studied it a bit more, i'd say there ARE better frameworks (having said that, codeigniter is fairly new in comparison) but the online manual over at CodeIgniter is possibly the best, most laymans description of MVC i managed to find - the manual is worth checking out, even if you dont like the framework.
-
looks like you sorted it, and all looking better ;)
-
if you're inserting <p> tags, and then running it through nl2br to display the content, you're gonna be left with big gaps between paragraphs. the ads are fine in this case, they're kept discrete and fairly tidy, and dont take over your layout like they're trying to make some point (apart from the ones between articles. you may just be ok with the ones down the side) i vaguely remember the first version of this site that you posted. things have come a long way. good stuff!
-
;) no worries. it's only been freely available since earlier this year - generally that sort of information costs a fortune. for anyone that uses it, be warned - importing 3m records into a database can take SOME TIME, and then there's the job of indexing it properly. and if you wish to go a step further, there are two further database tables to set up. an ISO and a FIPS one. one is for regions around the world, the other is for american states. For those of you that like to belong to 'England', 'Scotland', 'Northern Ireland' and 'Wales', and not the UK/GB, there's a bit more work to do, but all the data is there.
-
what should you do? dont let the old businessman come back. he didnt listen to advice or anything, didnt seem to do much, made wild claims that couldnt be backed up. the new one seems to listen, apply (ie, show that he gives a toss about what others suggest), and has removed tonnes of crap which could only be described as waffle. dont feel you need to tell the world your life story. its a fact that the most interesting people in this world are the ones that talk about you, not themselves, and just get on with things.
-
yeah i disagree about the logo. left/right aligned always better, IMO. agreed with your other points though. this is a nice little reference (apart from being another Web2.0 reference grrrr...) that i've actually used a few times. love or hate "web 2.0", you have to admit some of the colour schemes do look quite slick: http://www.modernlifeisrubbish.co.uk/article/web-2.0-colour-palette might help you pick a better colour for your side nav. i'm with steelman + 448191 on this one - its been a long time coming, but congrats for the improvement. now it's in the realms of a site that needs improving to make it finished, rather than before when it was in the realms of awful and amateur.
-
well one step better (depending on how you look at it) - http://www.maxmind.com/app/geolitecity every city in the world. cities come with region codes, which you'll need to cross reference with another (MUCH smaller) database table, but if you have a hunt around on the same site, you'll find it. hope it helps! cheers Mark
-
you could, but it's best to deal with your errors rather than hide them. especially as considering your query, an undefined index (and hence no value) would make your query fail. ([b]edit[/b] which is what your reply you just posted has shown) replace the query line with the following: [code] <?php if (isset($_GET['id'])) { $query = "SELECT * FROM news WHERE id = {$_GET['id']}"; } else { $query = "SELECT * FROM news ORDER BY date DESC LIMIT 10"; } ?> [/code] which means if an ID is passed in the URL (notice the 'isset' check), then that record will be picked and displayed. otherwise, the latest 10 records order by most recent first will be displayed. cheers Mark
-
in short, it's read only. only the OP can reply (to bump/add) to their posts. if you wish to speak to a freelancer about work, contact them directly.
-
assuming you've got a column/field for the date, then something like: [code] <?php $query = "SELECT * FROM news WHERE id = {$_GET['id']} ORDER BY date DESC LIMIT 10"; ?> [/code]
-
yeah thats what i meant - after steelmans suggestions. y'know, i'm a little indifferent to both the cream and the old blue colour. as the cream is different, i'd go with that. you can always change it once you get a bit more confident with the theming of things. can you vertically align the footer text and move it off its left/right edges a touch?
-
DONT ADJUST THE LAYOUT ANY MORE. I RECKON YOU'VE NAILED IT :) i actually (for some reason) like the fact that the right hand side has not been closed by a border, which would have been tempting. had a little chuckle at the trouble you're having right this second with the footer alignment. only cos i've had the same problem earlier and all too tempting to use a table... as is the footer, drop the size of the text a little. Thoughts and Guidlines. capitalize the T and G i think what you're probably missing now is some icing. The cake has been baked, but it's a bit of a bland Victoria Sponge. Maybe some faint backdrop images may work. the resources sticky at the top of website critique will give you a few links to free stock photos, just to liven things up a touch.
-
:D :D :D funny thing is, i had to look it up. in the dictionary.
-
on this line: [code] <?php $query = "SELECT title, news FROM nyheter WHERE id = $_GET['id']"; ?> [/code] have you actually made a database table called nyheter yet?
-
needs tonnes of work to it, but it looks better. sort out the colours of active/visited links, as they clash too much with the background. and change your font so something nicer. Verdana/Tahoma, etc. Also, that big blue square on the right of your logo looks terrible. [busi]mild_pat_on_the_back[/busi] ( ;) )
-
[code] <?php $filename = 'mypic.gif'; list($filename, $extension) = explode('.', $filename); echo $filename; // mypic echo $extension; // gif ?> [/code] should do the trick
-
that'll be because you havent got an 'id' in the URL. tack on a rediger.php?id=1 or something to your URL and try it out. you'll need to decide what you want to do in the event that 'id' hasnt been passed in the URL, and put in a check to handle it before you query the DB
-
i dont want to sound rude here, but Tami, the reason why many of us "pick it up quicker than others" is because we started with the basics. I only personally started PHP about 3 years ago, and AJAX was not really something that ever got discussed, never mind used, so I/we had to make do with the traditional way of making the page refresh the normal way. So did most other sites - only recently have they really thrown everything at AJAX, and not without their problems. Nailing the basic/normal/old way (and a basic understanding of both PHP and Javascript as seperate entities) enabled us to at least understand about requests - then stuff like AJAX kinda just comes as a natural progression on top. Again, I dont want to sound critical/assuming or rude, but generally when people want to use AJAX but dont know the basics, they: a) dont really need to use AJAX b) want to use it cos its a nice trendy bandwagon that everyone else is jumping on. Ask yourself - do you really need it right now? Can you not get your site operational without it, and introduce it later when you understand it more? Even if you DO manage to get AJAX working, your lack of understanding of it will leave your site so full of security problems you'll have tonnes more issues in the long run. Seriously, AJAX is alot more than just refreshing a DIV with fresh data from the server. You'll eventually realise that its a whole topic of security ontop, too. And reading through this thread, it's probably wise not to run circles around/dismiss ober on this (or many) subjects, as it's kinda well known around these parts that he's pretty educated as far as both PHP and AJAX are concerned, along with all its issues. You could learn alot just by taking his comments on board properly. Cheers Mark
-
[quote author=neylitalo link=topic=117241.msg478203#msg478203 date=1165198800] oh, come now... you're sure you can't get along with [ url=http://www.php.net/echo ]echo[ /url ]? ;) [/quote] hey, i said it was for the lazier ones ;)