Click here to get back home

Form field entry directs to diff URLs based on entry?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Form field entry directs to diff URLs based on entry? AtomicBob 04-29-2006
Get Chitika Premium
Posted by Beauregard T. Shagnasty on April 29, 2006, 4:35 pm
Please log in for more thread options


In alt.html, Luigi Donatello Asero wrote:

> Do you mean that if an user should fill in a form like this
> https://www.scaiecat-spa-gigi.com/sv/formularet.html and write a name
> which does not exist, this user would get a 404 error?!

Pay attention, Luigi.

--
-bts
-Warning: I brake for lawn deer

Posted by Martin Jay on April 29, 2006, 5:12 pm
Please log in for more thread options



>> >> It's a bit basic, and you might want to think about what should happen
>> >> if someone enters a name that doesn't exist.

>> >What do you think it would happen?

>> It depends how the server is configured: visitors may get a 'server not
>> found' error, a 404 error, a default page, or maybe something else.
>>
>> The script could be modified to deal with unexpected names, either by
>> looking names up in a database or checking them against a list. Or they
>> could be hard-coded into it. :(

>Do you mean that if an user should fill in a form like this
>https://www.scaiecat-spa-gigi.com/sv/formularet.html
> and write a name
>which does not exist, this user would get a 404 error?!

Swedish? Unfortunately the English version of the page isn't available
yet. :(

My comments were not about forms in general, but specifically about the
setup described by AtomicBob at the beginning of the thread.
--
Martin Jay

Posted by Luigi Donatello Asero on April 29, 2006, 5:38 pm
Please log in for more thread options



>
> >> >> It's a bit basic, and you might want to think about what should
happen
> >> >> if someone enters a name that doesn't exist.
>
> >> >What do you think it would happen?
>
> >> It depends how the server is configured: visitors may get a 'server not
> >> found' error, a 404 error, a default page, or maybe something else.
> >>
> >> The script could be modified to deal with unexpected names, either by
> >> looking names up in a database or checking them against a list. Or
they
> >> could be hard-coded into it. :(
>
> >Do you mean that if an user should fill in a form like this
> >https://www.scaiecat-spa-gigi.com/sv/formularet.html
> > and write a name
> >which does not exist, this user would get a 404 error?!
>
> Swedish? Unfortunately the English version of the page isn't available
> yet. :(


As my one-man business is in Sweden , I usually write the pages in Swedish
first, I often write the pages in Italian ( I am Italian and I was grown up
in Italy
and in German afterwards.....English is not my first priority on the
website.. so I usually write the pages in English later
because there are many more competiting pages in the English language than
for example in Swedish or Finnish or Italian..
Why should I show the content to competitors before I display them to
customers?
(they often understand English...)


> My comments were not about forms in general, but specifically about the
> setup described by AtomicBob at the beginning of the thread.

Ok.
The thread is interesting anyway....

--
Luigi Donatello Asero
https://www.scaiecat-spa-gigi.com/sv/europa/italien/markerna/ancona/numana/
今天二零零六年四月二十九日
星期五六



https://www.scaiecat-spa-gigi.com/sv/europa/italien/markerna/ancona/numana/


Posted by Luigi Donatello Asero on April 29, 2006, 5:55 pm
Please log in for more thread options



>
> >
> > >> >> It's a bit basic, and you might want to think about what should
> happen
> > >> >> if someone enters a name that doesn't exist.
> >
> > >> >What do you think it would happen?
> >
> > >> It depends how the server is configured: visitors may get a 'server
not
> > >> found' error, a 404 error, a default page, or maybe something else.
> > >>
> > >> The script could be modified to deal with unexpected names, either by
> > >> looking names up in a database or checking them against a list. Or
> they
> > >> could be hard-coded into it. :(
> >
> > >Do you mean that if an user should fill in a form like this
> > >https://www.scaiecat-spa-gigi.com/sv/formularet.html
> > > and write a name
> > >which does not exist, this user would get a 404 error?!
> >
> > Swedish? Unfortunately the English version of the page isn't available
> > yet. :(
>
>
> As my one-man business is in Sweden , I usually write the pages in
Swedish
> first, I often write the pages in Italian ( I am Italian and I was grown
up
> in Italy


I grew up in Italy and I lived some years in Germany. Germany is an
important commercial partner for both Sweden and Italy.
At the same time there are less people speaking for example German, Swedish
and Italian than English...
Not every European speaks Chinese either which is one of the reasons why I
am learning Chinese....


--
Luigi Donatello Asero
https://www.scaiecat-spa-gigi.com/sv/europa/italien/markerna/ancona/numana/
今天二零零六年四月二十九日
星期五六



Posted by Toby Inkster on April 29, 2006, 4:36 pm
Please log in for more thread options


AtomicBob wrote:

> Example 1:
> user enters "Tony Tiger" in the field and hits submit.
> user is then sent to tonytiger.exampledomain.com.
>
> Example 2:
> user enters "johnnywalker" in the field and hits submit.
> user is then sent to johnnywalker.exampledomain.com.

Unless you use some client-side scripting, a form will always submit to
just one place.

However, that one place could be a script that looks at the form
submission and sends an HTTP 301 redirect to various different places
based on the form contents.

Here's some example code:

<form action="redirect.php" method="get">
<fieldset>
<legend>enter a name</legend>
<input name="name">
<input type="submit">
</fieldset>
</form>

<?php
        // This file is "redirect.php".

        // What is my domain name?
        $mydomain = 'example.com';

        // You used 'exampledomain.com' -- you might not have known
        // that there exists a domain 'example.com' which is specially
        // reserved just for examples.

        // What name has the user entered?
        $name = $_GET['name'];

        // Convert down to lower case
        $name = StrToLower($name);

        // Remove all characters except 0-9 and a-z
        $name = pReg_Replace('/[^0-9a-z]/', '', $name);

        // Generate Final URL
        $url = "http://./";

        // Redirect
        Header("HTTP/1.1 301 Redirect");
        Header("Location: ");
?>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact


Similar ThreadsPosted
Text entry with non-European scripts December 22, 2006, 2:00 pm
Horizontal CSS list, last entry right-aligned? April 11, 2008, 3:01 pm
Making default entry in search text box disappear on click June 30, 2005, 4:10 am
Prepopulating form field August 24, 2006, 3:32 am
Restoring OTHER form field after submit September 23, 2005, 1:43 am
How to sort form field data in E-mail? December 21, 2005, 9:03 am
Is there a way to enter text into an HTML Form edit field January 29, 2005, 5:42 pm
Dynamic width of a text input field in a form November 8, 2005, 6:35 am
Correct form for file:// URLs (or why don't they work in Firefox?) January 13, 2005, 9:37 pm
Loss of Form field contents when the browser BACK button is pressed November 25, 2004, 4:57 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap