RE: What's wrong with these two programs?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Check out the other responses, but another thought is that you may not have your web server configured to process .PHP files properly.  If it thinks it's a text file, it won't pass it through the PHP script interpreter.  Go back over the instructions for installing PHP on your web server and make sure that you have .PHP and it's associated MIME type pointing to your php.exe for processing.

If you need specifics, check the PHP Installation instructions or post another note to the list.  Sorry, I don't have enough time right now to dig up the info.  Just wanted to point you in that direction as a possibility.

-TG

> -----Original Message-----
> From: aomarlow [mailto:aomarlow@xxxxxxxxx] 
> Sent: Monday, November 22, 2004 10:36 PM
> To: php-windows@xxxxxxxxxxxxx
> Subject:  What's wrong with these two programs?
> 
> 
> Hi,
>  
> Can anyone tell me what's wrong with the two following
> programs?  The first (whatsName.html) is straight
> HTML, and is supposed to build a form that asks a
> question.  The second program, (hiUser.php) is
> supposed to read the value input by the user, and
> process it.  I'm not having any trouble with the first
> program, but when the second program runs, it prints
> out code, rather than getting the result that it is
> supposed to get.
>  
> Have I linked the two programs in the wrong way, or
> something like that?  BTW, both of these programs are
> sample programs from the book, "PHP 5/MySQL
> Programming for the Absolute Beginner."
>  
> Here are the two programs:
>  
> 1.)  whatsName.html:
>  
> <html>
> <head>
> <title>What's your name?</title>
> </head>
> <body>
>  
> <h1>What's your name?</h1>
> <h3>Writing a form for user input</h3>
>  
>   <form method = "post"
>         action = "hiUser.php">
>   Please type your name:
>   <input type = "text"
>   name = "userName"
>   value = "">
> 
>    <br>
>    <input type = "submit">
>    
>    </form>
>    
> </body>
> </html>
>  
> Here is program #2.) hiUser.php:
>  
> <html>
> <head>
> <title>Hi User</title>
> </head>
> <body>
> <h1>Hi User</h1>
> <h3>PHP program that receives a value from
> "whatsName"</h3>
>  
> <?
>   print "<h3>Hi there, $userName!</h3>";
>     
> ?>
>   
> </body>
> </html>
>  
> Your help is always appreciated!
> Anthony
>  
> 
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> The all-new My Yahoo! - Get yours free! 
> http://my.yahoo.com 
>  
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux