I have an application programmed in classic asp. Now I need to create a new function that is accessible by all the files of my application, the problem is that I would have to add includes for all sites.
Does anyone know how to define this function globally without the need to add the includes?
I have already tried with global.asa but it did not work for me.
Thank you very much in advance.
a greeting
I don't believe there is a way to create an ASP function that can be called from any ASP file without including the function in the ASP page that needs to call it.
A common design pattern I use for a site (or a folder of related functionality within a site) is to create a file that contains this kind of thing -- global functions -- then include that file in every ASP file on the site/folder. One common thing this file might contain is a subroutine that emits the initial HTML before the content of the page, and another that emits everything that comes after the content. This allows me to easily give all pages a common appearance and (when combined with a common style sheet) to change that appearance without modifying each page. You can also include widely referenced functions in this file. For example, every page on my site has a login form at the top. The code to handle validating a customer's login credentials is in this global header file.
Related
I am currently developing a customized template of SquareSpace and I am not sure how to view the changes i have done locally? Also are there any resources out there to help me alter the templates, the documentation on the site isnt great?
Being able to develop and then display rendered squarespace (SS) templates in a local development environment (or "offline") seems to be an oft requested feature.
It's not straightforward so far as I can tell. To quote
The short answer is no. There is not currently a way to develop locally.
However, once we get site data exports working it should be a simple matter to setup a lightweight node js script to get local development running.
(source), similar answers
According to the SS docs, the templating engine is JSON Template, the styling is done by LESS and all of the data for a website is stored as JSON. The data for any page of an SS website can be viewed by appending ?format=json-pretty to the URL of the page (or &format=json-pretty if the URL already has a query string appended to it).
Here's an example of how to use the javascript version of JSON Template to render a template (view its source).
So it should be possible to set-up a local devenv. The solution would have to combine the use of the aforementioned components along with a way to combine a set of templates for any given page (e.g. combine sites.region and collections/blog.list for a blog index page). You could probably even hack together an html page along the lines of the aforementioned JSON Template example without the ability to combine templates if you just wanted to develop within a single template.
So, I've been trying to get a web page to display links to videos (over a symbolic link) dynamically (i.e., without hardcoding an <a></a> tag for each one) I have, and I think I may have found a solution, albeit a hacky one:
Video
Ignoring that this is a horrible way to do this, does anyone know how to format the following?:
I'm guessing there is an apache config file somewhere, but it is extremely hard to search for it as I do not know what it is called when files are just listed in this manner.
i'm basically looking to resize the widths of columns, and maybe even do some pretty-fication.
this is all running on my web/file server and is being accessed form my local machine.
This is what you're looking for:
http://perishablepress.com/better-default-directory-views-with-htaccess/
This tutorial details how directory listing by Apache can be modified to suit your taste using HTAccess file.
Using Apache HeaderName and ReadmeName directives and the module "mod_autoindex.c" you can add custom markup to your directory listing pages.
For displaying links to A/V and other files, look at my website: https://wrcraig.com/ApacheDirectoryDescriptions.
It goes beyond the default directory description, providing a spreadsheet to assist in creating detailed descriptions and exporting them in FancyIndex/AddDescription format for inclusion in .htaccess.
It also provides a menu driven BASH scripted alternative, using the FancyIndex descriptive data above (automatically adding A/V durations) to recursively populate a custom index.html while retaining the security features of .htaccess.
The site has examples of the input spreadsheet and both the FancyIndex output and the optional BASH scripted output.
I have some static websites. By static I mean all the pages are simple HTML without JavaScript (all the data are hard-coded).
I have a server side program that creates dynamic data that I'd like to insert into my static sites. By dynamic I mean the data changes very often.
How should I do this?
Here is a scenario: On the server side my program generates the current time-stamp in every millisecond. When a user open one of my static sites the page gets the current time-stamp from the server and render it.
I'd like it to work with search engines, so I can't use JavaScript.
It's not possible to change the HTML structure client side without Javascript, so your solution is to add some handler server side for files with .htm and .html extensions.
About JS: Please note that most spiders (if not all) won't be able to see data rendered by javascript since most of them are analyzing the plain HTML that is returned by the server.
to export some data i want to be able to generate an html output.
I have some constant content to output, like html headers and footers.
My question is how to deal with that ?
Do I have to embed some template (in a resource file) and parse it to make it dynamic ?
Do I store my static content in some constant (is there a 255 char limit?) and append them while generating the dynamic content ?
Do you have some hints, useful links, or best practices to share?
Thanks
Use the Delphi TPageProducer. It generates HTML from a 'close to HTML' template which contains special tage. You respond to these tag in an event and replace them with your own data. Works a treat.
I've created a Delphi project that handles this issue also. I wanted to create a web-platform that uses Delphi-code in the same source-files as the HTML, much like other web-scripting platforms, but still compiles a library to run. (and auto-compiles on changes)
http://xxm.sf.net/
In its basic form it compiles into library that can be run by a handler for IIS (ISAPI extension), InternetExplorer (IInternetProtocol as its own URL scheme), or a stand-alone HTTP process. (Apache module and FireFix plug-in are on the way).
Title: Rotate Homepage Image (for website)- No longer works.
I am a physicist/wildlife artist with a website (I created in 2002) to display & market my artwork. I have set it up with an underlying (homepage) image map - having links to: "tigers", "leopards", "birds", artist info, etc., with the overlying image changing (swapping out) every time the user navigates to/from homepage. The links for each homepage have the same numerical coordinates and do not change locations from page to page, just the image changes. You can see my blank-page site at www.querryart.com. Note links below DO work.
The website was fabulous until last year. At that time my former webhost went out of business, and I changed to Jumpline.com. Since then, the commands which call canned subroutines do not work.
The routine which swaps out the image is named pid.cgi (stored in the cgi-bin).
Another one-line page-counter cgi routine I used at the end of each page called a canned program "count.cgi" which counted visitors to that page, incremented "hits" per page, and stored them in a table displayed only to me. This was a way I could determine the popularity of various images. This cgi routine also does not now work - giving me an error message on each page.
Anyway, I am lost without these routines (particularly the first one to swap out images). Is it progress that my Cadillac website has turned into an empty wagon? Hope someone can help. I'm not a programmer.
My first guess is that you may need to change the line(s) at the top of your CGI file in order for the server to process them. For example, if using Perl, #!/usr/bin/perl is a common directory, and so is #!/usr/local/bin/perl.
Oh, and have you set the permissions to 755?
For starters: http://www.querryart.com/cgi-bin/pid.cgi does not exist. You might want to make sure the file is uploaded to the correct place.
Make sure that your host supports CGI scripts.
Make sure, your CGI scripts are uploaded at the correct location according to the info from your host regarding the installation of CGI scripts.
Make sure the scripts are executable (chmod 755)
Make sure, that the scripts are calling the correct interpreter (as pointed out by Steve).
From a quick check at your web site, it looks like the scripts are not in the right place because the webserver gives a 404 - not found. when I try to get /cgi-bin/pid.cgi
Furthermore, the fact that the script takes an absolute path as a parameter (cfile=/home/querryar/httpdocs/cgi-bin/dicont.cnf) looks like a glaring security problem allowing access to any files in your account. You should really consider a different solution