HTML/CGI forms
Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: HTML/CGI forms

  1. #1
    Member
    Join Date
    Sep 2002
    Posts
    43

    Question HTML/CGI forms

    Hi peeps,

    Got a little problem at work.

    Im currently writing the company website with online ordering capabilities. Im using perl/cgi to move the data from page to page. My problem is ive got a hypertext menu bar at the top of the screen for browsing the site, and ive got forms in the main body of the shop to pass data around.

    Spot the problem yet?

    The only way i can keep the data when changing page using the menu bar is to use submit buttons which obviously mess with the look of the site.

    Does anyone know of a way of using Text beit hypertext or anyother way, to post form data?
    I dont really want to create images for the menu bar, but it seems to be the only solution to date.

    help with this would be great, my google searches have so far come to no satisfactory end.

    -aX
    \"I can resist everything, except temptation.\" - Oscar Wilde

  2. #2
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    I wonder how secure your site is going to be if you have problems with this. If i may suggest something, find out all you can on keeping state using session ids and read up on securing your site.
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  3. #3
    Member
    Join Date
    Nov 2002
    Posts
    80
    If you set up an image using and <img > tag anbd then set the onclick event of that image to be something like "javascript:document.forms[0].submit();" you can substritute forms[0] for the name of the form you are using. you can use this on any item you can set up to use the onclick event.

    If you wanted some kind of validation you could put it in a function. but java script is definately one way of doing it.

    Good luck, WaveRebel

  4. #4
    Member
    Join Date
    Sep 2002
    Posts
    43
    Hi SirDice.

    Security has been a concern, but i need a working site before i can think of securing it.

    This is my first attempt at such a task, i've previous experience with html, but i've picked up perl and cgi within the last couple of weeks just to create this site.

    -aX
    \"I can resist everything, except temptation.\" - Oscar Wilde

  5. #5
    Member
    Join Date
    Nov 2002
    Posts
    80
    SirDice a very good point,
    anonymity X, you should look at using encypted cookies if you want secure sesion management, as get and post methods for posting forms can both be tampered with by the user as can unencyrpted cookies.

    if you are using perl, then the CGI module provides stuff for working with cookies, but you will probably need towork out how to encrypt the fields. I expect there is another perl module to do this but my perl is not so good so I am afaiard I can't help you there.

    Waverebel

    ps you could encryt hidden fields in your forms as one way of securing them, a secret key would do as only your server would ever need to encode/decode it.

  6. #6
    Member
    Join Date
    Sep 2002
    Posts
    43
    WaveRebel,

    You say you can do this with images? could you not use this code with text instead, im using CSS to create a rollover effect on the text so it changes colour(would like to keep that).

    -aX

    it might be worth mentioning that the information im moving around only contians quantitys of products, not any personal information. the personal details part does not get parsed around everywhere and only within SSL.

    i've looked into cookies and came to the conlusion that if visiters have cookies turned off, i have a non-working site!

    -aX
    \"I can resist everything, except temptation.\" - Oscar Wilde

  7. #7
    Senior Member
    Join Date
    Oct 2002
    Posts
    181
    I'm more than willing to help, but I don't quite understand what you are trying to achive. Is it possible you could give some more info about what you are trying to do.

    But sending data via a form to be useded in next page i hear XXS alarm bells ringing!

    SittingDuck
    I\'m a SittingDuck, but the question is \"Is your web app a Sitting Duck?\"

  8. #8
    Member
    Join Date
    Nov 2002
    Posts
    80
    yes you can use it with text / hyperlinks. just put the code

    <a herf="page.html" onclick="document.forms[0].submit();" >link text</a>

    ps I hope this shows alright

    you can use this inside any block level tag as far as I know, including <f o n t> <s t y l e> <t d>
    <t a b l e> etc, beware the < d i v > tag only works in IE.

    you can use it anywhere you are using you onmouseover() events.

    Waverebel

  9. #9
    I suggest you drop Perl/CGI and go with php, it's much easier to handle form and less chance of a mix up

  10. #10
    Member
    Join Date
    Sep 2002
    Posts
    43
    ok,
    First of all the data being moved around is non-personal information, it is only product numbers and quantities.

    i have hypertext links at the top of the page, i want to be able to use these links to pass form data around. coz at the moment ive only found out how to do this using images or ugly looking buttons.

    Im using CSS to style the text and would like to keep it that way.

    -aX

    looks like im gonna have to learn javascript, didn't really wonna have to do that.
    makes you realise how limited html really is!

    thanx for your help people.
    \"I can resist everything, except temptation.\" - Oscar Wilde

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •