You're still being very vague. YOU know exactly what you're talking about. The rest of us haven't got a clue. You've not shown any source code in php or html.
Try showing us some code wrapped in [php] tags and we'll do what we can to help.
My helpful sig has gone because a mod below the administrator gave me an infraction - despite the administrator personally agreeing to it.
If you need any php tips or tricks you can PM me.