www.webdeveloper.com
Results 1 to 13 of 13

Thread: Stupid Form Question

  1. #1
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771

    Unhappy Stupid Form Question

    Umm, yeah. I need a simple form where you put you're name and when you submit it adds it to a page that you can view. Not like a guest book with different tables and all that, just a list for like a petition. PLEASE HELP!!

  2. #2
    Join Date
    May 2003
    Posts
    550
    HTML can not process a form or write data to a file/database.
    You need a serverside language.

  3. #3
    Join Date
    Jul 2003
    Location
    Palm Desert, CA, USA
    Posts
    20
    yeah, try using ASP. that language is the easiest to learn I think,
    and very many downloadable ASP source codes!

  4. #4
    Join Date
    May 2003
    Posts
    550
    I wouldn't say ASP is any easier than any other serverside language. Whats easier depends on the person. I prefer PHP personally.

  5. #5
    Join Date
    Jul 2003
    Location
    A Small boring town in PA
    Posts
    5

    Cool

    Hey guy's, Why Don't You Just Suggest Javascript?
    I Find It Extremely easy considering the fact that i learned it in 3 days and i could write just about any program without any mistakes...i'm not bragging .
    anywho here's the code.
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Original: Pete Marise -->
    <!-- Begin
    var expDays = 30;
    //var todolistData = "";
    var exp = new Date();
    exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
    var ShowCount = 0;
    var SwapColour;

    function ListToDoItems() {
    var NumToDoItems = GetCookie('PT_NumToDoList');
    var i;
    var ToDoItem;
    if (NumToDoItems == null) {
    NumToDoItems = 0;
    }
    ShowCount = 0; SwapColour = 0;
    var listOfItems = "";
    for (i=1; i <= NumToDoItems; i++) {
    var ToDoItems = GetCookie('PT_ToDoItem'+i);
    //alert(ToDoItems)
    if (ToDoItems != null) {
    listOfItems += PrintItem(ToDoItems.split(','), i);
    }
    }
    document.getElementById("toDoList").innerHTML = "";
    document.getElementById("toDoList").innerHTML = listOfItems;
    }

    function DeleteItem(Count) {
    DeleteCookie('PT_ToDoItem'+Count);
    window.location = window.location;
    }

    function PrintItem (ToDoItems, Count) {
    var color = "";
    SwapColour = 1 - SwapColour;
    if (SwapColour==1) {color = "bgcolor='#c0c0c0'"} ;
    ShowCount++;
    return "<a href='" + ToDoItems[0] + "'>" + ToDoItems[1] + "</a> &nbsp;&nbsp;<a href='javascripteleteItem(" + Count + ")'>Delete Person</a><br/>";
    }

    function AddItem() {
    var NumToDoItems = GetCookie('PT_NumToDoList');
    var url = document.form1.text1.value;
    var i;
    var ToDoItem;
    if (NumToDoItems == null) {
    NumToDoItems = 0;
    }
    var temp = document.form1.text1.value;
    temp += "," + prompt("Please Enter Your Name");
    if ((temp != null) && (temp != "undefined" )) {
    NumToDoItems++;
    SetCookie('PT_ToDoItem'+NumToDoItems, temp, exp);
    SetCookie('PT_NumToDoList',NumToDoItems, exp);
    ListToDoItems();
    }
    }

    function set() {
    VisitorName = prompt("Who are you?");
    SetCookie ('VisitorName', VisitorName, exp);
    SetCookie ('WWHCount', 0, exp);
    SetCookie ('WWhenH', 0, exp);
    }

    function getCookieVal (offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
    endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
    }

    function GetCookie (name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
    return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
    }
    return null;
    }

    function SetCookie (name, value) {
    var argv = SetCookie.arguments;
    var argc = SetCookie.arguments.length;
    var expires = (argc > 2) ? argv[2] : null;
    var path = (argc > 3) ? argv[3] : null;
    var domain = (argc > 4) ? argv[4] : null;
    var secure = (argc > 5) ? argv[5] : false;
    document.cookie = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((secure == true) ? "; secure" : "");
    }

    function DeleteCookie (name) {
    var exp = new Date();
    exp.setTime (exp.getTime() - 1);
    var cval = GetCookie (name);
    document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
    }
    // End -->
    </script>

    </HEAD>

    <BODY onload="ListToDoItems();">
    <a href="javascript:AddItem()">Enlist</a>
    <form name="form1">


    <!--oh by the way if you want to change the link that say's "enlist" it's directly above this sentence...-->
    I Hope You Appreciated My Help.

  6. #6
    Join Date
    Jul 2003
    Location
    Palm Desert, CA, USA
    Posts
    20

    Cool

    Originally posted by brendandonhue
    I wouldn't say ASP is any easier than any other serverside language. Whats easier depends on the person. I prefer PHP personally.
    its funny you mention PHP as your fav language,
    cause when I try it, it turns my brain upside-down.

  7. #7
    Join Date
    May 2003
    Posts
    550
    See its a matter of opinion

    Uhh Pete-this is not possible to do in javascript. You haven't exactly mastered javascript, that script shows data from a cookie, meaning only the data you have entered on your own computer. What is the point of a petition where you can only see your own signature?
    Your script neither adds your name to a page or is useful for creating a petition.

  8. #8
    Join Date
    Jul 2003
    Location
    Palm Desert, CA, USA
    Posts
    20
    yeah, I wasnt thinking that JAVASCRIPT would do this either..

  9. #9
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    I'm lost, stuck, confused I need PHP but geocities free doesn't support it (STUPID) WHAT CAN I DO??????

  10. #10
    Join Date
    May 2003
    Posts
    550
    Get a different host, or try a shoutbox, or if you have to a really simple guestbook.

  11. #11
    Join Date
    Jul 2003
    Location
    Palm Desert, CA, USA
    Posts
    20
    people, if youre using FREE hosting, why not use a free forum service?
    this is for people who dont like to pay for their web services..
    www.bravenet.com

    when you get an extra couple dollars a month, buy hosting space.

  12. #12
    Join Date
    Jul 2003
    Location
    Spokane Washington
    Posts
    53

    Your Problem

    I donít know of any free services that would allow that kind of activity.... If you would like I can suggest some good very affordable hosting companies that would allow this kind of activity. For this I would suggest using a simple mysql database / PHP setup. This will allow you to save the list and have it viewed by other visitors. It would also allow you to collect simple contact information if desired. If youíre interested email me at ryan@abectech.com

  13. #13
    Join Date
    May 2003
    Posts
    550
    ^^Is that an advertisement? I think it is if your directing him to email you.
    Anyway-there are plenty of free hosts that offer PHP, and a few with MySQL (which you dont really need to do this job).
    Try t35.com freetheweb.tk lycos.co.uk and there are more.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles