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...
- I started to work in forms, for which i coded two files under the extension .html and .php
- What ever i type in the text fields in .html file will be passed on to the variables inside the .php code file
- 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..