Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please give advice

Status
Not open for further replies.

fishin4snook

IS-IT--Management
Sep 20, 2000
83
US
I am looking to put a page on my website so that people can type in their name and a Password and it will take them to a page that I have set aside just for their name? Is there any programs or software out there that do this? Thank you for your advice on this subject.

Thank you,
Fishin4snook. [sig][/sig]
 
yea i have one where u can specify a different page for each user.. gimme your email address and i'll email u the file.
bhavin.jansari@experian.com [sig][/sig]
 
What type of file is it? Is it javascript or cgi?

[sig][/sig]
 
how does it work ? if you want the file i'll just email it to you ait ? then u can see :p [sig][/sig]
 
Hi,

Keep in mind that there's nothing secure about using client-side javascript, so if your user name/password pair is something you don't want others to see, you definitely don't want to use javascript. A CGI script would be a good candidate. Even though CGI by itself isn't secure, it's more secure than using client-side javascript by a longshot.

If you don't care about security and are just looking to customize your site for each user, you might want to look into cookies.

Regards, [sig]<p>Russ<br><a href=mailto:bobbitts@hotmail.com>bobbitts@hotmail.com</a><br><a href= is in</a><br>[/sig]
 
Russ,

Thank you for your information, I do understand that javascript is not secure. Do you know of any cgi scripts that can make a entered name or number go to a certain page? APassword is not the big deal as much as being able to have the customre type in their name it take them to a page made just for them.

Thank you for your repsonse,
Fishin4snook. [sig][/sig]
 
If you already have the pages created for each potential user (not likely), you could do it with simple javascript, for example:

<form>
<input type=&quot;text&quot; name=&quot;name&quot;>
<input type=&quot;button&quot; value=&quot;Go to my page&quot; onClick=&quot;location.href=' + this.form.name.value + '.html';&quot;>
</form>

More likely you want a custom result for _any_ name that might be entered. Here's a very basic way to do it to give you the idea:

On the client side:

<form action=&quot;GET&quot; method=&quot;<input type=&quot;text&quot; name=&quot;name&quot;>
<input type=&quot;submit&quot; value=&quot;Go to my page&quot;>
</form>

On the server side (in Perl):

*** code untested ***

#!/usr/bin/perl -w

$tmp=$ENV{'QUERY_STRING'};
$tmp=~s/\+/ /g;
$tmp=~s/%([\dA-Fa-f][\dA-Fa-f])/pack (&quot;C&quot;,hex($1))/eg;
($lbl,$name)=split(/=/,$tmp);

print &quot;Content-type: text/html\n\n&quot;;
print &quot;<HTML>\n<HEAD>\n<TITLE>Custom page for &quot; . $name . &quot;</TITLE>\n</HEAD>\n&quot;;
print &quot;<BODY>\n<H1>Here is your page &quot; . $name . &quot;</H1>\n</BODY>\n</HTML>&quot;;

Of course, what you do with the script depends on your specific needs. Also, the script above needs some validation checking to make sure the name isn't blank (it would be good to do some redundant checking in that regard on the client side with javascript as well).

HTH, [sig]<p>Russ<br><a href=mailto:bobbitts@hotmail.com>bobbitts@hotmail.com</a><br><a href= is in</a><br>[/sig]
 
Russ thaank you very much for all of your assistance on this subject, how do I make the code you supplied an actual script? Is it to be named .pl or .cgi?

Thank you,
Fishin4snook. [sig][/sig]
 
That depends on your web server configuration. I think that many web servers by default will only execute scripts with certain extensions (like .pl or .cgi). Beyond that it's a matter of preference. Either .pl or .cgi should be fine. Don't forget to chmod +x to make it executable!

Regards, [sig]<p>Russ<br><a href=mailto:bobbitts@hotmail.com>bobbitts@hotmail.com</a><br><a href= is in</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top