Jump to content

sood.rahul

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by sood.rahul

  1. Hi, Yes, I am using Apache & it seems it is working correctly. But again, as you have rightly mentioned, I might have corrupted something which I might not be sure of. Just to let you know I am getting this issue in all the HTML forms where I used the POST method to send data from the forms to my PHP. Other standalone phps are working fine. Can you think of any resolution on Apache? Am not sure of WAMP - not even heard of it. And as Apache is widely used, I would like to stick to it. What do you suggest?
  2. Hi, I just added these lines above my php code (please see below) but still nothing has happened. No error messages are displayed and nothing has been added to the "error.log" file under "C:\Program Files\Apache Software Foundation\Apache2.2\logs". I am still getting the same error message. Am I doing something wrong here? Did you want me to add these lines somewhere else? Can adding these lines at the top turn on error checking? <?php ini_set('display_errors',1); error_reporting(E_ALL); $con = mysql_connect("localhost","root","orange"); if (!$con) { die('Could not connect: ' . mysql_error()); } echo "Connection established"; mysql_select_db("my_db", $con); $sql="INSERT INTO Persons (FirstName, LastName, Age) VALUES ('$_POST['firstname']','$_POST['lastname']','$_POST['age']')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added with name: " $_POST[firstname] $_POST[lastname]; mysql_close($con) ?>
  3. Hi, Is there anyone who can help me in resolving this error please? Appreciate any help in this regard! -Rahul
  4. Hi All, I know it is a silly error but I am very new to PHP (only 2 days!!!) & unable to resolve this. I have seen a lot of resolutions online for example: 1) Copying the "php5isapi.dll" file to the PHP directory & under "Program Files" as well. 2) Copying the "favicon.ico" file etc etc Before I could elaborate the issue, please note that I am a Windows user - Windows XP (I know its not the best of the OS's to work with!!!) When initially I started getting the issue, I checked the "error.log" file under "C:\Program Files\Apache Software Foundation\Apache2.2\logs" & following is what I saw: ----------------------- [sun Sep 18 14:13:25 2011] [notice] Server built: Sep 9 2011 10:26:10 [sun Sep 18 14:13:25 2011] [notice] Parent: Created child process 4420 [sun Sep 18 14:13:25 2011] [notice] Child 4420: Child process is running [sun Sep 18 14:13:25 2011] [notice] Child 4420: Acquired the start mutex. [sun Sep 18 14:13:25 2011] [notice] Child 4420: Starting 64 worker threads. [sun Sep 18 14:13:25 2011] [notice] Child 4420: Starting thread to listen on port 80. [sun Sep 18 14:14:55 2011] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico [sun Sep 18 14:21:37 2011] [notice] Server built: Sep 9 2011 10:26:10 [sun Sep 18 14:21:37 2011] [notice] Parent: Created child process 7976 [sun Sep 18 14:21:37 2011] [notice] Child 7976: Child process is running [sun Sep 18 14:21:38 2011] [notice] Child 7976: Acquired the start mutex. [sun Sep 18 14:21:38 2011] [notice] Child 4420: Released the start mutex [sun Sep 18 14:21:38 2011] [notice] Child 7976: Starting 64 worker threads. [sun Sep 18 14:21:39 2011] [notice] Child 4420: All worker threads have exited. [sun Sep 18 14:21:39 2011] [notice] Child 4420: Child process is exiting [sun Sep 18 14:21:39 2011] [notice] Child 7976: Starting thread to listen on port 80. [sun Sep 18 14:21:52 2011] [error] [client 127.0.0.1] File does not exist: C:/Rahul/Personal/Web Development/favicon.ico ---------------------- Then I created an icon file and named it "favicon.ico" & placed it in the following destinations: 1) C:/Rahul/Personal/Web Development/ and 2) C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/ but to no avail But interestingly & surprisingly, the error.log file stopped giving any of the above error messages but I still get the HTTP Error. Following is the error message that I get on the browser: -------------------------- Server error The website encountered an error while retrieving http://localhost/Forms/insert%20data.php. It may be down for maintenance or configured incorrectly. Here are some suggestions: Reload this webpage later. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. -------------------------- Now, just to let you know which php I am using, so, just to let you know, I just copied the html & php from http://www.w3schools.com/PHP/php_mysql_insert.asp. Following are they: HTML: ---------------------------- <html> <body> <form action="insert data.php" method="post"> Firstname: <input type="text" name="firstname" /> Lastname: <input type="text" name="lastname" /> Age: <input type="text" name="age" /> <input type="submit" /> </form> </body> </html> ----------------------------- PHP ----------------------------- <?php $con = mysql_connect("localhost","root","orange"); if (!$con) { die('Could not connect: ' . mysql_error()); } echo "Connection established"; mysql_select_db("my_db", $con); $sql="INSERT INTO Persons (FirstName, LastName, Age) VALUES ('$_POST['firstname']','$_POST['lastname']','$_POST['age']')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added with name: " $_POST[firstname] $_POST[lastname]; mysql_close($con) ?> ------------------------- I hope someone is able to help me in this & I guess I have mentioned everything I could to explain the error! Many thanks in advance! Rahul
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.