Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
PHP Parser error
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Re: PHP Parser error
PHP Parser error
09-03-2010 2:13 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hello,
I couldn't get a simple php include to work, so I went back to basics and looked at the php help section on plusnet and copied and pasted this simple php example:
I uploaded it to my cgi space as test.php, changed permissions to 755 then opened it in a browser and got this error:
Any ideas? I've been able to get a simple email contact form to work though.
Many thanks.
I couldn't get a simple php include to work, so I went back to basics and looked at the php help section on plusnet and copied and pasted this simple php example:
<html>
<head>
<?php
// A comment can be inserted like this
// Here we designate some variables
$bgcolor = "green";
$textcolor = "white";
?>
<title>Another PHP example</title>
</head>
<body <?php print "bgcolor='$bgcolor' text='$textcolor';?>>
<h3>Behold, a PHP enabled page :-)</h3>
</body>
</html>
I uploaded it to my cgi space as test.php, changed permissions to 755 then opened it in a browser and got this error:
Quote Parse error: parse error, unexpected $ in /share/storage/03/**/********/**/test.php on line 15
Any ideas? I've been able to get a simple email contact form to work though.
Many thanks.
Message 1 of 3
(941 Views)
2 REPLIES 2
Re: PHP Parser error
09-03-2010 2:29 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Looks like a double quote missing. The line:
should be:
Although this way of styling webpages is a bit out of date, it's generally better to separate content and style using XHTML and CSS or similar, but the example serves as a very basic hello world type thing.
A good place to start with PHP is http://uk.php.net/manual/en/tutorial.firstpage.php
<body <?php print "bgcolor='$bgcolor' text='$textcolor';?>>
should be:
<body <?php print "bgcolor='$bgcolor' text='$textcolor';" ?>>
Although this way of styling webpages is a bit out of date, it's generally better to separate content and style using XHTML and CSS or similar, but the example serves as a very basic hello world type thing.
A good place to start with PHP is http://uk.php.net/manual/en/tutorial.firstpage.php
Message 2 of 3
(361 Views)
Re: PHP Parser error
09-03-2010 2:42 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thanks a lot Ben. I've just realized why my include didn't work. I hadn't changed the extension from html to php.
Message 3 of 3
(361 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page