Monday- December 11, 2017 SemoTech Uptime Level Your IP is: 54.147.40.153 Send Direct Email.
Home About Us Contact FAQ HelpDesk Search Login
Main Menu
· Home
· Contact Us
· About SemoTech
· SemoTech Services
· eCommerce Solutions
· Merchant Accounts
· Security Certificates
· Dynamic Charting
· DataCenter Details
· Documents Section

Admin Menu
· System Information
· Internet Speed Test
· SSL Cert Validation
· System Uptime

Client Menu
· Free Downloads
· HELP / F.A.Q
· HELP - VIDEOS
· HELP - Using WebMail
· HELP - Configure Email
· HELP - Fix Send Email
· HELP - Publish Webs
· HELP - Form Scripts
· Fix IE Links (reg fix)
· Remote Support - PC
· Remote Support - Mac

Showcase
· SemoTech Portfolio
· SemoTech Flash Site
· SemoTech DataCenter
· SemoTech Forums
· SemoTech Gallery
· SemoTech eStore

Free Online Virus Check (requires Internet Explorer)

Get information and signup for a Merchant Account

Discounted SSL Root Security Certificates

Secure Authorize.Net Payment Processing



FAQ: Tutorials - Scripting Languages  (3 questions)
Working with Server-Side Scripting Languages
  1. Working with PHP
  2. Working with Server Side Include (SSI)
  3. Working with Common Gateway Interface (CGI)
FAQ

FAQ Answers: Tutorials - Scripting Languages
  1. Working with PHP
    PHP is a powerfull tool that lets you create dynamic web pages.
    PHP-enabled web pages are treated just like regular HTML pages and you can create and edit them the same way you normally create regular HTML pages.
    We have the latest PHP version installed on all of our web servers and is available to all of our customers at no additional charge.
    We are using the CGI version of PHP so you must make all you php files executable and have the path to the php binary at the top of your page.

    #!/usr/local/bin/php
    (the code needs to be on the top of every page that uses php)

    Creating a simple php webpage

    1) Copy this php code below (do not include the "---") to text file and name it "test.php" on your computer. You MUST use a text editor. Do not use programs such as Frontpage, Dreamweaver, Wordpad, or any other editing tools. To be on the safe side, we recommend you use NOTEPAD which is available in all versions of Windows.

    -----------------------
    #!/usr/local/bin/php

    <?
    phpinfo();
    ?>

    -----------------------

    2) Now, upload this file (test.php) in "ascii" mode to your "www" directory.

    3) Change the permission of the "test.php" file to "755".

    4) That's it! Now, call up this page through your domain name (http://www.yourdomain.com/test.php).


    NOTE: If you are getting a 500 Internal Server Error, 99% of the time you must have done something wrong with the precedures above, or used something else than a plain text editor like Notepad.

    Top

  2. Working with Server Side Include (SSI)
    Server Side Include (SSI) commands are executed by the server as it parses your HTML file.
    Server side includes can be used to include the value of various server environment variables within your HTML such as the local date and time.
    All SemoTech Web servers are already SSI enabled, all you need to do is call your webpage using .shtml extension instead of the usual .html.

    Understanding SSI

    To get a better understanding, look at the table below. You can use SSI commands to display what the time and date is when anyone access your website or record the IP address.

    Comment Tag as HTML:
    Today's date and time is <!--#echo var="DATE_LOCAL" -->

    Browser Output:
    Today's date and time is Tuesday, 19-Jun-2001 03:29:15 EDT

    Comment Tag as HTML:
    Your IP number is <!--#echo var="REMOTE_ADDR" -->

    Browser Output:
    Your IP number is 24.177.198.24

    Remember, HTML files containing SSI must be named with an .shtml extension. SSI commands are easy to add to your HTML, but you must follow the syntax exactly:
    #command cmd_argument="argument_value"

    Adding SSI to your website

    1) Simply open any of your existing html page

    2) Add the SSI command (i.e. <!--#echo var="DATE_LOCAL" -->) to between the <body> </body> tags in your HTML.

    3) Save that file as filename.shtml (i.e., if your webpage was "about.html", save it as "about.shtml")

    4) Upload the file to the server and call your that page on your browser (http://www.yourdomain.com/filename.shtml). That's it! If you did everything right, you will see the time and date on your webpage.

    Top

  3. Working with Common Gateway Interface (CGI)
    CGI stands for "Common Gateway Interface". It is a server-side communication standard supported by all web servers for accessing external programs. Examples of CGI programs are gateways to databases and scripts that process and return HTML commands to the server. Since HTML allows only one-way communication from the server, which is read by the web browser or client, CGI permits communication and interaction from the client to the server for two-way, dynamic web pages.

    CGI is processed by the Pearl language interpreter and therefore all CGI script files, used in an account hosted by SemoTech, must begin with the following line:

    #!/usr/bin/perl
    (this code needs to be the very first & at the top of every CGI script page)

    Creating a simple email form using CGI:

    Email forms are used to gather information from a visitor to your website and return that information only to you (or a designated email address). More complex scripts caller "Referrers" can be used to send invitations to your website to 3-rd party email addresses thus advertising your site.

    To create a simple email form you have 2 choices:

    1) Use the system provided FormMail script.

    2) Use your own script by placing it in the cgi-bin folder on your account and setting the appropriate 755 permissions on it using your FTP client or publishing software.

    Choice 1: FormMail is a simple to use, generic HTML form processor which emails the results of any form to a pre-specified recipient. Unlike other form scripts, FormMail poses no security risk for the server, and can be used for almost any kind of feedback form required - orders, enquiries, statistic gathering etc. Basically any kind of "inbound" only form.

    To use the SemoTech provided FormMail script you'll need to properly call it with the following syntax in your form code:

    <form action= "/cgi-sys/FormMail.cgi" method=POST>
    <input type="hidden" name="recipient" value="e-mail@yourdomain.com">
    <input type="hidden" name="subject" value="Feedback from web site">
    <input type="hidden" name="redirect" value="http://www.yourdomain.com/thankyou.htm">

    For additional information on the provided FormMail script and syntax of the fields, see this link:
    http://www.scriptarchive.com/readme/formmail.html

    Choice 2: Create, or download and modify, your own CGI script and place it in the cgi-bin folder in your SemoTech account. Remember to set the access permissions to 755.
    Proceed to call it in your form HTML using the following syntax:

    <form action="/cgi-bin/your_script_name" method=POST>

    Depending on the script you use or create you will have to stick to your script requirements for syntax of the field names to ensure the proper information is returned.

    Since using a custom script gives you virtually limitless functionality, you must be very careful in its use due to security vulnerabilities, exploits and the ban on SPAM. Creating or using CGI scripts that send out mass emails or target individual emails with unsolicited messages can result in lawsuits being filed against you. Exercise caution, inquire with SemoTech whenever you are in doubt and use your head.

    For thousands of examples of CGI scripts take a look here:
    http://hotscripts.com/CGI_and_Perl/index.html

    Top

FAQ


Copyright SemoTech 2003-2018 All Rights Reserved!