Click to See Complete Forum and Search --> : Stupid Form Question
MstrBob
07-11-2003, 05:36 PM
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!!
brendandonhue
07-11-2003, 06:21 PM
HTML can not process a form or write data to a file/database.
You need a serverside language.
kipkreations
07-13-2003, 07:05 AM
yeah, try using ASP. that language is the easiest to learn I think,
and very many downloadable ASP source codes!
brendandonhue
07-13-2003, 12:55 PM
I wouldn't say ASP is any easier than any other serverside language. Whats easier depends on the person. I prefer PHP personally.
Pete003
07-13-2003, 04:50 PM
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> <a href='javascript:DeleteItem(" + 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...-->
kipkreations
07-13-2003, 06:45 PM
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.
brendandonhue
07-13-2003, 07:32 PM
See its a matter of opinion :D
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.
kipkreations
07-13-2003, 07:58 PM
yeah, I wasnt thinking that JAVASCRIPT would do this either..
MstrBob
07-13-2003, 08:17 PM
:( I'm lost, stuck, confused :confused: I need PHP but geocities free doesn't support it (STUPID) WHAT CAN I DO??????
brendandonhue
07-13-2003, 09:06 PM
Get a different host, or try a shoutbox, or if you have to a really simple guestbook.
kipkreations
07-13-2003, 09:45 PM
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.
abectech
07-14-2003, 11:20 AM
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
brendandonhue
07-14-2003, 11:42 AM
^^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.