Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

CS5 won't display php object property references correctly.

Community Beginner ,
Jan 24, 2011 Jan 24, 2011

Copy link to clipboard

Copied

All,

   I have some code that I know works, its a script I got from here:

http://www.evolt.org/node/60384

A short summary of the problem is illustrated through this code:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<?

class Session{
     var $name = 'blah';

}

$sesh = new Session;

echo '<p>'.$sesh->name.'</p>';

?>
</body>
</html>

It seems that the page when viewed locally should display

blah

but instead I get

name.'

'; ?>

In fact, any time I use the '->' php feature in Dreamweaver this sort of thing happens.

I have xampp installed, created a site and local server for the particular project, and have used CS5 for numerous other projects without problems (I know the procedure for running php and mysql locally), although I have never used classes and the -> feature until now.

When I upload the script to my live webserver, it works fine. But, I would like to get to the bottom of this problem so that I can test more effectively on my own computer. I believe the problem lies either in Apache's or Dreamweaver's interpretation of '->'.

Any help would be greatly appreciated.

Thanks,

   Zach

TOPICS
Server side applications

Views

541
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jan 24, 2011 Jan 24, 2011

You're missing the "php" in the opening bracket - should be <?php

Votes

Translate
Explorer ,
Jan 24, 2011 Jan 24, 2011

Copy link to clipboard

Copied

You're missing the "php" in the opening bracket - should be <?php

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 24, 2011 Jan 24, 2011

Copy link to clipboard

Copied

LATEST

Thanks bud! I didn't even realize the code didn't have the correct opening tags.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines