barkermn01
11-16-2007, 12:32 PM
in some post i see people echo "(HTML code)"
E.G.
echo'<input type="text" value="use me" name="hello"'>
Why not just
?> //end php
<input type="text" Value="use me" name="Hello">
This has one major good side it is quicker PHP is not loadin alod of HTML for it to echo straight back out ?
ok soem times you have to echo the code coz there are difernt thing you want on one depeding on things setup but
at the end of a php file jut close the php and just send the data as html to the users end
Second one
i see people inlude("SQLConnect.php");
function ....
{
...
...
...
}
it is easter to load the SQLCONNECT in the function
E.G
function adduser()
{
incude("SQLConnect.php");
...
...
...
}
One this is eayer to follow 2 people helping can see that you are using SQL Connection and if you ever open your code people can follow easyer insted of forgeting you have opend SQL at the top
and yes again some times this is better say if you have all your SQL functs in one file serperte from the rest but then tell users that are giving u support that it is included coz we cant see that usless we are told by use when we are fixing functions
P.S if you have seen users do some thing that stops people helping coz we dont know what the have loaded Post it and leave it so users can see wht would be good Practise
E.G.
echo'<input type="text" value="use me" name="hello"'>
Why not just
?> //end php
<input type="text" Value="use me" name="Hello">
This has one major good side it is quicker PHP is not loadin alod of HTML for it to echo straight back out ?
ok soem times you have to echo the code coz there are difernt thing you want on one depeding on things setup but
at the end of a php file jut close the php and just send the data as html to the users end
Second one
i see people inlude("SQLConnect.php");
function ....
{
...
...
...
}
it is easter to load the SQLCONNECT in the function
E.G
function adduser()
{
incude("SQLConnect.php");
...
...
...
}
One this is eayer to follow 2 people helping can see that you are using SQL Connection and if you ever open your code people can follow easyer insted of forgeting you have opend SQL at the top
and yes again some times this is better say if you have all your SQL functs in one file serperte from the rest but then tell users that are giving u support that it is included coz we cant see that usless we are told by use when we are fixing functions
P.S if you have seen users do some thing that stops people helping coz we dont know what the have loaded Post it and leave it so users can see wht would be good Practise