Web Development Thread, Dreamweaver webforms in Coding and Web Development; anyone know how to use dreamweaver to use a text area and use a submit button, to Initially:
Save the ...
-
9th November 2009, 04:15 PM #1
Dreamweaver webforms
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
-
-
IDG Tech News
-
9th November 2009, 04:23 PM #2 Using a bit of PHP you should be able to grab the computer name using something like:
PHP Code:
$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.
-
-
9th November 2009, 04:26 PM #3 Well username isnt very important, its just so i know whos using the webform
cheers
-
-
9th November 2009, 04:34 PM #4 o and also how do you add php into a html site on dreamweaver??
-
-
9th November 2009, 04:38 PM #5 Grab username for intranet?
That's only an IIS based solution, I have no idea if you can use Linux to do the same thing... I rolled back over to IIS simply because I couldn't figure out how to do it using Apache.
-
-
9th November 2009, 04:41 PM #6 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)
PHP Code:
//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.
-
-
10th November 2009, 01:58 PM #7 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!!
-
-
10th November 2009, 03:56 PM #8 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 ..
-
SHARE:
Similar Threads
-
By NikChillin in forum Educational Software
Replies: 0
Last Post: 21st April 2009, 11:51 AM
-
By rasssp in forum Educational Software
Replies: 2
Last Post: 11th June 2008, 11:59 PM
-
By laserblazer in forum General Chat
Replies: 6
Last Post: 31st May 2008, 01:57 PM
-
Replies: 2
Last Post: 15th May 2008, 06:38 PM
-
By clarky2k3 in forum Windows
Replies: 4
Last Post: 30th January 2008, 10:39 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules