austinator

html??

14 posts in this topic

i need to know of a way to make a submit form that sends what ever you type in the text area to a text file

ive googled and read but just cant find what im looking for

can anyone help me please? :D

0

Share this post


Link to post
Share on other sites

what part are you having trouble with? can you please post the code that you have managed to write?

0

Share this post


Link to post
Share on other sites

<FORM action="http://somesite.com/prog/adduser" method="post">

<P>

<LABEL for="firstname">First name: </LABEL>

<INPUT type="text" id="firstname"><BR>

<LABEL for="lastname">Last name: </LABEL>

<INPUT type="text" id="lastname"><BR>

<LABEL for="email">email: </LABEL>

<INPUT type="text" id="email"><BR>

<INPUT type="radio" name="sex" value="Male"> Male<BR>

<INPUT type="radio" name="sex" value="Female"> Female<BR>

<INPUT type="submit" value="Send"> <INPUT type="reset">

</P>

</FORM>

but i want what is typed in the form to be sent to a text file on a web host

but i dont know how to do this

0

Share this post


Link to post
Share on other sites

your going to need to use a server side script such as PHP to do the actual writing.

http://www.tizag.com/phpT/filewrite.php

http://www.tizag.com/phpT/postget.php

Do you have access to edit the code on the page or are you coming from an outside source? If your coming from an outside source, but you can inject Javascript, look into using javascript to read from forms and submit to a php script.

http://www.javaworld.com/javaworld/jw-06-1...javascript.html

Edited by n3xg3n
0

Share this post


Link to post
Share on other sites

i have never needed a form to write to a text file, but i dont imagine its very hard. i am sure someone will answer that question. all of my form stuff stores info into a database.

If i were to do this, i would first use php to validate the info being submitted. then use something like http://www.tizag.com/phpT/filewrite.php to write it to a file. you can use most any language and i dont know if that is the best way of doing it, thats just a quick search without me testing anything. I will look into this tomorrow if someone else doesn't have a better way.

0

Share this post


Link to post
Share on other sites

i dont believe so, as you have to take that form information and process it. also you really need to validate the info before you store it on your server.

0

Share this post


Link to post
Share on other sites

well im not worried about security

could you just give me an example of what you would do to achieve this because im kinda lost

but i would get it if i had an example that is explained

0

Share this post


Link to post
Share on other sites

php file to POST to:

<?
$fname = $_POST['firstname'];
$lname = $_POST['lastname'];
$email = $_POST['email'];
$sex = $_POST['sex'];

$file = "users.txt";
$fh = fopen($file, 'a');

fwrite( $fh, $fname."\n".$lname."\n".$email."\n".$sex."\n\n" );

fclose($fh);
?>

though for user management, databases would usually be better.

0

Share this post


Link to post
Share on other sites

Yeah you're definitely going to have to find a free host that supports php or something on which to host your phishing site, you won't be able to do it with just HTML ;)

0

Share this post


Link to post
Share on other sites

hahahaha im not trying to phish

i was just trying to do something that ive never seen before

0

Share this post


Link to post
Share on other sites

Well I'm sure you can see why people would think that :roll:

I'd send you some code examples of how what you're asking for typically works, but you see, they're all from phishing sites I've investigated ;)

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now