Mln Sastry

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromMln Sastry
ToMe
Subjectlogin data re submission
Date07 August 2003 14:55
hai ,
mlnsastry from india. 
We are facing problems regarding to session management.
Once the user logs out. He can goback to the previous page and resubmit the
login form post data by clicking the refresh button. How can we stop this
from happening.
 
 
hope u may find time to answer this
thank you
mlnsastry
FromMe
ToMln Sastry
SubjectRe: login data re submission
Date07 August 2003 15:03
using PHP:

for example, if the login page points to:
loginForm.html
make the login form go to:
acceptLogin.php
and on acceptLogin.php, send a location header to replace the page
header('location:http://xx.xx.xx/loginOK.php');

using JavaScript:

for example, if the login page points to:
loginForm.html
make the login form go to:
acceptLogin.html
and on acceptLogin.html, use script to replace the page
location.replace('loginOK.html');

because this removes the browsers history of acceptLogin.php/html, they
cannot refresh that page.


hope this helps

Tarquin - author of http://www.howtocreate.co.uk
FromMln Sastry
ToMe
SubjectRe: login data re submission
Date07 August 16:03
hai
 
thank you,  tarquin that solved my problem
 
thanks once more
sastry
FromMln Sastry
ToMe
Subjectstyle sheet switcher function
Date08 August 13:07
hai 
    I included the style switcher functions in my application. And I have
some questions. 

in what order body.onload , window.onload work ?do they clash each other?..
because i am using a date component which is using window.onload and
whenever i include the component 'useStyleAgain()' is not working

in konqueror the style sheets are not changing. i dont understand why

thank u
sastry
FromMe
ToMln Sastry
SubjectRe: style sheet switcher function
Date08 August 2003 13:19
Sastry,

<body onload="etc."> and window.onload are equivalent in all browsers
except Opera 7. This means that if you define one, then you must not define
the other, or only the second one will work. If you need to make both work,
then you need to modify one or the other:

<body onload="useStyleAgain('mystyle');">
+
window.onload = function () { doSomething(); };

must be replaced with:

<body onload="useStyleAgain('mystyle');doSomething();">

or

window.onload = function () { useStyleAgain('mystyle'); doSomething(); };

I suggest you change the date script as I have just shown in the second
version, and do NOT use
<body onload="anything">

Note also that style sheets will not change in Konqueror 2.x, only in 3.x


Tarquin
FromMln Sastry
ToMe
Subjectyour site table border
Date08 August 2003 14:23
hai ,

thank you for the reply.I just opened your site (howtocreate.co.uk) on
another machine( with IE 5). On this machine the borders are appearing in
solid style but on my machine(with IE 6) the borders are appearing in
dashed style. Apparantly the reason seems to be version difference. but i
am not convinced. What is the exact reason

thank you
sastry
FromMe
ToMln Sastry
SubjectRe: your site table border
Date08 August 2003 14:34
taken from the Microsoft site:
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/borderstyle.asp

dotted
Border is a dotted line. This value is supported on the Macintosh platform,
as of Microsoft® Internet Explorer 4.01, and on the Microsoft Windows®
platform, as of Internet Explorer 5.5. It renders as a solid line on Unix
platforms, and on Windows systems running earlier versions of Internet
Explorer.

dashed
Border is a dashed line. This value is supported on the Macintosh platform
as of Internet Explorer 4.01 and on the Windows platform, as of Internet
Explorer 5.5. It renders as a solid line on Unix platforms, and on Windows
systems running earlier versions of Internet Explorer.

So yes, it is a version issue.

The W3C spec
http://www.w3.org/TR/CSS2/box.html#border-style-properties
says:
Conforming HTML user agents may interpret 'dotted', 'dashed', 'double',
'groove', 'ridge', 'inset', and 'outset' to be 'solid'

so even though IE 5.0 Win cannot do dashed or dotted, it interprets it as
'solid' which is better than 'none'.

:)


Tarquin
FromMln Sastry
ToMe
Subjectwhat are POP3 and IMAP
Date09 August 2003 09:38
hai,
   I installed moregroupware in our LAN.  I have a question regarding
   WebMailClient module in that

What do the terms - POP3, IMAP mean ?  Also plz suggest any
materials/articles regarding them

thank you
sastry
FromMe
ToMln Sastry
SubjectRe: your site table border
Date09 August 2003 11:42
POP and IMAP are ways to collect your email.

When you send an email, your email client (in your case, this is the yahoo
server) sends it using an internet protocol (eg. HTTP is an internet
protocol) known as SMTP. The email client connects diectly to the
recipient's server (in my case, this is the howtocreate.co.uk server). If
you were using an email client like outlook express on your own computer
instead of yahoo's web email service, your client would send the email to
your service provider's server via SMTP, and that would then connect to
the recipients server for you.

The recipient's server holds the email until the recipient collects it
using POP, IMAP or a web service.

With IMAP, you usually leave the email on the server, and tell it what
folders to be in. When you connect to a server using IMAP to collect your
email, it remembers what folders you had. When you connect to a server
using POP to collect your email, it does not remember what folders you
had. You usually download all of the emails onto your own computer and
delete them from the server. You then put them into folders on your
computer instead of on the server.

IMAP is useful because you can access your email from any computer, 
and still have it in the right folders. Although you can access POP from
any computer, it does not remember the folders, and as you usually delete
it from the server, you can only read the email on the computer you used
to download it.

In a way, IMAP is like your yahoo account. It remembers the folders, and
you can get it from any computer, but with IMAP, you don't use a browser,
you use a real email client, like Outlook, Outlook Express, Pegasus,
GroupWise, Ximian Evolution, etc.

http://www.imap.org/
FromMln Sastry
ToMe
Subjectscript error on closing the window
Date11 August 2003 18:07
hai,
we are all very much pleased with the kind of responsiveness that you are
showing.and also we admire the kind of effort and quality that your works
reflect.

as i mentioned in  my earlier mails, i am using the style sheet switcher in
my application. but sometimes i am getting a problem. whenever i close the
window using the window close button on top right corner, or right clicking
on the browser icon on the taskbar i am getting an unexpected runtime error.
can u suggest what i might have done wrong

thankyou
sastry
FromMln Sastry
ToMe
Subjectdisplay based menu controls- select box visibility toggling
Date12 August 2003 06:57
hai,
 i am using "display based menu controls" code to generate menus
 but the select boxes come on top of the menus. for IE i did the required
solution of setting the select box visibility=hidden. But can u plz
specify the code for netscape,mozilla,konqueror to capture the selectboxes
and hide/display them whenever a menu is clicked.
 
thankyou
sastry
FromMe
ToMln Sastry
SubjectRe: script error on closing the window
Date12 August 2003 09:38
> as i mentioned in  my earlier mails, i am using the style sheet switcher in my application.
> but sometimes i am getting a problem. whenever i close the window using the window
> lose button on top right corner, or right clicking on the browser icon on the taskbar
> i am getting an unexpected runtime error. can u suggest what i might have done wrong

Well spotted. For some unknown reason, Internet Explorer objects to
if( navigator.__ice_version )
when the window is closing, even though the navigator object is there and
it should work. What an annoying bug! I have fixed it and uploaded a new
version to the site. Please download the latest copy.

> i am using "display based menu controls" code to generate menus but the select boxes
> come on top of the menus. for IE i did the required  solution of setting the select
> box visibility=hidden. But can u plz specify the code for netscape,mozilla,konqueror
> to capture the selectboxes and hide/display them whenever a menu is clicked.

The problem here is that the select boxes are provided by the operating
system, not the browser, and the operating system does not understand
z-index.

To hide them, you need to insert triggers into the script to detect when
you are clicking the menus:
in the popLow function, add:

if( isMenDown ) { setSelects('visible'); } else { setSelects('hidden'); }

