/    Sign up×
Community /Pin to ProfileBookmark

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>[/code]

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>[/CODE]

When I send http request by typing [url]http://localhost/phptest3.html[/url] in address bar, its displaying fine in browser. But when I send http request by typing [url]http://locahost/dogAbduction.html[/url] 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

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@molossusOct 04.2012 — 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.
Copy linkTweet thisAlerts:
@tracknutOct 04.2012 — 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 ?
[/QUOTE]


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
Copy linkTweet thisAlerts:
@manishrathiauthorOct 04.2012 — 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.[/QUOTE]But dogabduction.html file is not displaying

I dont understand what is wrong in here.
Copy linkTweet thisAlerts:
@molossusOct 04.2012 — 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.[/QUOTE]


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 :


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



at the top of your file in order to process the information.
Copy linkTweet thisAlerts:
@manishrathiauthorOct 04.2012 — 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
Copy linkTweet thisAlerts:
@molossusOct 05.2012 — from your first post, i see that you post:

http://[COLOR="#FF0000"]locahost[/COLOR]/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://[B]localhost[/B]/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
×

Success!

Help @manishrathi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...