Stupid Form Question

liunx

Guest
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!!<!--content-->HTML can not process a form or write data to a file/database.<br />
You need a serverside language.<!--content-->yeah, try using ASP. that language is the easiest to learn I think,<br />
and very many Download <!--more-->able ASP source codes!<!--content-->I wouldn't say ASP is any easier than any other serverside language. Whats easier depends on the person. I prefer PHP personally.<!--content-->Hey guy's, Why Don't You Just Suggest Javascript?<br />
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;) .<br />
anywho here's the code.<br />
<SCRIPT LANGUAGE="JavaScript"><br />
<!-- Original: Pete Marise --><br />
<!-- Begin<br />
var expDays = 30;<br />
//var todolistData = "";<br />
var exp = new Date(); <br />
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));<br />
var ShowCount = 0;<br />
var SwapColour;<br />
<br />
function ListToDoItems() {<br />
var NumToDoItems = GetCookie('PT_NumToDoList');<br />
var i;<br />
var ToDoItem;<br />
if (NumToDoItems == null) {<br />
NumToDoItems = 0;<br />
}<br />
ShowCount = 0; SwapColour = 0;<br />
var listOfItems = "";<br />
for (i=1; i <= NumToDoItems; i++) {<br />
var ToDoItems = GetCookie('PT_ToDoItem'+i);<br />
//alert(ToDoItems)<br />
if (ToDoItems != null) {<br />
listOfItems += PrintItem(ToDoItems.split(','), i);<br />
}<br />
}<br />
document.getElementById("toDoList").innerHTML = "";<br />
document.getElementById("toDoList").innerHTML = listOfItems;<br />
}<br />
<br />
function DeleteItem(Count) {<br />
DeleteCookie('PT_ToDoItem'+Count);<br />
window.location = window.location;<br />
}<br />
<br />
function PrintItem (ToDoItems, Count) {<br />
var color = "";<br />
SwapColour = 1 - SwapColour;<br />
if (SwapColour==1) {color = "bgcolor='#c0c0c0'"} ;<br />
ShowCount++;<br />
return "<a href='http://www.webdeveloper.com/forum/archive/index.php/" + ToDoItems[0] + "'>" + ToDoItems[1] + "</a> &nbsp;&nbsp;<a href='http://www.webdeveloper.com/forum/archive/index.php/javascript:DeleteItem(" + Count + ")'>Delete Person</a><br/>";<br />
}<br />
<br />
function AddItem() {<br />
var NumToDoItems = GetCookie('PT_NumToDoList');<br />
var url = document.form1.text1.value;<br />
var i;<br />
var ToDoItem;<br />
if (NumToDoItems == null) {<br />
NumToDoItems = 0;<br />
}<br />
var temp = document.form1.text1.value;<br />
temp += "," + prompt("Please Enter Your Name");<br />
if ((temp != null) && (temp != "undefined" )) {<br />
NumToDoItems++;<br />
SetCookie('PT_ToDoItem'+NumToDoItems, temp, exp);<br />
SetCookie('PT_NumToDoList',NumToDoItems, exp);<br />
ListToDoItems();<br />
}<br />
}<br />
<br />
function set() {<br />
VisitorName = prompt("Who are you?");<br />
SetCookie ('VisitorName', VisitorName, exp);<br />
SetCookie ('WWHCount', 0, exp);<br />
SetCookie ('WWhenH', 0, exp);<br />
}<br />
<br />
function getCookieVal (offset) { <br />
var endstr = document.cookie.indexOf (";", offset); <br />
if (endstr == -1) <br />
endstr = document.cookie.length; <br />
return unescape(document.cookie.substring(offset, endstr));<br />
}<br />
<br />
function GetCookie (name) { <br />
var arg = name + "="; <br />
var alen = arg.length; <br />
var clen = document.cookie.length; <br />
var i = 0; <br />
while (i < clen) { <br />
var j = i + alen; <br />
if (document.cookie.substring(i, j) == arg) <br />
return getCookieVal (j); <br />
i = document.cookie.indexOf(" ", i) + 1; <br />
if (i == 0) break; <br />
} <br />
return null;<br />
}<br />
<br />
function SetCookie (name, value) { <br />
var argv = SetCookie.arguments; <br />
var argc = SetCookie.arguments.length; <br />
var expires = (argc > 2) ? argv[2] : null; <br />
var path = (argc > 3) ? argv[3] : null; <br />
var domain = (argc > 4) ? argv[4] : null; <br />
var secure = (argc > 5) ? argv[5] : false; <br />
document.cookie = name + "=" + escape (value) + <br />
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + <br />
((path == null) ? "" : ("; path=" + path)) + <br />
((domain == null) ? "" : ("; domain=" + domain)) + <br />
((secure == true) ? "; secure" : "");<br />
}<br />
<br />
function DeleteCookie (name) { <br />
var exp = new Date(); <br />
exp.setTime (exp.getTime() - 1); <br />
var cval = GetCookie (name); <br />
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();<br />
}<br />
// End --><br />
</script><br />
<br />
</HEAD><br />
<br />
<BODY onload="ListToDoItems();"><br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"javascript:AddItem()">Enlist</a><br />
<form name="form1"><br />
<br />
<br />
<!--oh by the way if you want to change the link that say's "enlist" it's directly above this sentence...--><!--content-->Originally posted by brendandonhue <br />
I wouldn't say ASP is any easier than any other serverside language. Whats easier depends on the person. I prefer PHP personally. <br />
<br />
its funny you mention PHP as your fav language,<br />
cause when I try it, it turns my brain upside-down.<!--content-->See its a matter of opinion :D<br />
<br />
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?<br />
Your script neither adds your name to a page or is useful for creating a petition.<!--content-->yeah, I wasnt thinking that JAVASCRIPT would do this either..<!--content-->:( I'm lost, stuck, confused :confused: I need PHP but geocities free doesn't support it (STUPID) WHAT CAN I DO??????<!--content-->Get a different host, or try a shoutbox, or if you have to a really simple guestbook.<!--content-->people, if youre using FREE hosting, why not use a free forum service?<br />
this is for people who dont like to pay for their web services..<br />
<!-- w --><a class="postlink" href="http://www.bravenet.com">www.bravenet.com</a><!-- w --><br />
<br />
when you get an extra couple dollars a month, buy hosting space.<!--content-->I don鎶
 
Back
Top