Weborum Webmaster Forum > Interview Question
Help - Search - Members - Calendar
Full Version: Interview Question
Weborum Webmaster Forum > Web Page Design > PHP
mickscool
Hey Guys,
I was asked in the interview..say know the gender of the person who's visiting our site from our database.....how can we apply different style sheets depending upon male/female??Can anyone tell me wat the answer would be??
Thanks
Mick
leo
i'm sure you could switch stylesheets with javascript also but here's joe's tut on switching them with php

http://forum.weborum.com/index.php?showtopic=1597

you'd just need to have it switch when they choose a gender
mickscool
Thanks Leo,
That tutorial uses php and session values and shows up the different stylesheets already designed.The anser I gave was somewhat similar to that....i said from our jsp file we could read in the gender value from the database and depending upon that we can switch stylesheets.But the interviewer said we need dynamic switching at runtime and not static switching....and that went over my head......and i think i lost the job there.Anyways,if you understand the trminology used..can you please explain me what the answer wud be.
Thanks
Mick
leo
i'm not a scripting or serverside person so my only guess would be some javascript to switch it straight away, or maybe some php to reload the page whent he gender is selected or something, but i'll move this to jaavscript and maybe one of the other guys can give you a better answer smile.gif
Waleed
you want that the stylesheet should be switched when the user selects their gender?
mickscool
No...the database has the gender value..and when the user log-in...from the database we come to know..whether the person is a male/female..and depending upon that the stylesheet should be applied....
leo
QUOTE(Waleed Zuberi @ Jun 16 2005, 02:39 PM)
you want that the stylesheet should be switched when the user selects their gender?
[right][snapback]29007[/snapback][/right]



ahh this is what i thought, then this should be in serverside, off we go again laugh.gif
Waleed
no wouldn't know about that. I mean I'm sure there's some way, but I don't know
bassrek
QUOTE(mickscool @ Jun 16 2005, 08:01 AM)
i said from our jsp file we could read in the gender value from the database and depending upon that we can switch stylesheets.But the interviewer said we need dynamic switching at runtime and not static switching.
[right][snapback]29005[/snapback][/right]


Sounds to me this is a classic case of the interviewee knowing more than the interviewer. In my mind, your suggested solution is absolutely what you should be doing. What's more, what you suggested is dynamic and determined at runtime. To me, static switching is an oxymoron. How can it be both static and switch???
leo
yeah i didn't get my head around that, you hit the nail on the head Bassrek, why would it be static at the same time as automatically switching the stylesheet from records in the database when the user logs in.
mickscool
Hey thanks,
From one other forum too i got the same reply i.e " the script generates the dynamic class values or selects the relevant CSS file. CSS cannot choose anything dynamically/runtime ".Anyways there were 5 persons interviewing me,and with less then 2 years of work exp. it was very hard to convince them...unless i was a geek like you.But after 1 day,I still havent got a refusal call/email from them...so who knows...its better to be a optimistic...as i cleared the first 2 phases and fared just below par in the last one...lolz
cheers
mick
leo
hehe, excuse me if i missed it but what is the interview for, as in what job and where? smile.gif
Waleed
do people on Weborum qualify as geeks?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.