redbullmarky
Staff Alumni-
Posts
2,863 -
Joined
-
Last visited
Never
Everything posted by redbullmarky
-
you'll need to be specific about what the script is/isnt doing. do you get errors? do you get anything output to the screen at all? as you're involving the database and the filesystem, each which can cause problems other than the PHP script alone, it's hard to tell just from looking at it...
-
Problems with positioning table when including files
redbullmarky replied to Eric035's topic in PHP Coding Help
theoretically you shouldnt really put anything between the HEAD and BODY tags. i'm guessing your problem though is your closing head tag: [code] <head> <title>.....</title> <head> [/code] should be [code] <head> <title>.....</title> </head> [/code] [b]edit:[/b] however, if that's a type in the code when you pasted it here, and is not actually the problem with your code, then there's a chance that the 'include' file might have something in it that echo's to the screen. hope that helps cheers -
sure, touch will create a file if it doesnt exist, but its primary aim is to alter the date/time of a file. what you want to look at is [url=http://uk.php.net/fopen]fopen[/url] which is for both opening existing and creating new files.
-
[quote author=hypnoticvibe link=topic=111212.msg452091#msg452091 date=1160913377] I have to ask - Is the banner too tall? It's at 177px. Any recommendation? Are the buttons too tall? They're at 74px. Any recommendation? [/quote] considering how much whitespace is left over and considering it means that (on 1024x768) the content doesnt really start til nearly half way down the screen, i'd say so. it doesnt look [i]bad[/i], just possibly a tad wasteful. i'd probably say you could shave a good 50 or 60 pixels off the main banner and 20-25px off the height of the tabs. i actually think also the lineheight of the main text is a little too large. you could safely do all this without 'crowding' everything, and effectively bringing the content almost all onto one page without the need for scrolling down the page much.
-
TBH, it does not look that different. I have a problem with the big column of whitespace on the homepage - the other pages seem to sort this out well. And it doesnt validate. You just need to work out a proper layout to give everything containment. some places you have far too much whitespace, some places you don't have any. So it's not bad - just needs some work to liven things up a bit.
-
Hi This might be a good start. I think it's primarily concerned with [i]detecting[/i] a mobile/PDA in the first instance but you should be able to find something from there. Generally you want to be working in % rather than pixels and try to cut down on the bells and whistles, but as long as your code validates, you should find that you wont face to many problems if you can overcome the size limitations. http://www.developershome.com/wap/detection/detection.asp?page=readHeader http://www.helpfuldesign.co.uk/blog/2006/03/browser-accessibility.shtml cheers Mark
-
[quote author=lead2gold link=topic=111439.msg451652#msg451652 date=1160770976] probably unix time.. it's the amount of seconds between now and Jan-1980. [/quote] just to correct on this point, a timestamp like this is the number of seconds passed since 12:00:00am, 1st Jan 1970.
-
you've wrapped your function in your 'while' loop - meaning it'll get redeclared on each iteration. move the function to the top of your script - underneath the [code] <?php require "forums/conf_global.php"; //because this file will not be located in the forums directory. ?> [/code] will do the trick.
-
calculating the difference in ems, and px's
redbullmarky replied to Ninjakreborn's topic in Miscellaneous
specifically, and hopefully to draw the curtains down, 'em' is the width (in pixels) of the letter 'M' (caps) for the particular font you're using, hence them name 'em'. so as stated by effigy, it changes with the font. [b]edit:[/b] in response to your post whilst i was typing mine - i've personally never used anything other than pixels and percentages. as for the others? i guess i'll know when to use them when i get to that stage. -
[quote author=fenway link=topic=111424.msg451624#msg451624 date=1160768384] Agreed... in general, one should never delete anything that has actually happened. EVER. [/quote] unless it involves your mistress, a camcorder and a wife who's a dab hand with a machete.
-
and to be fair, the function I use is one I wrote ages back and whilst it's worked for me, it's a bit crusty. looking at the one provided by Barand, his is much simpler - I'll probably be switching very soon :)
-
[quote author=MrLarkins.com link=topic=111422.msg451578#msg451578 date=1160764904] but i would use a function right? i know diddly-squat about those. [/quote] it's impossible to use PHP without some knowledge of functions. echo itself is a function. mysql_query is a function. the list goes on. i've written a function i often use for this purpose: [code] <?php // returns a persons age given their date of birth function getage($dob) { $exp = explode('-', $dob); // we now have the year[0], month[1] and date[2] $current = getdate(); // get an estimate of years $ret = $current['year'] - $exp[0]; if ($ret > 110) { return 0; // too old - possible no date parameter was specified } // have we reached their birthday month? if ($current['mon'] <= $exp[1]) { $ded = 1; // we arent gonna DEDuct a year yet // are we in their birthday month? if (($current['mon'] == $exp[1]) && ($current['mday'] >= $exp[2])) { $ded = 0; } $ret -= $ded; // deduct a year as this years birthmonth not arrived } return $ret; } ?> [/code] all it needs is a date of birth (YYYY-MM-DD format) and it'll return the age. so: [code] $age = getage('1980-01-16'); echo $age; // 26 [/code]
-
we could always redesign myspace. set up a script to create several hundred million random pages that don't validate, and insert some random animated GIF's and cheesy photos, and voila! just joshing as ultimately it's gonna need some proper coordination, i think it's fair to leave it to your, steelmans and phpfreak's discretion.
-
good point - but how much [i]really[/i] would we need to know? everything that needs to be here is here. the 'theme' is here. the 'topic' (ie, PHP) is here. maybe NOT knowing things covered by the NDA might be a spark for creativity and new ideas, rather than copycats and improvements? when you strip away most of the complexities, all you're really left with is something that delivers news, articles and forums.
-
hmm i hate the idea of feeling like a bully, like rounding on a "victim", but in this case it's unavoidable. BM, as you're so philosophical, maybe you should consider the following (very famous) saying: "Actions speak louder than words." Very very rarely have you come back with something that shoves our doubts back up our arses and proves us wrong. Are we being harsh? Nah...just realistic. and you do ask, after all. I've never personally known anyone so ignorant of help. You ask a question. It trails of a little. So you open another thread, closely related. Then you reply to someone elses thread saying "yeah, i had this problem too - look at my thread". and then, when you've totally ignored advice and as a result get hammered for it, you set up yet another thread asking "should i end my career? am i cut out for this?" - a thread which people advise you very critically, normally ending with something like "yes, i will do that!". then it's all back to square one. as ober said - kudos to Barand, one of the most experienced and knowledgable around these parts. I've actually looked at his code, and would say that in some cases, I think I could better it.However, in most ways, he'd wipe the floor clean we me. Same goes for ober, AndyB, obsidian, jcombs, Jenk, etc - some things i think i think i could do better (IMHumbleO), but mostly i'd be sitting back learning from these chaps. My point? No one is the master. Being the master of something means complacency - complacency means you will eventually be grounded. Being the master means being at the top of your game - being at the top of your game means you have nothing left to aim for. You also state that you have no time to redo your site for another 12-18 months, or whatever. So: a) what was the point in asking for critique if you're not gonna do anything about it? b) With all the time it takes you to write all your questions, I could have rewritten your site several times over. It would get hammered if I posted it in web critique - but not as much as yours does at the moment. So do yourself a favour - go away and do something that will show us that our help has not been in vain. Mostly I like you - your enthusiasm is great - but other than that, there's nothing there but talk.
-
ok cool anyone else agree with that? would phpfreak himself have a problem with it for any reasons? does anyone who has a clue how to kick this off and hold it all together wanna start the ball rolling?
-
register_globals is (rightly) turned off in your PHP.ini file - and should remain that way. to get the contents of id in the URL, use $_GET['id'] [b]edit:[/b] beat me to it :)
-
it's an open forum, so course it's your place ;) i actually couldnt agree with you more or put it better myself. the words "chill out" seem to be cropping up very often, so maybe it should be noted....
-
Jenk - am I right (at all) in thinking that many of these keywords such as 'abstract' and 'interface', etc are ways of forcing a particular behaviour/usage of a class, rather than actually doing anything functional?
-
i've looked into this one before, as a means of sending text alerts to candidates regarding jobs, etc. yes it's possible, but you'll generally need a service provider who actually send the texts - and each provider will have a different API for accessing the services. your first port of call should be to find a decent provider and then go from there
-
just so this stays fresh, as people generally seem keen, i've got a bit of a suggestion to kick things off. i see plenty of comments in "PHPFreaks.com Questions, Comments, & Suggestions" regarding what could be added/removed/improved, etc about this site. Sometimes I have to remind myself that there's more to phpfreaks than the forums - but i don't think i'm being unreasonable by saying that the main site possibly gets nowhere near as much attention as the forums. So not that it NEEDS it, but the fact that everyone currently reading this has some sort of feel for phpfreaks, and some sort of opinion on how good it is - possibly with ideas for improvement. i personally think that the forums are very detached from the main site - leaving me not many reasons to venture there. So whaddya reckon? Maybe launch a competition to design+build a new PHPfreaks (main site)? it doesnt necessarily have to be used, but would be a good exercise - and possibly even introduce ideas to phpfreak that were not previously thought about....
-
chaps - please take note of the original question. whilst this is all good, and i'm picking stuff up from the argument that i didnt know before, the arguments of hex vs dec, encapsulation vs constants, etc are not gonna help the OP. you both know your stuff - that's pretty obvious - but can you possibly stick to the topic and present a solution rather than a "best practice" argument? cheers
-
and once you've learnt everything there is to know, boredom sets in - then you move to something else and realised that you probably wasted your time learning instead of doing something practical. "those who can, can. those who can't, they teach"
-
in a basic nutshell: layers (<div> tags positioned and styled by CSS) are often much trickier to set up, but make it easy to do some pretty drastic changes to a sites layout if required. tables on the other hand are the reverse. they are very easy to set up, but tricky when it comes to modifications. also tables are slower to draw for most browsers than layers are. several months ago, i decided to make a site purely using CSS + layers. nothing complex, mind - just a nice, simple XHTML Strict site with a handful of pages. To say it was easy would be a lie, but i'm pretty chuffed i went down that road. once you get used to css, you realise how flexible things can be and how much more you can do. i'm not gonna harp on about how tables are for tabular data and how layers are for layouts, as there's no getting away from the fact that tables can be a nice quick way of putting a page together - or organising forms (i still use tables for non-tabular data occasionally). but i'd strongly recommend taking the time out to learn about layers (<div>) and CSS and pretty much guarantee you wont look back.
-
guys guys - back on topic please ;D the topic of encapsulation seems very irrelevent to the objective, as it's not ESSENTIAL to obey these 'rules' for what newb first asked. (although i'm with roopurt anyway a bit actually on this one. the idea of not using global constants or functions as it breaks 'encapsulation' seems slightly contradicted by using php's own built in functions, constants, etc.) i'm following this topic myself as i'm keen to find out more - so would be good if the initial question got answered without over complication ;)