Jump to content

Recommended Posts

Posted

anyone know how to use dreamweaver to use a text area and use a submit button, to Initially:

 

Save the text area to a text file, using the date and time as the file name.

 

Then Secondly:

 

Grabbing the username and computer name.

 

 

This is staying offline so nothing that needs publishing to the internet.

 

Cheers guys!!

 

 

Ps i know how to create a form and add the text areas and submit button, o and its been started in HTML so anyother coding will need to be complient

Posted

Using a bit of PHP you should be able to grab the computer name using something like:

 

$computername = gethostbyaddr($_SERVER['REMOTE_ADDR']);

 

and then echoing the variable into a hidden field in your form. That assumes you have a working DNS Server on site obviously. I've not tested it, but if I get chance I will do.

 

Not sure how you might go about the username though.

Posted

And then for the next bit (sheesh .. I would save some time if I read and replied to the whole post where I could! lol)

 

//define the path to your file
$myFile = ./path/to/filename.txt; 

//now to open your file (or say you can't) and save it as a variable
$filestorage = fopen($myFile, 'w') or die("can't open file");

//now to write your old file back and the new data from the form (repeat the ", $_REQUEST['fieldnames']" for each field you have.  The "\n" puts a line break in.
fwrite($filestorage, $_REQUEST['fieldnames']."\n");

//and to close your file
fclose($filestorage); 

 

In terms of putting PHP into Dreamweaver, any php should be contained within the tags:

 

<?php

 

?>

 

You would have to set your form action to being pointing to a PHP file that has in the parsing things (there are plenty of useful things on Google for setting up form scripts and the like).

 

Of course, the other thing to make sure is that you have PHP installed on your webserver (so if using IIS then you can install PHP onto it either using the nice new tools from Microsoft or by googling for how to do it.

Posted

yea php server is not installed on the server and cant be sadly, this is why i wondering if php was possible. its meant for a local machine and saves to the hard drive, maybe javascript??

 

thanks for the replies and effort!! :)

Posted

No worries, there's always WAMP if you have local admin rights and it's just for one machine. That will install a local webserver you could use (even share to other machines if you really wanted).

 

Java, well, I google for scripts and credit. Never did really get my head round that one! lol .. :cool:

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



×
×
  • Create New...