lynx browser set permanently option


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting lynx browser set permanently option
# 1  
Old 02-05-2010
lynx browser set permanently option

hi all,

is there somebody that know how can I set an permanently option for the lynx text browser?

The reason is if I open some URL's and type my login infos
then lynx show follow message:

P)roceed, use G)ET or C)ancel
Server asked for 301 redirection of POST content to
URL: The UNIX and Linux Forums - Learn UNIX and Linux from Experts

Is there any command line parameter or config file option to set permanently the "GET" option?

my command to run lynx:
Code:
lynx -accept_all_cookies  http://localhost/index.php

Any idea?

Thanks
# 2  
Old 02-08-2010
Redirecting POST content

Thanks to Klaus Weide for his help with this section.

When you submit a form, what you have filled in is often sent to a computer program on a remote server (a cgi-script) that tries to process your input. Normally after successful processing these programs want to show you another page. There are basically two ways to do this. The normal way is for the cgi itself to send the page back to the browser/client as its output, if this is not possible, the CGI could generate a simple page with one link on it that points to the other page. The other, and problematic, way is to send what is called a 'redirect' to the browser. This is a special type of response, with a special status code and the location of the new page. Though the latter method is more convenient for page authors, it creates some problems which are a result of the different kinds of redirects available in HTTP 1.0.

Generally these forms are sending back a code 302, which stands for 'moved temporarily'. (if the server sends back a code 301 'moved permanently', Lynx will treat this essentially the same way as a 302 code). This code was designed to be used only for documents that have really "moved temporarily" and the browser is expected to treat the new location exactly as it would the former. In this particular case it would mean redirecting the POST content (the stuff you filled in the form), that is sending it again to the new location. This is usually not what CGI authors have in mind, but they use the redirection code 302 anyway because most browsers do not follow the rules when they receive this kind of redirect (and so the authors may never learn that they are doing something wrong). The HTTP 1.0 specifications also ask that the browser confirm this action with the user before actually sending the data again, and Lynx is trying to do just that. Therefore, Lynx 2.6 will ask you:

WWW: Redirection for POST content. Proceed (y/n)?


you should reply with a No. If you let Lynx send the POST content to the new location (as it has just been asked to do), the server will usually not understand. Unfortunately, if you reply No, there is no way for you to get to the page referenced easily (short of finding the URL you were redirected to and using g)oto to go there). If you reply with a Yes, you will probably see a 501 "not implemented", or some other unexpected error may occur (like an incomplete response).

Since this incorrect use of redirection is widespread, this was a problem (in a sense punishing Lynx users for the faults of the CGI author) and it has been corrected in Lynx 2.7, which now asks:

Redirection of POST content. P)roceed, see U)RL, use G)ET, or C)ancel?


typing a G will result in Lynx requesting that the document be sent to it (i.e., it will GET the document referenced by URL). This is what most other browsers do automatically, because they do not implement the HTTP protocol correctly. If there is any doubt about this (almost no one uses redirects POST content correctly, so there generally isn't any doubt), you should type an U to see the URL. If it looks like it's a CGI (it may have 'cgi' or 'cgi-bin' in the path somewhere) use P and redirect the POST, otherwise use GET.

By now you're asking yourself why this was ever done. Can't Lynx just behave like all the other browsers and follow the 'de facto' rules? Well we wish it were so easy. The original problem is with HTTP 1.0 which failed to define a code for CGIs that would produce output that sent someone to another page (a directory service for example, that used a database of names and URLs). HTTP 1.1 corrects this, there is a new code 303 "see other" which Lynx implements. Other browsers also seem to handle this code correctly. When HTTP 1.1 is widely deployed (probably within the next few months), the problem will resolve itself as the new HTTP servers handle this situation intelligently. Meanwhile the Lynx authors have attempted to follow the specifications to the greatest extent possible, refusing to use a function for a purpose it wasn't designed to serve since in the long run this would simply exacerbate our problems.

Last edited by research3; 02-08-2010 at 10:24 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can't set parameter to lynx properly

My intention is to go through list of addresses and call google geocode api for each of them. I am using lynx for this, but somehow I can't supply the parameters to it in a proper way. To show that my parameters are OK I just hardcoded one address in my script and put it in my input file, and... (2 Replies)
Discussion started by: migurus
2 Replies

2. AIX

Permanently set maxdata to maximum

Hi, I've a 32-bit program running on AIX. By default the memory limit of the process is 256 MB as per the 32-bit AIX OS behavior. This can be changed using the LDR_CNTRL=maxdata environment variable. Baseed on the value that we set in terms of increments of segments the process... (6 Replies)
Discussion started by: kprajesh
6 Replies

3. Solaris

Set autolist permanently

Hi , How to set autolist permanently in Solaris 10 (2 Replies)
Discussion started by: ankit.padhiyar
2 Replies

4. Red Hat

set device mode permanently with udev rule

On a test server running CentOS 6, I try to permanently set the owner, group and mode of disk devices for use with a DB2 database. For this I created an udev rule file /etc/udev/rules.d/99-db2.rules: KERNEL=="sdb*", OWNER="db2usrl1", GROUP="db2adml1", MODE="0600" After a reboot, the owner and... (4 Replies)
Discussion started by: hergp
4 Replies

5. Solaris

Set i/o option

How do we set i/o option to direct or buffered i/o using mkfs command? I mean what is the option that is to be used.. Like that block size can be mentioned by using -o bsize=<> Thanks in advance. (2 Replies)
Discussion started by: aksijain
2 Replies

6. Solaris

How do i permanently set bash profile??

Hi all, I don't want to enter below command on solaris every time. How do i permanently set this command on Solaris. I know that this operation is a piece of cake on redhat because there is a /etc/rc.local file on it. But Solaris ???? bash-3.00#export PS1="\e (2 Replies)
Discussion started by: getrue
2 Replies

7. UNIX for Dummies Questions & Answers

lynx browser + SSL

I want to browse to java.sun.. to download Java JDK I built openSSL then tried to build lynx to use it by: ./configure --with-ssl It finds the ssl .h files but cant link, last 3 lines from .configure are: checking for openssl include directory... yes checking if we can link to ssl... (6 Replies)
Discussion started by: mikebgx
6 Replies

8. UNIX Desktop Questions & Answers

How to set size of browser window in mwm?

Hi, When I launch firefox in mwm on VectorLinux 5.8, its window borders stretch just a bit beyond the screen size. My resolution is 800x600. How do I fix this issue so that it always stays within the screen when I launch it? Thank you. (1 Reply)
Discussion started by: nixusr
1 Replies

9. Solaris

where can i set editor option to yes

Hi all I am new to this forum (just registered) I need help from you guys Even if it is a basic question please don't hesitate to answer.Any answer will be helpful to me I am unable to get the previously entered commands by pressing uparrow When i enered uparrow it is giving ^[[A I got... (2 Replies)
Discussion started by: oracle_sri
2 Replies
Login or Register to Ask a Question