Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-19-2009, 02:56 PM   #1 (permalink)
jnich104
Monkey N00B
 
jnich104's Avatar
 
Join Date: Jun 2008
Location: Nailsea
Posts: 108
jnich104 is on a distinguished road
Send a message via MSN to jnich104
HTML Form - Php Echo

I have a a HTML form, Which when Submited i would like it to store in a text file and show on a php echo which will show text enterd in the form.


HTML Form :
HTML Code:
<form action="script1.php" method="post" name="" id=""> <input name="username" type="text" id="username"> <input name="firstname" type="text" id="firstname"> <input type="submit" name="Submit" value="Submit"> </form>

PHP :
PHP Code:
<?php
if(isset($_POST['submit'])) : 

    
$username strip_tags($_POST['username']); 
    
$password strip_tags($_POST['firstname']);


echo 
$username ;
?>
I dunno what else to put in the scrip to make it store the inputed info and then echo it, Can any one help?
jnich104 is offline   Reply With Quote
Old 02-19-2009, 03:11 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,706
sde is on a distinguished road
checkout PHP's fwrite function. Use caution though with what users can write to the file and if they can read it.

There's some code samples there too

PHP: fwrite - Manual
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML form preview then INSERT using PHP & MySQL SteveSoler PHP 16 09-21-2008 11:59 PM
HTML Form with PHP preview, print, submit btumpak PHP 13 07-30-2008 11:57 AM
Mysql Database submision using html form/php Snot Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 1 06-13-2008 08:17 AM
HTML FORM tag query??? j.gohel HTML, XML, Javascript, AJAX 3 04-19-2005 11:19 AM


All times are GMT -8. The time now is 06:00 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting