Jump to content
Server Maintenance This Week. ×

two quick questions


This topic is 8632 days old. Please don't post here. Open a new topic instead.

Recommended Posts

i have two questions that i think i know the answer to. I just want to make sure. With either one, if someone would like me to expand the issue, i will.

1. Am i correct that i can only run a script from a search page? I need a "button" to insert the current day and time on a record detail (editable) page.

2. If i choose restrict IP address in the application prefs, does that apply to ALL databases open on that machine? If so, how can i restrict just one DB's IP addressess?

Unfortunately for me, both of these problems are for the same solution. Any help on either one would be greatly appreciated.

Jeremy

[This message has been edited by yafreax (edited September 14, 2000).]

Link to comment
Share on other sites

You can run a script from *any* page as long as there is an action specified. You can use the "Clayton's" action -View which just gets Web Companion to process the instructions and generate the next page. If you want or need more security, specifying -findany or any othet action tag besides -view will prompt the user for a password if you database is so configured.

Also, you don't need to use a form to run scripts, all the actions can be strung together as a URL and specified as a link. (This is a technique I like and use a lot for "canned" actions.) They are fugly but work, even in meta redirect tags. a typical such url would look like:

http://www.yadayada.com/admin/FMPro?-db=db.fp3&-lay=web&-format=menu.htm&-error=error.htm&-Script=Check%20Guests&-findany

Note the %20 symbols for spaces in file names. BTW any resemblemce of this url to real web sites is coincidence. ???

--

As for the second question, I haven't started using FMP5 yet (that's one of my "Olympic" projects over the next two weeks as I work from home).

In FMP4 I think you can restrict access on a db-by-db level using the Web Security databases.

An alternate process that I used was a simple [FMP-If] conditional at the top of the opening pages that checked the IP numbers and returned a "sorry" page if they failed.

If I had to do it again -- I don;t restrict access by IP number any more on any of the databases -- I'd explore the Web Security database method first.

[This message has been edited by Vaughan (edited September 14, 2000).]

Link to comment
Share on other sites

Here is a bit of javascript that I use to automatically paste the date and time in a form when loaded (I put the html stuff in too)???

<HTML>

<HEAD>

<SCRIPT>

function SystemDate(){

//current system date

var time=new Date()

var x=time

var dd=x.getDate(); (dd<10) ? dd="0"+dd : dd

var m=x.getMonth();

var yy=x.getYear();

var mm=m+1; (mm<10) ? mm="0"+mm : mm

var yyyy=yy+1900; (yyyy>3000) ? yyyy=yy : yyyy

SD= mm + "/" + dd + "/" + yyyy;

return SD

}

function SystemClock(){

//simple clock for current system time

var time=new Date()

var x=time

var hs=x.getHours(); (hs<10) ? hs="0"+hs : hs

var ms=x.getMinutes();(ms<10) ? ms="0"+ms : ms

var ss=x.getSeconds();(ss<10) ? ss="0"+ss : ss

ST= hs + ":" + ms + ":" + ss;

document.CallBoard.Call_Time.value=ST;

id=setTimeout("SystemClock()",1000)

//displays system time

}

function showIt(){

document.Blues.Clock.focus();

SystemClock();

document.CallBoard.Date.value = SystemDate();

}

</SCRIPT>

</HEAD>

<body onLoad="showIt()"">

</body>

</HTML>

Link to comment
Share on other sites

This topic is 8632 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.