/    Sign up×
Community /Pin to ProfileBookmark

Attn: All coders expert and novis

I feel bad for asking this. I need a script that will allow me to neumerous reports on one single page and then give a username and passcode to people to retreive one report not all of them.

in short I will have 10 reports on one page and all 10 needs a seperate username and passcode to download.

I have seen this done but I do not code that well to do it. Please may I have some help. Ken

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@mrhooFeb 28.2008 — You can fake it with javascript, but it is easier to do on the server, which has what you need to handle authenticating users and file access.
Copy linkTweet thisAlerts:
@LeonsbuddydaveFeb 28.2008 — This is possible with JavaScript. However, it is completely insecure. For example:
<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;script language="javascript" type="text/javascript"&gt;
function LogIn() {
var username = document.form1.username.value;
var password = document.form1.password.value;
if (username=="Javascript" &amp;&amp; password=="Rocks") {
alert("You successfully logged in.");
}
else {
alert("You fail.");
}
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form name="form1"&gt;
Username:&lt;input type="text" name="username" id="username"&gt;&lt;br /&gt;
Password:&lt;input type="text" name="password" id="password"&gt;&lt;br /&gt;
&lt;input type="button" value="Log In" onClick="LogIn()"&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

Yes, it works, but try looking at the page source when this is in your browser. Notice that you can see the required inputs directly in the source page. In order to make a truly secure login script, you would need to use PHP or some other server side language.
×

Success!

Help @mitsuman5 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...