Re: [PHP] is ?= good?

2010-06-11 Thread Ahmed Mohsen

On 6/12/2010 12:34 AM, tedd wrote:

At 2:19 PM -0700 6/11/10, Daevid Vincent wrote:

EVERY other tag in an XML document is just straight up html :


Just curious -- like html tags:

hr
br

Or do you have to change them to:

hr /
br /

How does XML handle those tags?

Cheers,

tedd



If they have no content, you should use hr / tags, otherwise use the 
full open and close tags around the content. titleCONTENT/title


--
Kind regards,
Ahmed Mohsen.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] is ?= good?

2010-06-11 Thread Ahmed Mohsen

On 6/11/2010 11:43 PM, Daevid Vincent wrote:

-Original Message-
From: tedd [mailto:tedd.sperl...@gmail.com]

I believe, just because it can be done doesn't mean that it
should be done.

My practice is *never* to use?=

In fact, my practice is to not only use?php echo, but to enclose
the echo argument with a (), like:

?php echo(The answer is $answer);?

I am sure there will be some that think that my practice is an
overkill, or not good practice, but it's a good thing that we all
have a choice. Make your choice to best serve how you want your code
to look.


As per http://us3.php.net/echo

echo() is not actually a function (it is a language construct), so you are
not required to use parentheses with it. echo() (unlike some other language
constructs) does not behave like a function, so it cannot always be used in
the context of a function. Additionally, if you want to pass more than one
parameter to echo(), the parameters must not be enclosed within
parentheses.

So you might want to reconsider your coding practice/style here and use the
construct as designed or you might end up with a far worse scenario than
short-tags could ever provide. Something more along the Python print
debacle.

Also, for the love of God, please don't embed a variable into a literal
string and use preprocessing.

Do it like so:

?php echo 'The answer is '.$answer; ?



Hey Daevid, does this form ?php echo 'The answer is '.$answer; ? 
improve anything in processing time or it's just for the sake of 
readability?


--
Kind regards,
Ahmed Mohsen.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Redirect to

2010-06-10 Thread Ahmed Mohsen

Hi folks,
I know that this is not a php question, but I'm sure it some kind 
related to it.  I need to put my public files under public folder, and 
other includes files and database config in other folder not shown to 
the public, but i don't know how to do that. I hope if some one show me 
how to achieve this.


For example, this is the directory structure:

/root
--/includes
db.php
config.php

--/public
/index.php
/images
/admin
--/login.php



I don't want to enter (example.com/public) to view index.php file.  I 
just want to enter (example.com) and it redirects to the public folder 
and shows only (example.com/index.php) in the URL.  And for login.php 
should display (example.com/admin/login.php) not 
(example.com/public/admin/login.php)


Kind regards,
Ahmed.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] is ?= good?

2010-06-10 Thread Ahmed Mohsen
I know that i should use the full open tag in php ?php ? but i want to 
know if its good to use this tag ?=$name? instead of ?php echo $name ?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Redirect to

2010-06-10 Thread Ahmed Mohsen

Thanks for help.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] is ?= good?

2010-06-10 Thread Ahmed Mohsen

On 6/11/2010 2:49 AM, Daniel Brown wrote:

On Thu, Jun 10, 2010 at 19:35, David Harknessdavi...@highgearmedia.com  wrote:


According to some PHP 6 will remove support for short tags. They won't be
disabled by default--the feature simply won't exist.

http://www.slideshare.net/thinkphp/php-53-and-php-6-a-look-ahead


 I don't know why Stefan said that, but in fairness, that slideshow
is two years old.  You'll still see short_open_tags, but you'll no
longer have ASP-style tags or the little-knownscript language=PHP
options available.


It still much safer to use the full tag to avoid any errors in the future

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Test [don't read]

2010-06-07 Thread Ahmed Mohsen

On 6/7/2010 9:15 PM, João Cândido de Souza Neto wrote:

I couldn´t resist.


teddtedd.sperl...@gmail.com  escreveu na mensagem
news:p0624080cc832e662f...@[192.168.1.102]...


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com




me too ;)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php