Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Proper commenting syntax?


Recommended Posts

Ok, I'm feeling utterly brain-dead at the moment. Been trying several different versions of commenting and none of them seem to be working right.


Specifically, I need to know how I would indicate that several lines have been commented out, with my own comments about why and when. And also how I'd put in comments about what I've added, why & when.


I'm so frustrated at the moment as well because I've spent the entire day renaming all my files (and the referenced files within them) to .pcgi because the error_basedir stuff was driving me nuts and this was the suggestion from my host. It worked! Wonderful!!! But now, after getting through some customizations, and not having any luck with commenting, I'm getting major errors in my store, so I'm starting from scratch again by re-extracting the zip file, then going through that whole, long, tedious process of making the .pcgi changes in every .php file in the whole system. Grrrrrrrrrr...

Link to comment
Share on other sites

commenting in PHP can be done several ways.


single line:

// $i = 1;


multiple lines:


$i = 2;

$bla = 7;

// this is a single line comment within the block comment 

$bluh = 123.5;

this is just text... 

since we're in a comment

it doesn't get parsed and therefore

does not give errors.



You can also comment with # but I never use that as I find it confusing.

I use the multiple lines method alot to de-activate certain blocks of code to debug etc. It also it the most clear for commenting your code.


radical combi ;)

/* single comment line with multiple lines method */[code]


read more:






"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

Read the Manual?


Look here:




It explains all you want to know about comments.


Using .pcgi as an extension is very uncommon. Are there special reasons to work this way? In all my osCommerce time I have never seen such a thing.



You can't have everything. That's why trains have difficulty crossing oceans, and hippos did not adapt to fly. -- from the OpenBSD mailinglist.

Link to comment
Share on other sites

Thanks for the link to info about comments. It helps a lot!


As for the pcgi issues, my host just upgraded to 4.2.3 and I was having all those open_basedir issues. Asked them about it, they checked restrictions on their end, then found this:




Apparently until a new version is released that fixes this bug, I'm stuck. For some reason, switching the extension to .pcgi instead of .php fixes the problem. I no longer got all those open_basedir errors and could upload images no problem. Very strange as far as I'm concerned. And a royal pain in the patoot!!! But I wanna get this thing working so I'll try it!


Thanks again!



Link to comment
Share on other sites

hmmm, that document really didn't clarify for me what the proper syntax for commenting something out actually is. In fact, it looked rather like gibberish to me.


If someone could simply tell/show me what an opening comment sytax and a closing syntax would be for commenting out multi-lines, and then the proper syntax for simply adding a comment into one single line...I would SO appreciate it.


I've tried numerous different comment syntax things:




(for multi-lines)



(for single lines)


<!- COMMENT //->

(for single lines this works fine. I just don't know how to apply it to multi-lines)



(for single lines)


And I'm sure there are others that I'm just not recalling right now.


I need some HELP!!!


Thanks very much. I LOVE what I've seen of this program so far!



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...