Re: Apache Access

From: Date: Mon, 21 Aug 2000 05:06:51 +0000
Subject: Re: Apache Access
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-12712@lists.php.net to get a copy of this message
You said you type in "http://localhost/forms/mydbf4.html". Have you configured php to parse .html files? If not (and most people say you shouldn't), then you should rename your file as "mydbf4.php3 (or .phtml, or whatever you have php configured for). "Andrew V. Romero" wrote: > > Thanks for the help. It is funny, the tutorial you mentioned is the one > I have > been making my way through and I am still stuck on lesson two. At this > point I > have basically been copy/paste the guys code and then running it, and I > still > get that error. Let me give you the code for what I am running: > <html> > <body> > <?php > > if ($submit) { > // process form > $db = mysql_connect("localhost", "root"); > mysql_select_db("mydb",$db); > $sql = "INSERT INTO employees (first,last,address,position) > VALUES > ('$first','$last','$address','$position')"; > $result = mysql_query($sql); > echo "Thank you! Information entered.\n"; > } else{ > // display form > ?> > > <form method="post" action="<?php echo $PHP_SELF ?>"> > First name:<input type="Text" name="first"><br> > Last name:<input type="Text" name="last"><br> > Address:<input type="Text" name="address"><br> > Position:<input type="Text" name="position"><br> > <input type="Submit" name="submit" value="Enter > information"> > </form> > <?php > } // end if > ?> > </body> > </html> > This particular example I have saved in apache's htdocs\forms > (c:\program > files\apache group\apache\htdocs\forms) directory (I created the > subdireecotry > forms in the htdocs directory. The database this is trying to access is > in > c:\mysql\data\mydb. So if I start mysqld, then start apache, and go to > my > browser and type in http://localhost/forms/mydbf4.html, enter > first and > last > name, address, and position, and hit submit the URL changes to > http://localhost/forms/<?php echo $PHP_SELF?> and it > still gives the > error of > "Forbidden | You don't have permission to access /forms/< on this > server. | > Apache/1.3.12 Server at localhost Port 80" > > If I go to windows explorer and check the properties on the forms > directory, it > is not listed as read only, and if I go to the /mysql/mydb it is not > read only > either. So do you have any ideas what is causing the error message? In > previous lessons the guy was showing how to retrieve records from the > database > and those examples worked just fine. I have only run into problems when > I tried > to write more records to the database. > Thanks for all your help. > > Matt Schroebel wrote: > > > A good place to start with PHP is at: > > http://hotwired.lycos.com/webmonkey/programming/php/ > > > > I use FreeBSD unix, but Windows 95 doesn't have security so users doesn't > > matter. The directory could be read only, but it looks to me like you have > > a typo in your code. The path has a trailing < sign. Anyway, I think it's > > best to start simple so that you know where your trouble is so, cut the > > sample code below and try it on your server. If it still doesn't work, look > > at http://www.apache.org > > <html> > > <head> > > </head> > > <body> > > > > <?php > > if (empty($submit)) { ?> > > <form method="post" action="<?php echo $PHP_SELF ?>" > > name="sample"> > > Your name: &nbsp; > > <input type="text" name="name" size="82" > > maxlength="80"> > > <input type="submit" name=submit value="submit"> > > </form> > > <?php > > } > > else { > > echo "<p>$name</p>\n"; > > } > > ?> > > </body> > > </html> > > ----- Original Message ----- > > From: "Andrew V. Romero" <Rom22ero@pharmacy.arizona.edu> > > To: <php-general@lists.php.net> > > Sent: Sunday, August 20, 2000 12:51 AM > > Subject: [PHP] Apache Access > > > > > Hi, I have been working on learning how to make html forms and then have > > > that data sent via a php script to a database in mysql, but today after > > > almost completing my first form to submit data to the database, I hit a > > > problem. I am very new at this whole web server thing, so bear with > > > me. My problem is that once I hit submit on the web browser, an error > > > pops up "Forbidden| You don't have permission to access /forms/< on this > > > server.| Apache/1.3.12 Server at localhost Port 80", and I think this is > > > due to me really not setting up any users. This apache is just running > > > on my home win95 computer and I am basically just using it to test my > > > creations before posting them somewhere so security isn't really an > > > issue. So my question is, how can I set up users (the manual is very > > > unclear here), and how do I allow myself access to read and write any > > > directory? > > > Thanks, > > > If you want to reply personally, remove all numbers from my name. > > > -- > > > Andrew V. Romero > > > Romer1999o@pharmacy.arizona.edu > > > Remove the #'s from my address to reply. > > > http://www.u.arizona.edu/~avr/ > > > ICQ #54080914 > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-general-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > ----- Original Message ----- > > From: "Andrew V. Romero" <Rom22ero@pharmacy.arizona.edu> > > To: <php-general@lists.php.net> > > Sent: Sunday, August 20, 2000 12:51 AM > > Subject: [PHP] Apache Access > > > > > Hi, I have been working on learning how to make html forms and then have > > > that data sent via a php script to a database in mysql, but today after > > > almost completing my first form to submit data to the database, I hit a > > > problem. I am very new at this whole web server thing, so bear with > > > me. My problem is that once I hit submit on the web browser, an error > > > pops up "Forbidden| You don't have permission to access /forms/< on this > > > server.| Apache/1.3.12 Server at localhost Port 80", and I think this is > > > due to me really not setting up any users. This apache is just running > > > on my home win95 computer and I am basically just using it to test my > > > creations before posting them somewhere so security isn't really an > > > issue. So my question is, how can I set up users (the manual is very > > > unclear here), and how do I allow myself access to read and write any > > > directory? > > > Thanks, > > > If you want to reply personally, remove all numbers from my name. > > > -- > > > Andrew V. Romero > > > Romer1999o@pharmacy.arizona.edu > > > Remove the #'s from my address to reply. > > > http://www.u.arizona.edu/~avr/ > > > ICQ #54080914 > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-general-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > -- > Andrew V. Romero > Romero@pharmacy.arizona.edu > http://www.u.arizona.edu/~avr/ > ICQ #54080914 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- -------------------- To send e-mail to me replace the domain name with djdesign.com The phony "anti.spam" domain is used to fool newsgroup e-mail address harvestor 'bots. ----------------------

« previous php.general (#12712) next »