Writting php page - my writting style.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
snarkiest
Forum Commoner
Posts: 30
Joined: Mon May 04, 2009 10:06 am
Location: Latvia
Contact:

Writting php page - my writting style.

Post by snarkiest »

Hi check this. That is one of my site pages. So I would like to hear about the code writing style. How it should be written?

I ask it because now when I found a need of javascript I don't know how to include it because the whole page is unbroken <?PHP ?> code. Please help me out with the way I'm writing. How should I write the code so I can include javascript?
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Writting php page - my writting style.

Post by McInfo »

Writing Javascript with PHP is no different than writing HTML with PHP. You can either echo strings from PHP as you are doing now or drop out of "parse" mode into "direct output" mode.

PHP Manual: Escaping from HTML

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Tue Jun 15, 2010 11:30 pm, edited 1 time in total.
snarkiest
Forum Commoner
Posts: 30
Joined: Mon May 04, 2009 10:06 am
Location: Latvia
Contact:

Re: Writting php page - my writting style.

Post by snarkiest »

Jep, I just found it too! Thank you anyway.
Post Reply