Jump to content

Is PHP the right tool for this?


php-challenged

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.