| | |
Need Help in PHP
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hello, I have designed a website that has some things for only registered users. I have javascript to hide these object if the user is not logged in using <body onload="a();">. But the problem is that when the page loads these items show up for a while and then hide I want to stop that.
Thanks
Thanks
If you think we fight for money and you fight for honor, then remember everyone fights for the thing they don't have...
What you are probably doing is setting the default action to shown when the default action should be hidden. Then if a user is logged in the hidden items are then shown rather than the other way around.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Thanks for quick reply.
for example i want to hide a button from unregistered users, but it shows up fro 4-5 seconds and then hides.
i am using
document.getElementById('btn').style.visibility = 'none';
on body load
for example i want to hide a button from unregistered users, but it shows up fro 4-5 seconds and then hides.
i am using
document.getElementById('btn').style.visibility = 'none';
on body load
If you think we fight for money and you fight for honor, then remember everyone fights for the thing they don't have...
•
•
•
•
Thanks for quick reply.
for example i want to hide a button from unregistered users, but it shows up fro 4-5 seconds and then hides.
i am using
document.getElementById('btn').style.visibility = 'none';
on body load
html Syntax (Toggle Plain Text)
<input id="btn" type="button" style="display:none" />
javascript Syntax (Toggle Plain Text)
document.getElementById('btn').style.display = 'block';
javascript Syntax (Toggle Plain Text)
document.getElementById('btn').style.display = 'inline';
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Yes you can, and as langsor stated, this is not for security, if you are trying to restrict access to something you should go with a server side solution. This will only hide it from plain site, but just remember that it is not hard to view all of your javascript no matter where you are pulling it from. Even if you don't see the javascript in the source and are getting it from another file, it can be read with things like the "web developer" add on with firefox and other applications.
Last edited by R0bb0b; Aug 15th, 2008 at 12:55 am.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
If you are looking for a server side security mixed with the wonders of javascript then an ajax solution would be the way to go.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
![]() |
Similar Threads
- Project available for PHP Developer (Web Development Job Offers)
- PHP/MySQL Programmer Position (Web Development Job Offers)
- Are you a PHP and Javascript junkie? It's time you met Emma. (Software Development Job Offers)
- PHP MYSQL Developer Position Available (Web Development Job Offers)
- PHP Web Programmer (Post your Resume)
- PHP / My SQL Web developer (Web Development Job Offers)
Other Threads in the PHP Forum
- Previous Thread: data insertion problem in php
- Next Thread: confirmation box
| Thread Tools | Search this Thread |
advanced ajax apache api array basics beginner binary broken cakephp check checkbox class cms code combobox cookies cron curl database date datepart display dynamic echo email error file files folder form forms function functions google head href htaccess html image include includingmysecondfileinthechain insert integration ip java javascript job joomla js limit link login loop mail menu mlm multiple mysql oop parse password paypal pdf php problem procedure query radio random recursion regex remote script search server sessions smarty smash sms soap source space sql stored syntax system table traffic tutorial unicode update upload url validator variable video web xml youtube