and in the linkClick function, add:

setSelects('visible');

then add this function:

function setSelects( oVis ) {
	var s = document.getElementsByTagName('select');
	for( var i = 0; s[i]; i++ ) { s[i].style.visibility = oVis; }
}
FromMln Sastry
ToMe
SubjectRe: script error on closing the window
Date12 August 2003 12:08
thanks Mr.Mark, i modified the code. We have Konqueror3.1-12 on our linux
machines, on which i tested the menu. konqueror is behaving badly. even the
table border and the total page content are disappearing.  the menu body is
overlapping the menu heading.
 
when i opened it in netscape 6.1 i could see neither the menu nor the
select box. then i opened your site . The select box of your home page is
not appearing and also, the rendering was poor.
 
what went wrong?. Why netscape, konqueror are behaving like that.
 
sastry
FromMe
ToMln Sastry
SubjectRe: script error on closing the window
Date12 August 2003 12:31
The display based menu is designed to work with my mini-window script, it
may not work properly in other circumstances. It needs to be inside a
positioned element (either relative or absolute) so if you want to use it,
you should put the entire page inside a
<div style="position:relative;left:0px;top:0px;">

I have Netscape 6.2, and the rendering is perfect, and the select box
appears. If it does not in your version of Netscape, it could be because of
a bug in it (Netscape 6.x was made from pre-releases of Mozilla - they were
not quite ready to be released).

I have Konqueror 3.0.0-12. The rendering is perfect and the select box
appears. However, once you use the 'view' menu to select a stylesheet, it
remembers your choice and applies it, overriding my stylesheet switcher.
There is nothing I can do about that. It is a bug in Konqueror. If you have
chosen 'White' from the view menu (called 'Grey' in the select box), my
site will always be rendered with that choice of stylesheet, and my
switcher function will not work. That stylesheet has no colours, so that
might be what you are seeing.
FromMln Sastry
ToMe
Subjectsending blobs to browser
Date19 August 2003 07:17
hai
   we are doing an application where people have to upload their documents
scanned in JPEG format, fax format, or pdf format. when they upload it we
have to save it and when the user  logsin he will be shown a combobox
displaying all the files he has uploaded and when he chooses a file it will
open the file;
 
as of now we are storing the files in the file system. but we want to store
them in database as blobs. we are using postgresql. i want to know how i
can open a file  which was stored in the database.
i know how to open the file from database into a blob object in the server.
but how to send this object to the client (because this is not a file in
the file system) so that i can preserve the file name, content type, and
open it in appropriate application
thankyou
sastry
FromMe
ToMln Sastry
SubjectRe: sending blobs to browser
Date19 August 2003 08:27
You need to save the file name in your database. This can then be sent as a
header so the browser will know what the file name is.

You also need to discover the MIME type of the file (this is sometimes sent
with the file upload as $_FILES['inputName']['type'], but just in case, in
PHP there is a function called 'mime_content_type', but your PHP
installation has to be specially compiled to support it. If you do not have
that function, you can use my 'giveMimeType' PHP library
http://www.howtocreate.co.uk/php/ ). This can also be sent as a header, and
allows the browser to open it with the correct application.

//do this when you receive the file
$theFileName = $_FILES['myFile']['name'];
if( $_FILES['myFile']['type'] ) {
	$fileMIME = $_FILES['myFile']['type']
} elseif( function_exists( 'mime_content_type' ) ) {
	$fileMIME = mime_content_type( $_FILES['myFile']['tmp_name'] );
} elseif( function_exists( 'ext2mime' ) ) {
	$fileMIME = ext2mime( $_FILES['myFile']['name'] );
} else {
	$fileMIME = ' application/octet-stream';
}

When you want to send them the file, you need to send all the headers
together (Opera7 does not always present a 'save as' dialogue if it
believes it can open it, but the other browsers do).

header("Content-type: ".$theMIMETypeWeWorkedOut);
header("Content-Length: ".$theNumberOfBytesInYourBlob);
header("Content-Disposition: attachment; filename=".$theFileName);
FromMln Sastry
ToMe
Subjectadding elements to a table
Date20 August 2003 14:17
hai
i have an application in which the user has to record a purchase order. The
number of items in the order is variable. so i want to display a combobox
for items list and a text box for price and another button saying 'one more
element' as soon as he clicks that i want to add another row to the table
containing the item combo and the text
can u suggest a way to do this
thanQ
sastry
FromMe
ToMln Sastry
SubjectRe: adding elements to a table
Date20 August 2003 19:22
I think I know what you are asking. However, before you start, I must warn
you that you should not make this rely on JavaScript, because not everyone
supports JavaScript. The best way to do this is to use server side script
to generate the table. This will work in all browsers, all versions. You
can store their choices in a database.

If you do want to rely on JavaScript, this can be done using W3C DOM
scripting, and using hidden inputs to store their choices for sending to
the server. Again, I must warn you, several browsers have severe problems
doing DOM scripting with tables, so your best bet is to regenerate the HTML
code for the entire table every time, and use innerHTML (say for a
surrounding DIV element) to put it on the page. Note also that some
browsers only use inputs that were NOT generated, so you should not add new
inputs after the page has loaded.

This is far too complex for me to describe in an email. I suggest you look at:
http://www.howtocreate.co.uk/tutorials/javascript/domintroduction
but as I said, I recommend using server side scripts, not JavaScript.
FromMln Sastry
ToMe
SubjectRe: adding elements to a table
Date21 August 2003 11:11
hai
 i choose to use the "innerHTML" solution, because our target audience is
an organization, and we ourselves are going to do the system setup and
network installation. so we dont have to bother about cross browser
specific issues. we are going to install linux 9.0. And they have Windows
on some systems. So my only browsers are IE5+ , Mozilla.
 i am doing my project in jsp/servlets with PostgreSQL as the backend.
thankyou
sastry
FromMe
ToMln Sastry
SubjectRe: adding elements to a table
Date21 August 2003 11:15
You may find PPK's extending forms page useful then:
http://www.quirksmode.org/dom/domform.html
FromMln Sastry
ToMe
Subjectinstantiation of functions
Date25 August 2003 16:36
hai

how to execute a function whose name, parameter-names are specified in an
array like 

var funcs=[ ['fun1','txt1','chk1','cmb1']];

 //fun1 is the function name and the rest are form control names or ids.

i read about this sometime back but i dont remember it. 
--------------------------------------------------------------------------
------------------------------------------ the idea is this...
 tools like phpSmarty provide form controls for us eg {html_select_date}
 but there is no way to validate those dates in the client side, without
 writing explict function calls .

..............
we are writing a form,server-side-code generator.

 whenever a programmer specifes that he wants a particular control in the
 form , i  will generate the html for that control and also make an entry
 in the global functions array as

# script language=javascript # 

funcs[funcs.length]=['libfunc','arg1','arg2']; 

#script#


 . and when the form is submitted all the function calls  which  are
 "registered"( ie specified in the array)  will be executed with the
 specified params


thank you
sastry
FromMe
ToMln Sastry
SubjectRe: instantiation of functions
Date27 August 2003 21:11
use the eval operator

x = 'myfunction';
y='myParam';
eval(x+'(\''+y+'\');');

the eval operator interprets a string as script.
FromMln Sastry
ToMe
Subjectmark i am in trouble
Date27 August 2003 07:15
hai,
  the select box method
      selBox1.options[selBox1.selectedIndex].value is not working in
      mozilla
how should i write this for mozilla

sastry
FromMln Sastry
ToMe
Subjectmark how to disable a text box in mozilla 1.0.1
Date27 August 2003 07:24
i am using a checkbox  to disable a text box it is not working in mozilla
 like    
         txt.disabled =true

the mozilla i am testing is 1.0.1

sastry
FromMe
ToMln Sastry
SubjectRe: mark i am in trouble
Date27 August 2003 21:17
> selBox1.options[selBox1.selectedIndex].value

this will give you the value of the selected option in all browsers. If it
is not working it is because you have written something incorrectly in
your code.

> i am using a checkbox  to disable a text box it is not working in
> mozilla like
>      txt.disabled =true

<input type="checkbox" ...
   onclick="this.form.text1.disabled=this.checked;">
<input type="text" name="text1">

this will work.
FromMln Sastry
ToMe
SubjectRe: konqueror--dynamically added select boxes submission
Date28 August 2003 19:55
<select name="store">
<option value="s1#1">
</select>
 
 
hai,
         thank you.  i will use the above solution.... but on the client,
because i placed a button which will add one more row to a table with all
select box and textbox fields.
 
sastry
FromMln Sastry
ToMe
Subjectdynamic select boxes
Date29 August 2003 17:24
hai,
  as i wrote earlier i used your suggestion of creating selbox values,on
  the client side. but still it was not working.

  what happend was that, the dynamically created select boxes were not
  being entered in the  document.elements array, though i could access
  them  in the validation code using document.getElementById() function.

so i was not seeing them on the server side

then i took all the values and converted them into a string and submitted
that and now it is working


though the script worked perfectly without errors things did not happen as
expected. 

could u plz tell me whether there is any documentation available regarding
the behaviour of browsers for its javascript implementation.

thank you
sastry
FromMe
ToMln Sastry
SubjectRe: dynamic select boxes
Date30 August 2003 23:29
Firstly, the array is document.forms[index].elements, not 
document.elements

As I said in a previous email, many browsers do not send the 
information in inputs / select boxes that are created after the page has
loaded. Using document.write as the page is loading is OK, but using
innerHTML or createElement to create new inputs after the page has loaded
will not work properly in all browsers.

PPK's page gives a few more details pf what browsers do not work 
correctly with dynamically created inputs:
http://www.quirksmode.org/dom/domform.html
basically, IE Mac does not create select boxes correctly at all. IE Win
and Opera 7 cannot create radio inputs. Konqueror/Safari do not send the
information to the server. IE Win does not put the elements into the
'elements' array, so the ID must be used instead. There may be other
problems as well, which is why I recommended that you did everything on
the server instead. Creating form elements after the page has loaded will
be too buggy to use!

I suggest you create the select boxes as standard HTML, then hide 
them using the 'display' style (set the display style to 'none' AFTER the
page has loaded so that it will work even if JavaScript is disabled). You
can then change the display style to '' to show them again (see
http://www.howtocreate.co.uk/tutorials/javascript/dhtml for the
full script). That way, you can show them when the user clicks the button
(just like you wanted), there are no browser problems (just like you
need), and you can generate them without the need for JavaScript, so it
even works in noscript browsers.
FromMln Sastry
ToMe
Subjectadding custom properties/attributes to HTML elements
Date02 September 2003 06:29
hai,
  i want to add custom attributes to my HTML elements like
    <input type=text name=score month=1 empid=8976 > to the buttons
 this is working properly in IE, but not in netscape.
could you tell whether there is any way of adding such attributes to the
elements and accessing them in JavaScript in netscape

thank you
sastry
FromMe
ToMln Sastry
SubjectRe: adding custom properties/attributes to HTML elements
Date02 September 2003 08:23
The way you have added them is correct, and accessing them should 
work in IE5+, Netscape 6+, Opera 7, Konq/Safari, iCab etc.

It is W3C DOM scripting:
document.forms.formName.inputName.getAttribute('yourAttribute')

PPK's page has details of how to do this and many other W3C DOM 
functions, as well as compatibility info:
http://www.quirksmode.org/dom/w3c_core.html
FromMln Sastry
ToMe
SubjectHTTP 401 Authentication
Date13 September 2003 14:10
hai,
  i have Tomcat for my development. 
Tomcat manager is asking form id, password. This is
working properly in konqueror. But in mozilla i am
getting -
"HTTP Status401 
 description This request requires HTTP authentication()."

could u tell me how to solve this

thank you
sastry
FromMln Sastry
ToMe
Subjectwhat is "chrome://cookie/content/cookieNavigatorOverlay.xul"?
Date13 September 2003 14:15
hai

  for every page i open in mozilla i see the following
error in the javascript console. 

"chrome://cookie/content/cookieNavigatorOverlay.xul"?

what is this? why i am getting this?

sastry
FromMln Sastry
ToMe
SubjectExceptions in Mozilla
Date13 September 2003 20:34
hai,

 I am getting all sorts of errors in Mozilla even for
normal scripts

ex:


Error: uncaught exception: [Exception... "Component
returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIDOMWindowInternal.alert]"  nsresult: "0x80004005
(NS_ERROR_FAILURE)"  location: "JS frame ::
http://localhost:8080/kstores/servlet/MainController?mode=PURCHASE&kase=10
0 :: ValidateForm :: line 140"  data: no]


I thought i made any mistake in script tag

I tried the following link 

http://www.xxxxxxxxxx.com/tags/tryit.asp?filename=tryhtml_script

It gave me the following exception


Error: uncaught exception: [Exception... "Component
returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIDOMEventTarget.removeEventListener]"  nsresult:
"0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame
::  :: onxbldestructor :: line 9" 
data: no]


could you tell me what's happening with me

sastry
FromMe
ToMln Sastry
SubjectRe: howtocreate queries
Date15 September 2003 20:01
> I am getting all sorts of errors in Mozilla even for
> normal scripts

This sounds like Mozilla is not correctly installed. Try re-installing, or
ask the Mozilla group for their help.

> Tomcat manager is asking form id, password. This is
> working properly in konqueror. But in mozilla i am
> getting -
> "HTTP Status401 
> description This request requires HTTP authentication()."

This problem means that Mozilla does not recognise the HTTP 
authentication sent by Tomcat. This could be because Tomcat is not 
sending the correct pair of headers, or it could be because this requires
Mozilla's Personal Security Manager (I don't know if it does require it)
and you have not correctly installed it, or it could be that Mozilla is
not correctly installed. I do not use Tomcat to provide HTTP
authentication, I use Apache to do this instead, so I do not know what is
causing the problem.

> "chrome://cookie/content/cookieNavigatorOverlay.xul"
> what is this? why i am getting this?

Mozilla/NS6+ uses the Gecko engine to render the browser chrome 
(back/forward buttons/menus etc.) as well as the web page. This error just
means that Mozilla just made a mistake with its XUL chrome settings. It
has nothing to do with the web page. It happens all of the time in
Mozilla/NS6+, but it is nothing to worry about.
FromMln Sastry
ToMe
Subjectreg image preloading when proxy is turned off
Date8 September 2005 10:10
Mark
     i am using image preloading for arrow gifs in my reports.
     but when i turn off the proxy configuration, it shows "downloading
.... *.gif" and then shows empty img tag.
     Why is it  trying to fetch the gif from the server. Doesn't preloading
work uniformly.
     or is it because of the IE->Internet options->General->Settings->Every
visit to the page setting?
    Please find time to answer

thanks & regards

M.L.N.Sastry
FromMe
ToMln Sastry
SubjectRe: reg image preloading when proxy is turned off
Date8 September 2005 10:27
> Why is it  trying to fetch the gif from the server. Doesn't preloading
> work uniformly.

not if you tell the browser not to cache it.

> or is it because of the IE->Internet options->General->Settings->Every
> visit to the page setting?

Yes, you are telling the browser not to cache it.

Telling the browser not to use its cache is a particularly damaging thing to
do to the servers, because you are making far more requests than you need
to. Be nice to the Web and set it back to its default (automatically)
setting.
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.