Introduction to Active FoxPro Pages - dFPUG

Download Report

Transcript Introduction to Active FoxPro Pages - dFPUG

© 1997 - 1999 Prolib Software
GmbH Germany
What is it ?
•
•
•
•
A comfortable Script engine for xBase
The right decision if you hate VB
*THE* way to bring DBF data to the web
The fastest programming language for web
apps
• The easiest way to make web apps with
xBase - Code
Active-FoxPro-Pages
2
How does it work ?
• Just add pure xBase Code into your HTML
- page
• <% and %> like in the Active-Server-Pages
to insert xBase Code
• AFP Pages are running on the Webserver
nothing is running on the client.
• The Browser sends requests to the
Webserver and AFP returns the HTML
Active-FoxPro-Pages
3
Code
What do I need ?
• 1. A Microsoft OS (NT recommended)
• 2. The VFP 6 SP3 Runtime (download it
from the website)
• 3. The AFP itself (download it from the
website)
• 4. A license file if you dont like the nice
message every 15 minutes, that you have an
unregistered version. <g>
Active-FoxPro-Pages
4
How to write programs ?
• Use Frontpage to create, edit and distribute
AFP Pages on the Webserver
• You can use Notepad to write the AFP
Pages and distribute it with FTP.
• Use any Editor that knows everything
between <% and %> is not HTML Code.
Active-FoxPro-Pages
5
Does it work with Frontpage
Extensions ?
• Yes. Just name your AFP-Pages *.ASP, set
the AFP2ASP setting in the AFP.INI to on.
• Now the AFP Engine searches for *.ASP
pages first when a *.AFP pages is
requested.
• If it finds the ASP page the Frontpage
extension works with AFP Scriptcode.
Active-FoxPro-Pages
6
What about security ?
• AFP runs with HTTP and HTTPS
• Only text is transfered from the browser to
the server and only the results are
transferred back to the browser as HTML.
• No Code is visible outside the Webserver.
• Use any encryption tool for your data
(Cryptor)
Active-FoxPro-Pages
7
What browser do I need ?
• AFP works with *ANY* browser. Even
with Lynx the text oriented Linux Browser.
• No DHTML, Java, Javascript or ActiveX is
needed, but can be used if *you* want.
• AFP sends only Text strings. It´s up to you
to decide what other code is inserted.
(Javascript or DHTML)
Active-FoxPro-Pages
8
AFP, ASP, Pearl together ?
• Yes of course.
• The extension of the request files tells the
Webserver which Scripting engine should
be used.
• AFP and server sided ASP inside the same
page is not possible, but client sided
VBScript can be added.
Active-FoxPro-Pages
9
Highlights
•
•
•
•
•
•
With compilation 10 times faster.
Localizing already built in
Individual error-screens
Mail to webmaster on error
Pure FoxPro, pure Speed
Comfortable browse command
Active-FoxPro-Pages
10
What is not allowed ?
• Commands like suspend, cancel, debug
a.s.o.
• Everything, that makes output on a screen.
It would appear on the server screen
• With the rich VFP command set there is no
need for endless loops. Endless loops are
forbidden.
Active-FoxPro-Pages
11
APPLICATION.PRG / FXP
• Use a special file called application.prg or
application.fxp for recurrent code.
• Such a program can be stored in every
subdirectory.
• Use it for opening files, checking for errors
a.s.o.
Active-FoxPro-Pages
12
AFPHOOK
• A file named afphook.fxp is added as a
procedure and called every time an AFPPage will be hit.
• There you can store the procedures you
need everywhere.
Active-FoxPro-Pages
13
Localizing
• Localize every output string simply by
writing a double print character (??)
• There is a strings table (LANGFILE) where
you can translate every word or sentence.
Active-FoxPro-Pages
14
Clustering
• If you have heavy access on your website
and you need more than 1 Million hits per
day, you can use more than one AFP
Webserver.
• Use the COMMONPATH setting in AFP.INI
to tell AFP where the common data is
located.
• IIS and a Nameserver does the rest.
Active-FoxPro-Pages
15
Cookies
• Built in support for HTTP cookies and
special AFP cookies.
• Use HTTP Cookies to make life easier for
the clients, by remembering the clients.
• Use AFP Cookies to have the information
on who is making the request.
Active-FoxPro-Pages
16
OOP
• No need, so great for Fox2.x, dBase and
Clipper programmers too.
• But you can still create your own objects by
using the 'set proc to' or 'set classlib to'
commands and then use the 'create object'
command.
• Use vfpcom utility to access ADO-Data
Active-FoxPro-Pages
17
SQL-Server
• Simply create a Database with Remote
Views and "USE" them like normal tables.
• Or use the SQLEXEC-command to access
any SQL-Backend.
• There is pure Visual FoxPro running, so use
every possible command or function.
Active-FoxPro-Pages
18
External tools
• Use every external tool, which is available
for VFP6
• Cryptor, phDbase and so on.
• Use DECLARE statements to access the
API
• Access a Transaction Server via
createobject()
Active-FoxPro-Pages
19
Available at and price
• WWW.AFPWEB.COM
• All inclusive 499.00 US
Active-FoxPro-Pages
20