Answer the question
In order to leave comments, you need to log in
How to improve the skills of building a web application (php)?
Hello! Today I was told that I have fundamental skills in building web applications, but they will not reach the junior level.
So I have a bad application structure, but how can I improve it?
It is clear that you need to practice, but how to do it if you don’t know if it’s right or again a low level of construction?
The most important question: how to develop your application building skills correctly?
Link to my squalor https://github.com/Bleef159/proVisit
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Link to my squalor
<html>
. . .
</html>
<!-- Код выполнен за 0.531 секунды -->
if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
error_reporting(E_ALL);
break;
case 'testing':
case 'production':
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}
if (strlen($uri)>1) {// если не главная страница...
if (rtrim($uri,'/')!=$uri) {
header("HTTP/1.1 301 Moved Permanently");
header('Location: http://'.$_SERVER['SERVER_NAME'].str_replace($uri, rtrim($uri,'/'), $_SERVER['REQUEST_URI']));
exit();
}
}
if (x = 0) {
if ( isset(y) ) {
echo 'The Y is set';
}
if ( isset(z) ) {
echo 'The Z is set';
}
echo "Echo something";
}
if (strlen($uri) > 1 && rtrim($uri, '/') != $uri) {
// some code
}
// Плохой подход
echo 'У меня есть ' . get_my_apples_from_database() . ' яблок, потому что ' . get_my_apples_from_database() . ' яблок — это круто';
// Хороший подход
$my_apples = get_my_apples_from_database();
echo "У меня есть $my_apples яблок, потому что $my_apples яблок — это круто";
// Плохой подход
$my_apples = get_my_apples_from_database();
echo "У меня есть $my_apples яблок";
// Хороший подход
echo 'У меня есть ' . get_my_apples_from_database() . ' яблок';
RewriteCond %{REQUEST_URI} ^.+
RewriteRule ^(.*)/$ /$1 [L,R=301]
$i = 0;
foreach($query->result_array() as $row)
{
$myrow[$i]['url'] = $row['url'];
$myrow[$i]['title'] = $row['title'];
$myrow[$i]['text'] = substr(strip_tags($row['text']),0,255);
$i++;
}
$myrow[] = array();
foreach($query->result_array() as $row)
{
$myrow[] = array(
'url' => $row['url'],
'title' => $row['title'],
'text' => substr(strip_tags($row['text']),0,255)
);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question