Jump to content
Larry Ullman's Book Forums

Chapter 3 Exercise


Recommended Posts

This is probably a really stupid question but here goes anyway...

 

I am trying to complete the exercise on Page 60 and when I submit the form I get the following result:

 

Thank you, $title $name, for your comments.

You stated that you found this example to be $response and added:

$comments

"; ?>

 

I double checked the php code and everything looks fine. The only thing I can think of is I am not loading the form properly. I am using apache on my machine. The text in step 8 has me thinking I am doing something wrong because it has in parenthesis to load it through a URL (http://something). I tried loading it as http://localhost/feedback.html but that doesn't work. The only way I can open the file is by putting the path to the directory in the URL.

 

I am sure I am making a stupid mistake.

 

Thanks in advance.

 

Scott

Link to comment
Share on other sites

Hi Scott,

 

What is your actual code your using?

 

Secondly, I don't have the book so bare with me, can you run php ok on your local server, i.e build a small test page like test.php

<?php

echo 'Hello Scott';

?>

does that echo out the correct page, if not what do you get? Also you're loading feedback.html, should this perhaps be feedback.php instead?

 

Also when you say it doesn't work, how doesn't it work and what do you see?

Link to comment
Share on other sites

Thanks for the response. I have been able to create and load php files up to this point while doing the exercises. Chapter 3 is using forms so it is feedback.html that I need to load. I will look over the code again but both files look identical to what the book shows.

 

 

Hi Scott,

 

What is your actual code your using?

 

Secondly, I don't have the book so bare with me, can you run php ok on your local server, i.e build a small test page like test.php

<?php

echo 'Hello Scott';

?>

does that echo out the correct page, if not what do you get? Also you're loading feedback.html, should this perhaps be feedback.php instead?

 

Also when you say it doesn't work, how doesn't it work and what do you see?

Link to comment
Share on other sites

Thanks Larry. I noticed that you did stress that so I did try to load it through a URL but I am not sure what address to use.What exactly does http://something mean? I tried using http://localhost/feedback.html just as I would with one of the php files in earlier exercises but it did not work. I even tried variations of that using the xampp directory. I also tried just typing the file path into the URL but I assume that is the same as going to file>open and navigating to the proper directory.

Link to comment
Share on other sites

Yeah, the file path won't work either. The browser address MUST begin with http://. The "something" part then is the hostname, folder name, and script name. What those are depends upon the OS in use, the Web server in use, the specific script, and so forth.

 

To repeat the question I asked in my last post, what URL did you use to run PHP scripts in earlier chapters?

Link to comment
Share on other sites

In your last post you referred to feedback.html, which is the page you're having a problem with. What I'm saying is, presumably you went through the first two chapters, correct? And presumably you were able to execute those PHP scripts, correct? So, for example, when you successfully ran predefined.php from Chapter 2, what URL did you use for that? So could you please post the complete URL of a specific script from a previous chapter that you were able to execute?

Link to comment
Share on other sites

 Share

×
×
  • Create New...