...

View Full Version : divs and PHP problem :(



hefterbrumi
05-25-2011, 03:17 PM
Hi!

I am struggling with a problem. I have a footer on a page (its a generic page its not me who wrote it) and i have "adressFcb" tag nested in "footerlinks" tag. The thing is that I want to swap the two things.
I 'd like to make adressFcb tag and all the things it contains to appear within the footerlinks div, and then all the links (.implode(" | ",$arr).) to appear after.
Im not an expert in PHP and im struggling with the code.

I started to simply swap the to elements, and it worked, but due to some syntax errors (I presume) css didnt work at all. I tried to move everything in the same tag and got rid of the other, but again some difficulties came up becouse i do cant integrate this part : (implode(" | ",$arr).)

this is the original code:



if($arr!=array()) $res="<div class=\"footerlinks\">".implode(" | ",$arr).'<div class="addressFcb"> <p>Austria<br>Kertner 32<br>+36(9556)555625-57867<br>+44(35)23386-2876</p><a href="mailto:lafflo.kukac@ggh.net"><b> lafflo.hefg(at)ggh.net</b></a></p><p>*</p><p><a target="_blank" href="http://www.facebook.com/pages/4848463326153795"><img src="<resource>facebook-hu_alt.png</resource>" alt="Facebook kapcsolódás" width="45" height="45" ></a> <iframe src="http://www.facebook.com/plugins/like.php?href=http://www.facebook.com/pages/4848463326153795&layout=button_count&show_faces=true&width=110&action=like&font&colorscheme=dark&height=25" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:25px;" allowTransparency="true"></iframe>
</div></div>';



this is what i started to change:





if($arr!=array()) $res="<div class=\"footerlinks\">"<div class="addressFcb"> <p>Austria<br>Kertner 32<br>+36(9556)555625-57867<br>+44(35)23386-2876</p><a href="mailto:lafflo.kukac@ggh.net"><b> lafflo.hefg(at)ggh.net</b></a></p><p>*</p><p><a target="_blank" href="http://www.facebook.com/pages/4848463326153795"><img src="<resource>facebook-hu_alt.png</resource>" alt="Facebook kapcsolódás" width="45" height="45" ></a> <iframe src="http://www.facebook.com/plugins/like.php?href=http://www.facebook.com/pages/4848463326153795&layout=button_count&show_faces=true&width=110&action=like&font&colorscheme=dark&height=25" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:25px;" allowTransparency="true"></iframe>
</div>.implode(" | ",$arr).</div>';


please someone help me!
Thx

Fumigator
05-25-2011, 05:39 PM
Yech. If you were to write that HTML mark-up so it's humanly readable (indented, etc), you'd see there are some obvious problems with it.

1. A <p> tag needs a matching </p> tag.
2. The <b> tag is deprecated and has been for, what, 10 years now?

It's not surprising the CSS isn't working.

hefterbrumi
05-25-2011, 05:51 PM
Ok, thank you very much for the information, but as a person who knows very little about php and html coding, thats why I came here for...help. I need a working site, everything is ready except this. So any help appreciated.

Fumigator
05-25-2011, 06:22 PM
I don't know what to tell you; Google "html tutorial" and become familiar with coding proper HTML, for starters.

hefterbrumi
05-25-2011, 06:32 PM
As a MOD why are so reluctant to help, really?

Fumigator
05-25-2011, 07:37 PM
:rolleyes:

Thank you for giving me a chuckle. Maybe I can explain myself gratiously here. (More likely, I'll come across as an arrogant prick. I apologize in advance.)

My notion of "help" and your notion of "help" are two very different things. Your notion is for someone to fix up your code and deliver it to your inbox with a nice yellow bow tied round it, 100% tested and ready to drop into place, no muss no fuss.

MY notion of "help" is to give you enough insight into the problem so you can become empowered enough to fix your code yourself, using your new-found understanding of what the problem is.

I believe I succeeded, at least partially, in helping you, in-so-far as I gave you some pretty decent ideas of what might be wrong with your HTML markup. Since you then came back at me saying you know very little about HTML, I suggested you accumulate some background knowledge, which would both help you solve your immediate problem and equip you with some basic HTML skillz to help you going into the future.

Hopefully I've helped you understand where I'm coming from. Feel free to ignore my "help".

hefterbrumi
05-25-2011, 08:27 PM
Dear mod!

Next time i think is a better option to tell me to eg. escape the quotes, and not sending me to google basic html.

I fixed the problem myself by the way, so thank you for nothing.

I hope we agree that in view of the previous circumstances, wouldnt be fair to ban me from the forum.

regards,


B

tangoforce
05-25-2011, 08:42 PM
No-one is talking about Banning anyone.

Fumigator is right though, this is a forum for assistance and solving problems, not giving away fully featured projects.

Frankly it does become a bit tiresome to keep seeing these posts from people who "don't know much" who think they can come here and have us do all the hard work.

IF you have a project and you need help to overcome an obstacle then sure we're happy to help. IF you come here with minimal knowledge and expect us to help you build a super-project then i'm afraid it won't happen. You need to pay someone instead.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum