
Originally Posted by
holthelper
php shorthand is a bad practice and should be avoided for as stated before most apache servers dont recognize shorthand.
school is starting for me too and ill be doing CCNA through Cisco. WEEEEEEEEE
It's not that apache servers don't "recognize" it, it's just disabled by default- and for good reason.
If you have PHP short-tags enabled, you can't use an <?xml ?> leading tag on xHTML 1.1 documents.
Example of an XHTML 1.1 document
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html version="-//W3C//DTD XHTML 1.1//EN"
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/xhtml
http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"
>
<head>
<title>Virtual Library</title>
</head>
<body>
<p>Hello, World!</p>
</body>
</html>
The above example leads to a PHP parse error with short-tags enabled.
You can also have ASP tags enabled, but it's disabled by default.
ASP tags will not conflict with XML. You shouldn't be coding in ASP anyway, so there's no reason not to unless.. well I state below why asp & short tags can be bad..
PHP Code:
<?php
ini_set('display_errors', 1);
ini_set('error_reporting', -1);
$str = "This is a string in PHP";
?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html version="-//W3C//DTD XHTML 1.1//EN"
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/xhtml
http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"
>
<head>
<title>Virtual Library</title>
</head>
<body>
<% for($i=0;$i<10;$i++):%>
<p><%=$str%></p>
<% endfor%>
</body>
</html>
The problem with asp_tags and short_tags, is that you have to enable them in the php.ini file (ex: /etc/php5/apche2/php.ini). That also requires you to restart apache after making appropriate changes to that file (find "asp_tags" or "short_tags", change value to 'On' or 'Off').
If you're coding an application to be used on more than one server, this could be a problem, as not all host providers let you edit this file for your account. Example, when a host decides to stupidly share this file across users.. which is a security risk and there's better ways of doing this, but not everyone thinks ahead, so there are hosts out there (like free hosts) that are retarded and don't care about their client's security or features.
If your application is supposed to be compatible for use by one of their clients, of if you're one of their clients, you cannot use use asp_tags or short_tags.
If it's a private project, go for it.. It's kind of like using PHP as a templating language.
...

Originally Posted by
foxx
but in the end without a framework it's still gonna me messy procedural php
That's an opinion with a lack of experience, but many people actually know how to code *clean* without a framework. Even procedural code can be clean, it's just harder to do.
If you code it in OOP, and it becomes a procedural mess, you're not coding OOP correctly. You don't need a framework to code neatly.. Especially if u jump to a framework from a clutter life-style, it'll still be a cluttered mess.
Also, MVC is a design pattern. It's not patented by ZEND. Model View Controller is a good design pattern, but it doesn't require a framework or style of programming, though it does work good coded in OOP.