Can you save form data to the website?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Spencer Killen
    New Member
    • Jan 2011
    • 10

    Can you save form data to the website?

    In my website i have forms that are submitted into the URL and then converted into javascript on the next page, i wish to have sort of like a survey on the first page and then she the results of others on the next, is their anyway of storing javascript variables into an html file, my web hosting doesn't allow anything else and doesn't allow the post method (webs.com) If its not possible can someone explain a way to do it in notepad?

    also the email form code also brings up windows live mail and the form data doesn't even appear in the message is the a way to email form data just from the website?






    if it will help heres the codes for both my pages

    index.htm
    Code:
    <html>
    <head></head>
    <body onload="message()">
    
    <div style="position:absolute;top:10px;left:50px" >
    
    <form name="input" action="index2.htm" method="get">
    Name: <input type="text" name="user" /> <br />
    Age:   <input type="number" name="age" min="1" max="120" /> <br />
    E-mail: <input type="email" name="email" /> <br />
    <input type="radio" name="sex" value="male" /> Male<br />
    <input type="radio" name="sex" value="female" /> Female <br />
    <input type="checkbox" name="bike" value="Yes" /> I have a bike<br />
    <input type="checkbox" name="car" value="Yes" /> I have a car <br />
    
    <input type="submit" value="Submit" />
    
    </form>
    
    
    <noscript></noscript><!-- --><script type="text/javascript" src="http://www.freewebs.com/p.js"></script><script type="text/javascript">
    
    
    
    
    if (localStorage.pagecount2)
    	{
    	localStorage.pagecount2=Number(localStorage.pagecount2) +1;
    	}
    else
    	{
    	localStorage.pagecount2=1;
    	}
    document.write(<br /> + "You've been on this page " + localStorage.pagecount2 + " time(s)");
    
    
    
    
    </script>
    
     
    
    </div>
    
    
    
    
    
    
    
    </body>
    </html>
    index2.htm
    Code:
    <html>
    <head>
    </head>
    <body>
    
    
    
    <noscript></noscript><!-- --><script type="text/javascript" src="http://www.freewebs.com/p.js"></script><script type="text/javascript">
    
    
    function querySt(ji) {
    hu = window.location.search.substring(1);
    gy = hu.split("&");
    for (i=0;i<gy.length;i++) {
    ft = gy[i].split("=");
    if (ft[0] == ji) {
    return ft[1];
    }
    }
    }
    
    
    
     localStorage.sex = querySt("sex");
     localStorage.car = querySt("car");
     localStorage.bike = querySt("bike");
     localStorage.user = querySt("user");
     localStorage.age = querySt("age");
     localStorage.email = querySt("email");
    
    
    
         var strReplaceAll =  localStorage.user;
         var intIndexOfMatch = strReplaceAll.indexOf( "+" );
          
         // Loop over the string value replacing out each matching
         // substring.
         while (intIndexOfMatch != -1){
         // Relace out the current instance.
         strReplaceAll = strReplaceAll.replace( "+", " " )
          
         // Get the index of any next matching substring.
         intIndexOfMatch = strReplaceAll.indexOf( "+" );
         }
          
    
         localStorage.user = strReplaceAll;
    
    
       
    
    
         var strReplaceAlla   =  localStorage.email;
         var intIndexOfMatcha = strReplaceAlla.indexOf( "%40" );
          
         // Loop over the string value replacing out each matching
         // substring.
         while (intIndexOfMatcha != -1){
         // Relace out the current instance.
         strReplaceAlla = strReplaceAlla.replace( "%40", "@" )
          
         // Get the index of any next matching substring.
         intIndexOfMatcha = strReplaceAlla.indexOf( "%40" );
         }
          
    
         localStorage.email = strReplaceAlla;
    
    
    
    
    
    document.write( localStorage.user+" is "+localStorage.sex+" and "+localStorage.age+" years old. His/Her email is "+ localStorage.email);
    
    
    
    
    
    -->
    </script>
    
    
    
    </body>
    </html>
  • AutumnsDecay
    New Member
    • Mar 2008
    • 170

    #2
    I'd change hosts, personally, especially if you're using their free package of hosting.

    You can find basic PHP enabled hosting plans for like, $1/mo

    Comment

    Working...