SourceDevelop
  • Home
  • Learn A Language
  • Articles & Tutorials
  • Forums
  • Other Resources
Visual Basic HTML/CSS PHP/MySQL
PHP MySQL More Resources
index Forums Index Search Search Member List Member List Help Help

  • Search
  • Member List
  • Calendar
  • Help

Welcome Guest ( Login | Register )


Latest News: We share our revenue with our members, click here for more details.
SourceDevelop > Programming and Web Design > HTMS/CSS/Javascript/PHP/MySQL > Submit?

Partners:
TV & Dinner MorningStarr RustyWalrus Josechukkiri

Post Reply  Post Thread 
Threaded Mode | Linear Mode
Submit?
Author Message
Kuefler


Beginner
*

Group: Members
Posts: 10
Joined: Apr 2008
Status: Offline
Reputation: 0
SD$: 5
Post: #1
Question  Submit?

I want to set up a Submit, that stores information to another location on the server, I don't want users to see the submitted information, I want the users to be redirected somewhere else. What's the Simplest way to set up a Submit?

The information doesn't need to be hidden, I just don't want users to see it right away, all the stuff could just be stored in a text file, an I can check it when i want to.

04-03-2008 09:52 AM
Find all posts by this user Quote this message in a reply
Brian


Member
*

Group: Administrators
Posts: 289
Joined: Feb 2006
Status: Offline
Reputation: 0
SD$: 328
Post: #2
RE: Submit?

It depends on your server setup for how to do this. If your server has PHP you can do something such as the following:

First you have an html file with the form on it, and example one is below:

userform.html

Code:
<html>
<head></head>
<body>
<form action="submit.php" method="post">
    Name:  <input type="text" name="name" /><br />
    Email: <input type="text" name="email" /><br />
    <input type="submit" name="submit" value="submit" />
</form>
</body>
</html>


Next you have a php file, named in the action part of the html file as is shown below:

submit.php

PHP Code:
$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $_POST['name'];
fwrite($fh, $stringData);
$stringData = "\n"; // write a new line to the file
fwrite($fh, $stringData);
$stringData = $_POST['email'];
fwrite($fh, $stringData);
fclose($fh); 


I didn't explain this very fully, so if you would like some more info on how to do this, and such please let me know.


Brian
04-03-2008 10:20 AM
Find all posts by this user Quote this message in a reply
Kuefler


Beginner
*

Group: Members
Posts: 10
Joined: Apr 2008
Status: Offline
Reputation: 0
SD$: 5
Post: #3
RE: Submit?

Yes, please continue.

04-03-2008 11:16 AM
Find all posts by this user Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump:

Contact Us | SourceDevelop | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication

Powered By MyBB
Copyright © 2002-2009 MyBB Group