Re: PHP & HTML: newbie question
| From: | mike cullerton | Date: | Wed, 16 Jan 2002 21:35:27 +0000 |
| Subject: | Re: PHP & HTML: newbie question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80837@lists.php.net to get a copy of this message | ||
hmmm... not sure about the cgi part. you'll probably need to start the file
with something like
#!/usr/loca/bin/php -q
either way, within the file, you also need to tell the php parser what is
php and what is html. surround the php code with <?php ?> tags like
<?php
$var = 'Hello World';
?>
<html><head></head><body>
<table><tr><td><?php print($var); ?></td></tr></table>
</body></html>
on 1/16/02 2:25 PM, Richard at reeshard@mac.com wrote:
>
> Hi there
>
> I just signed up for an account at Spaceports so I can play with PHP I
> placed some PHP code in an HTML page and uploaded it to the server.
>
> But when I checked it in my browser I got the error message: can¹t parse
> line 1
>
> Line 1 is simply the <HTML> tag!!
>
> On one of their user forums someone suggested getting rid of the HTML tags
> so I did and just left the PHP code on its own and this works fine so how
> can I use PHP with HTML?
>
> I think it has something to do with the fact that have to use their CGI
> server to run PHP???
>
> Cheers
>
> Richard S
>
-- mike cullerton michaelc at cullerton dot com