If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

webpage help

hey im not a webdesigner or nothing, so im new to all this.Im not gettin in to webdesigning im just makin one to have one and might build more on it later. i just wanna make a form on my page where it sais "Enter your name here" and i have that and a lil box and a submit button, but how can i make it POST to a file like names.txt to my root folder so i can see names that have visited my site. And also if i can make that into a popup that'd be great, they'd have to enter a name and push submit then it lets them to the site, and if they dont they get access denied or something. I know that'd have to be a javascript popup and i googled that and found the script but i dunno where to put it in the script and how the POST &gt;. names.txt or that stuff goes. Im using dreamweaver.

the name you set for the field in the form has to match the name coming in when processing the post information. Depending on permissions on the file you're trying to write to, that should work. Peace.

[edit]
just thought of something. You're pretty safe in this case for input, cause it's just a text file. However, if you were writing these things to a page on your site, You would want to look into some functions like html_special_chars() and strip_tags() (see the php manual). If you do not process the input correctly a user could put code in the form that would execute on your page and that could be bad. So please look into input validation functions if you're displaying their input on a webpage. Also, even for a text file you may want to put a limit on length so that it is not flooded with text. just add an if statement right after the
$visitor = $_POST['visitor_name'];
line, that reads.
if(strlen($visitor) > 40){
echo "input must be less than 40 characters";
}
You can change the length to whatever you want though. Peace.
[/edit]

[edit]darnit, you edited your post. You had a long list of questions, these are the answers I thought were appropriate. I hope you remember your questions .[/edit]
I couldn't get it to work with a popup, but I just tested the code as is and it worked. As for your many questions.

1. you might be able to do it in a popup, but what I tried didn't work.
2. It doesn't necessarily have to be .php. It all depends on your apache configuration. If you have it set for:

AddType application/x-httpd-php .php .html

in your webserver config .html will execute as php as needed.
3. don't know what you're talking about. html is html. You should be able to leave them as .html
4. The file to process it (popup as referenced by you) for my way has to be a php page, but not necessarily with a .php extension as illustrated above. You can do it with other things such as asp or jsp. It all depends on what you/your host have installed. You need to find out if they have any server side scripting stuff installed for the webserver. possibly just cgi.
5. I'm pretty sure dreamweaver can make .php pages. I believe they have syntax highlighting for php also. I guess any editor can make .php pages, it's just an extension.
6. Not really. If you copy my code exactly and php is installed, and you save the page as process.php, it should work. So it's not that hard. Plus they have really good documentation.http://www.php.net
check it out.
if you change the file process.php to process.html you have to change it accordingly in the code.
i.e. action="process.html"
Peace.

hey it sais 'Method Not Allowed". I know its not cuz of permissions cuz i even did chmod 777 names.txt and names.php and it still wouldnt do it. Also it sais "The requested POST is not allowed for the URL /names.php. I dont think its permission problems so i dunno, any ideas? i put in my index1.html pages your first script there, then in names.php i put your second script, and i did change the part that you said to change if i changed process.php to names.php, so i dunno.

Is this your server or someone elses? Cause it sounds like they disabled POST requests in the apache configuration. If it's yours look for some &lt;Limit tag in there about POST, if it's not yours, just change the method to GET in the form. then change the names.php to say $_GET['visitor_name'] instead of POST. That is the simpler fix. Peace.

hey i uncommented some of the stuff that was stopping POST and GET and PUT and directories with it and pointed it with to the directory i made. Can i send you the httpd.conf and have you take a look and see what you think?