-1

Hello i am using a windows 8 platform, initially i have installed wamp server package for working on php but then later on wanted to try working with Apache. At first, downloaded an apache version along with a php version but once installed and configured started to face several issues such as apache was throwing message:"operation failed" but gradually sorted it by reading plenty of posts from other users and found out it was a small syntax issue with in the php.ini and httpd.conf files respectively. Now let me get to the center of problems...

  1. I started to work in forms, for which i coded two files under the extension .html and .php
  2. What ever i type in the text fields in .html file will be passed on to the variables inside the .php code file
  3. Once the form is executed it should show the values typed in the textfields of .html file and show the result on .php file (i have used conditions inside .php code)...

I hope you got what i meant?, Anyways further more.. The code i have included are as follows...

[hello.html file]...

< form action="welcome.php" method="post">
<li>< label for="firstname">First Name: </label></li>
<li>< input type="text" id="firstname" name="firstname" /></li>
<li>< label for="lastname">Last Name: </label></li>
<li>< input type="text" id="lastname" name="lastname" /></li>
<li>< input type="submit" value="GO!" /></li>
< /form>

[welcome.php file]...

Hello, < ?php 
$firstname = $_REQUEST['firstname']; // i also tried this with $_POST
$lastname = $_REQUEST['lastname'];
if($firstname == 'john' and $lastname == 'lennon') {
  echo "Hello great musician";
} else {
  echo "$firstname $lastname";
}
?>
< /body>

Once the above is executed it shows... Hello When i run welcome.php on the server it gives me a syntax of:

Notice: Undefined index: firstname in C:\apacheserver\apache\htdocs\welcome.php on line 13
Notice: Undefined index: lastname in C:\apacheserver\apache\htdocs\welcome.php on line 14

these lines pointed to are:

$firstname = $_REQUEST['firstname'];
$lastname = $_REQUEST['lastname'];

Also when i ran httpd -k start on apache\bin> i get a message saying...

httpd: Could not reliably determine the servers fully qualified domain name,
using 192.168.0.3 for ServerName
(OS 10048)Only one usage of each socket address (protocol/network/address
/port) is normally permitted. : make_sock: could not bind to address
0.0.0.0:80 no listening sockets available, shutting down Unable to open
logs

Can someone please help me with this issue, I have been working on it for the past 24 hrs and sleepless night..

1 Answer 1

1

Your code dosen't have anything to do with your issue.

Googling would tell you that running a web server on port 80 on windows 8 often dosen't work because windows 8 already has a web server running for some software that runs in modernui.

Use another port and you should be fine - you can edit your apache config file to do this. There's also other workarounds that tell http.sys not to bind to all the ip addresses as you'd see in this SU answer or to shut down the service using port as per this SO answer

A much more sensible approach would be to grab a VM host, and do your development there, since you can better approximate a realistic production environment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .