www.webdeveloper.com
Results 1 to 7 of 7

Thread: one html file not working from a location while other is working

  1. #1
    Join Date
    Jun 2009
    Posts
    97

    one html file not working from a location while other is working

    I have following two files in www directory of wamp server. wamp server is installed on vmware.
    1.) dogAbduction.html
    Code:
    <html>
    <head>
    	<title>Aliens Abducted Me</title>
    	<style> td{		width: 250px;
    					height: 20px;
    					font-size: 20px;
    					}
    			td#ffred{	border: 0;
    						background-color: #cccc00;
    					}
    			td#ffblue{	border: 0;
    						background-color: #00cccc;
    					}
    			td#sf{	border: 1px solid #aaaaaa;
    					}
    			input#ip{	width: 250px;
    						height: 20px;
    			}
    	</style>
    </head>
    <body>
    	<h2>Aliens Abducted Me - Report an Abduction</h2>
    	<form action="abductionForm.php" method="post">
    	<table name="reportTable"> 
    		<tr><td id="ffred">First Name:</td><td id="sf"><input id="ip" type="text" /></td></tr>
    		<tr><td id="ffblue">Last Name:</td><td id="sf"><input id="ip" type="text" /></td></tr>
    		<tr><td id="ffred">What is your email address ?</td><td id="sf"><input id="ip" type="text" /></td></tr>
    		<tr><td id="ffblue">When did it happen ?</td><td id="sf"><input id="ip" type="text" /></td></tr>
    		<tr><td id="ffred">How long were you gone ?</td><td id="sf"><input id="ip" type="text" /></td></tr>
    		<tr><td id="ffblue">How many did you see ?</td><td id="sf"><input id="ip" type="text" /></td></tr>
    		<tr><td id="ffred">Describe them</td><td id="sf"><input id="ip" type="text" /></td></tr>
    		<tr><td id="ffblue">What did they do to you ?</td><td id="sf"><input id="ip" type="text" /></td></tr>
    		<tr><td id="ffred">Have you seen my dog, Dipu ?</td><td id="sf1">Yes<input type="radio" name="yes" />No<input type="radio" name="no"/></td></tr>
    		<tr><td id="ffblue">Anything else to add ?</td><td id="sf"><input id="ip" type="text" /></td></tr>
    		
    	</table><br />
    	<input type="submit" value="Report Abduction" />
    	</form>
    </body>
    </html>
    2.) phptest3.html
    Code:
    <html>
    	<head>
    	</head>
    
    	<body>
    		<!-- <form action="http://localhost/phpTest1.php" method="POST"> -->
    		<form action="phptest3.php" method="POST">
    			<label>When It Happened</label>
    			<input type="text" name="whenithappened" /><br />
    			<label>How Long</label>
    			<input type="text" name="howlong" /><br />
    			<input type="submit" value="submit">
    
    		</form>
    	</body>
    </html>
    When I send http request by typing http://localhost/phptest3.html in address bar, its displaying fine in browser. But when I send http request by typing http://locahost/dogAbduction.html in address bar, I am getting error message. "Page can not be found"

    Why is that ?

    When I double click on file name dogAbduction.html , its displaying fine in browser.



    Thanks
    Last edited by manishrathi; 10-03-2012 at 06:00 PM.

  2. #2
    Join Date
    Oct 2012
    Location
    /dev/null
    Posts
    15
    1.) dogAbduction.html
    it is displaying that the page cant be displayed because you stated in the form that abductionForm.php will process the file after you press submit, but you dont have that file.

    2) phptest3.html also tries to call this file phptest3.php to process the input

    .html files will display fine no matter what.

    you are missing these two files: abductionForm.php , and phptest3.php

    basically those php files will grab the input from your .html files and store it in variables, from there you can send it to email to any address , etc.

  3. #3
    Join Date
    Aug 2006
    Posts
    1,906
    Quote Originally Posted by manishrathi View Post
    When I send http request by typing http://localhost/phptest3.html in address bar, its displaying fine in browser. But when I send http request by typing http://locahost/dogAbduction.html in address bar, I am getting error message. "Page can not be found"

    Why is that ?
    Does the file actually have an uppercase "A" in it? And I presume this "locahost" is a typo, you're using "localhost"? I.e. perhaps it is actually http://localhost/dogabduction.html

    Dave

  4. #4
    Join Date
    Jun 2009
    Posts
    97
    I have tried dogabduction.html and dogAbduction.html (with uppercase and lowercase), it gives same error in either case.
    There are other HTML files with uppercase letters in file name , but still they work fine.

    I have replaced dogabduction.php with phptest3.php in action field. phptest3.php is present in www dir of wamp. When I try to get dogabduction.html, I am still getting same error message.
    phptest3.html is working fine, which is in same location like dogabduction.html
    .html files will display fine no matter what.
    But dogabduction.html file is not displaying

    I dont understand what is wrong in here.

  5. #5
    Join Date
    Oct 2012
    Location
    /dev/null
    Posts
    15
    Quote Originally Posted by manishrathi View Post
    I have tried dogabduction.html and dogAbduction.html (with uppercase and lowercase), it gives same error in either case.
    There are other HTML files with uppercase letters in file name , but still they work fine.

    I have replaced dogabduction.php with phptest3.php in action field. phptest3.php is present in www dir of wamp.
    i think you have the wrong ideas what the action field is used for, you dont just put anything in that field, the action field will call the file that you specify there as soon as you press the submit button,
    OR leave the action field empty but you will have to make your file a .php file with code like :


    PHP Code:
    if (isset($_POST['send'])) {
      
    // email processing script
      
    $to 'john@example.com';
      
    $subject 'Feedback from example.com';
      
    // list expected fields
      
    $expected = array('name''email''comments''subscribe''interests''howhear''characteristics');
      
    // set required fields 

    at the top of your file in order to process the information.

  6. #6
    Join Date
    Jun 2009
    Posts
    97
    I understand that. But problem here is HTML file which is used to submit form is not displaying. Whats wrong with that. If I am giving something wrong in action field, then that will cause problem , when I submit. It should not cause problem in loading file. Why is dogabduction.html file is not getting displayed ?

    Thanks

  7. #7
    Join Date
    Oct 2012
    Location
    /dev/null
    Posts
    15
    from your first post, i see that you post:

    http://locahost/dogAbduction.html

    notice localhost has a typo, you wrote it as locahost

    i just copied and pasted your 2 files to my local xampp , and both display fine

    on my pc i put it in a "aliens" folder :
    http://localhost/aliens/dogabduction.html

    displays fine.

    there should be no problem in displaying html files, i would suggest to go to your www directory , and double
    check the filenames, and enter them manually. you are getting that error because it is not finding that page

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles