View Full Version : Can you mix Perl CGI scripts with javascripts?
sub_human73
12-11-2003, 05:50 PM
I am way new to scripting. All I know is html, and I'm trying to learn javascript and cgi scripting. I was wondering if you can have Perl CGI scripts and javascripts in the same HTML webpage? I am wanting to build a massive website that includes a user register process, and login, and a guest section that is limited access. Also, I want to include a search forum, a chat, and a poll section. I know that perl cgi is more secure than javascript; hence my question. I have a couple of javascripts already in the html code, and wanted to know if I can include the cgi scripts in the <head> section without causing any conflicts? Any and all help is appreciated. THANX !!!
dswimboy
12-11-2003, 05:57 PM
yes, you can combine javascript and perl on one page.
i would use htaccess to authenticate users. you could write a perl script to edit htpasswd files when a user submits the registration process.
search, chat, and poll, i would use perl.
i'm not sure what you would use the JavaScript for, except maybe verifying form data before submission. if you could be more specific, i might be able to provide better answers.
you could most likely use PHP instead of perl, too.
If you are new to scripting, and decide to use perl, i would recommend purchasing the book "Learning Perl" published by O'Reilly. the book really helped me understand perl.
sub_human73
12-11-2003, 06:07 PM
Thanx for the input. I am using javascripts for cookie handling and menus. I just didn't want to have the jscripts interfere(sp?) with the cgi scripts. Thanx for the tip on the book too. I'm going to the library this afternoon to see what I can find. One thing I guess I need to learn would be the .htaccess that you mentioned. Got any leads as to where I can start learning about it?
dswimboy
12-11-2003, 09:13 PM
i would recommend http://javascriptkit.com/howto/htaccess.shtml for the htaccess run down. you could also search for a tutorial at google.
htaccess is only for use on Apache webservers. i'm not sure what you should use for IIS.
perl can also handle cookies, i'm sure PHP can too.
javascript is client-side code, meaning it is executed on the user's computer. Perl and PHP are server side code, that are executed on the server. the output of perl scripts can be sent to the user, if you want. the book will help alot.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.