php-challenged Posted August 6, 2008 Share Posted August 6, 2008 Hello, This is my first post on the boards, and it so follows that my knowledge of PHP is just as limited. Long story short: I'm trying to modify the styling of a phpBB board, and so far it's been going fairly smoothly (basically all CSS - stuff I know). I've now stumbled across a bit of a problem. Given the complexity (i.e. awesomeness) of the style I'm trying to create, I need to apply a certain # of DIV elements based on what is being displayed on the page. I'm not used to thinking of Web design in programming terms, but here's what I've concluded: If DIV A is X pixels high, DIV B needs to be parsed Y times, where Y depends on X. The above example is a bit simplistic, but it serves to ask my question as to whether PHP is the correct tool to use for this sort of thing. Can PHP be used to 'read' the height of a given DIV, and parse page elements (DIVs or otherwise) accordingly, based on a set of conditions I give it (if statements, etc.)? How about modifying the height of a DIV (i.e. overriding any CSS values) to the nearest multiple of a given value, based on the height of another DIV? Link to comment https://forums.phpfreaks.com/topic/118387-is-php-the-right-tool-for-this/ Share on other sites More sharing options...
DamienRoche Posted August 6, 2008 Share Posted August 6, 2008 No, I wouldn't have thought PHP was the way to go with this. I'd say JavaScript is your solution here. PHP is for the server side, you would have to refresh the page or part of the page to run the script over. Saying that, I am no PHP Guru so I'm not sure if it would be more beneficial if you could produce the code. Good luck. Link to comment https://forums.phpfreaks.com/topic/118387-is-php-the-right-tool-for-this/#findComment-609256 Share on other sites More sharing options...
jjmusicpro Posted August 6, 2008 Share Posted August 6, 2008 True Javascript is the way to go. Link to comment https://forums.phpfreaks.com/topic/118387-is-php-the-right-tool-for-this/#findComment-609258 Share on other sites More sharing options...
discomatt Posted August 6, 2008 Share Posted August 6, 2008 Javascript would be best. It IS possible to do with PHP ( some avoid client-side scripting like the plague ) but you'd generally have to make assumptions and it wouldn't be quite as exact when dealing with blobs of text. Link to comment https://forums.phpfreaks.com/topic/118387-is-php-the-right-tool-for-this/#findComment-609303 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.