LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-24-2011, 01:23 AM   #1
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Rep: Reputation: 29
Need a howto manual


Where do I find a howto manual on writing a form_action.asp page? I found 1 that delt with sending email. But that is not what I want.

I need to simply store the data from a form on my website and read it back later. Perhaps print it out.

Thanks
 
Old 09-24-2011, 02:23 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hello,

This is the very first link I have found, searching on google - http://www.w3schools.com/ASP/asp_inputforms.asp
I recommend you search first before posting new threads in the future. Let me know if you need more information or help.

Cheers,

Josh
 
1 members found this post helpful.
Old 09-24-2011, 09:01 AM   #3
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Original Poster
Rep: Reputation: 29
I just about wore W3 out before asking here. I have seen your reference. I read that sample as writing back out to the screen. That is not what I am looking for. I want to store the input onto disk for later retrieval.

I was hoping that there might be a simple script somewhere that would do this. I am not a programmer so I get into new ground with all the different languages.

This is a snippet from a PHP guestbook program I have on the website. Do I need to think along the lines of this code snippet.
Code:
($handle=fopen($file,'a+') or die("Could not open file: $file"));

if($mode=='sign')
{
if($name!='') fwrite($handle,"$date\n$name\n$site\n$comments\n");
echo "<form method='post' action='$self'>
<input type='hidden' name='mode' value='sign'>
<b>Date</b>: $date
<p><b>Name</b>: <input type='text' name='name'>
<p><b>Website</b>: <input type='text' name='site'>
<p><b>Comments</b>:<br><textarea name='comments' cols='20' rows='8'></textarea>
<p><input type='submit' value='Sign'>
</form>
Thanks for the offer to help.
Dave
 
Old 09-29-2011, 09:17 PM   #4
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Original Poster
Rep: Reputation: 29
Using code found on this page
Code:
http://www.w3schools.com/php/php_file_upload.asp
I can confirm that my system is compatable to my server. I can upload a grafic image.

Every example I see is about transfering a previously writen file or image to the server. Nothing I have found tells me how to create a filename and write form date to that filename.

To create the filename I modified W3 examples:
Code:
<html>
<body>

<form action="create_file_user_name.php" method="get" enctype="text/plain">
Enter your real name as it will be used several times: <input type="text" name="fname" /><br />
<br />
<input type="submit" name="submit" value="Submit" />
</form>

</body>
</html>
create_file_user_name.php
Code:
<?php 
 echo >> upload/"$fname";
?>
That did not work.
create_file_user_name.php
Code:
<?php>
	touch(upload/"$fname");
</>
That did not work.
Looking to trap an error I found this example else where on the web.
create_file_user_name.php
Code:
<?php 
 // try and create a file in the directory
if ($_FILES["text"]["error"] > 0)
    {
    echo "Error: " . $_FILES["file"]["error"] . "<br />";
    }
  else
    {   
     if(!touch("upload/$fname")) {
            echo("Can't touch "$fname" file");
            exit;
        }
        if(!unlink("upload/$fname")) {
            echo("Can't unlink "$fname" file");
            exit;
        }
 }
else
  {
  echo "Invalid name";
  }
?>
This was not successful and did not return an error message.

And this did not work.
Code:
<?php
$file = fopen("test.txt","r+w");

//some code to be executed

fclose($file);
?>
I give up, how do I create an empty file name on my server?
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
man -t manual | ps2pdf - > manual.pdf error Amdx2_x64 Linux - General 2 07-01-2011 03:22 AM
Linux Multicasting HOWTO.HOWTO Join Multicast Groups ar24458 Linux - Networking 0 04-02-2007 01:55 AM
OS API manual/howto? jon_k Programming 13 11-02-2004 11:24 PM
Howto update KDE and howto switch off kdm/gdm Canaris Linux - Software 1 06-15-2003 08:40 PM
Manual online fatboyjim Linux - Newbie 10 06-06-2002 04:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration