954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

A sharing violation

When I run the following code:

<?php


$firstname = "First Name";
$middlename = "Middle Name";
$lastname = "Last Name";

$name = $firstname  .“ “. $middlename .” “. $lastname

echo $name

?>


This errors appears:

A sharing violation occured while accessing C:\xampp\htdocs\php_exercise\exercise1.php

why is it?

davy_yg
Posting Whiz
377 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

why didn't you missed semi colon for line numbers : 9 and 11.
try with this, if not success again post your error.

Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
 

I did try those, the error remains the same. And I am unable to save the file.

davy_yg
Posting Whiz
377 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

Lines 9 and 11 should be terminated as mentioned by Shantic C. Also, your double quotes should be (" ") not (“ “). From what I can see, you typed lines 5 to 7 yourself and copied and pasted line 9 from somewhere. I encounter this problem anytime I copy from a PDF into notepad++. If I'm right, simply remove those quotes on line 9 and manually type them.

cossay
Junior Poster
128 posts since Nov 2010
Reputation Points: 17
Solved Threads: 22
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: