Question:
i i'm an A level student making an ICT system and in a bit of a jam...?
Jess :D
2010-02-02 03:24:50 UTC
My problem is that i need to make a reservation system as part of my coursework, that's the easy part - i've made the base design and what not - it works fully but i have a few security issues

Firstly i suppose that it is best to tell you i'm using Microsoft Access 2000 to create the database and then hopefully will be able to integrate it onto a website either using Front-page or Dream-weaver

Anyway, I need to make the data in the tables hidden, so that users can only see data that they themselves have input and not other peoples - I've made a form for them to use so that data input is simple to do, however they can look back at previous data which I can't allow as the data will be sensitive

I haven't the slightest clue as to how I can get around this and so i need help! - does anyone know how to hide data from view by users unless they have entered that data themselves... I will also need to know how to allow the admin full control of data so she can review it

I know i'm asking ALOT, but i'm confident that someone will be able to help me here :D
Five answers:
?
2010-02-02 03:34:04 UTC
Actually it's all on here.

http://developer.apple.com/internet/webcontent/dynamicforms.html



further down explains how to hide data and the page. Java script.



The implementation in the choose_form.html page is pretty straightforward, especially if you’ve read the Internet Developer article Hide/Show Layer. Each form is placed in a DIV, and each DIV is associated with a radio button. When you select a radio button, you change the visibility of the associated DIV. View the source of the example to see the code. Here’s a brief breakdown.



First, each form lives in its own DIV. Here’s a somewhat simplified version of the DIV that holds the form:




style="position:absolute;top:100px;left:5px;visibility:hidden;">


action="http://mydomain.com/cgi-bin/thanks.cgi">







Name:
Income:






There are a few things to note here. First, the DIV has an id (id=”ez”), which is used to identify which DIV we want to hide or show. Next, the DIV has stylesheet information. This positions the DIV (position:absolute;top:100px;left:5px) and hides it (visibility:hidden) when the page is first loaded.



The trick is to use the radio buttons to show the appropriate DIV. Here’s one of the radio buttons:




onClick="switchDiv('ez');">Easy FormClicking on this button calls the switchDiv() function, which first checks to see if the browser can handle DHTML. If it can, two functions are called: hideAll(), which hides all the DIVs which contain forms, and then changeObjectVisibility(), which shows the requested DIV.



Here’s the switchDiv() function:



function switchDiv(div_id)

{

var style_sheet = getStyleObject(div_id);

if (style_sheet)

{

hideAll();

changeObjectVisibility(div_id, "visible");

}

else

{

alert("sorry, this only works in browsers that do Dynamic HTML");

}

}First, switchDiv() tries to get the stylesheet of the DIV with the id of div_id. It uses a function called getStyleObject() which has been described in the article on hiding and showing layers. The getStyleObject() function takes the id of a DIV and returns the DIV’s style sheet. The function takes care of the cross-browser issues surrounding stylesheet access, so this script will work on Netscape 4.0+ and Internet Explorer 4.0+. If a visitor is using an earlier browser, the getStyleObject() function returns false. Here’s the function for your perusal:



function getStyleObject(objectId) {

// checkW3C DOM, then MSIE 4, then NN 4.

//

if(document.getElementById && document.getElementById(objectId)) {

return document.getElementById(objectId).style;

}

else if (document.all && document.all(objectId)) {

return document.all(objectId).style;

}

else if (document.layers && document.layers[objectId]) {

return document.layers[objectId];

} else {

return false;

}

}Getting back to the switchDiv() function; if getStyleObject() successfully returns a stylesheet, the hideAll() and changeObjectVisibility() functions are called.



The changeObjectVisibility() function was also described in the article on hiding and showing layers. It takes two parameters, the id of the DIV that should be changed, and the new visibility setting for that DIV (visible or hidden):



function changeObjectVisibility(objectId, newVisibility) {

// first get the object's stylesheet

var styleObject = getStyleObject(objectId);



// then if we find a stylesheet, set its visibility

// as requested

//

if (styleObject) {

styleObject.visibility = newVisibility;

return true;

} else {

return false;

}

}First, the function gets access to the DIV’s stylesheet using getStyleObject(). If the stylesheet exists, the visibility of the DIV is changed according to the contents of the second parameter. If the second parameter is hidden, the DIV becomes hidden. If the parameter is visible, the DIV becomes visible.



The last function of note in the script is hideAll():



function hideAll()

{

changeObjectVisibility("ez","hidden");

changeObjectVisibility("full","hidden");

changeObjectVisibility("superduper","hidden");

}This function simply calls changeObjectVisibility() three times, once to hide each DIV containing a form.



Putting this all together, clicking on a radio button calls switchDiv() which hides all the DIVs, using hideAll(), and then shows the appropriate DIV using changeObjectVisibility(). Clicking on another radio button then hides all the DIVs again and shows the DIV you want.



The functions getStyleObject(), and changeObjectVisibility() will be used in a couple of other examples in this article. Because they’ll be used so frequently, it’s a good idea to move them into a file which later scripts will include, like this:



It’s generally a good idea to put functions that are used in many scripts in a separate document. That way, if you want to change one of the functions, you only have to change one document, rather than going into every script that uses the function and changing it there.
GibsonEssGee
2010-02-02 04:11:25 UTC
Make a login form so that when the app opens the user has to enter a UserID and Password and use these variables to show only the tables you want them to see. It's not the greatest solution but it's quick and easy to implement and it's worked for me in the past to separate User and Administrator functions in a corporate database.
Shilpa Singh
2010-02-02 04:43:05 UTC
If you want only admin to get authority of viewing all the records of the table then you can set password before the original form begins he must enter the password accordingly the various records will be displayed. If he is a normal user then restrict him to see only the records fed by him.
?
2016-12-09 01:55:34 UTC
No, even while people yawn i do no longer. i like to play a interest with my pals the place somebody will yawn and we observed who yawns first. I in no way usually win till i'm unwell with a chilly because of the fact i'm getting so drained it relatively is as though I stayed up an entire week with a wink of sleep.
2010-02-02 03:30:31 UTC
huh, and you said you were smart? smart enough to try to get a fool help you attain a degree you don't deserve, I guess!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...