skrypt nie działa w php8

ikp-php2

New member
witam,



Dawno temu pojawił się ciekawy skrypt php, który może zostać uruchomiony w budowaniu i rozbudowie strony:



tworzę plik o rozszerzeniu .inc



np. ja utworzyłem :



00g0.inc gdzie znajdują się parametry, dane, które wykorzystuję na stronie głównej



np.:



<?

//////////////////////////////////dane podstawowe do stron



//adres strony

$str1 = "adres strony";



//nazwa strony

$nazwa1 = "nazwa strony";



//plik startowy G0

$start0 = "index.php";



//nazwa do listy

$sciezka0 = "serwis ...";



//katalog technicznych plików .css i .js

$tech1 = "00tech";



//katalog główny grafiki

$gafiki1 = "00gr";



itd….



?>





do śledzenia strony dopisuję przed znacznikiem <html>





<?php wymaga("00g.inc"); ?>



<?php include("../00g0.php"); ?> - wymagane jest jeszcze jeden plik w tym pliku, który jest tylko składnią wymaganą z innego nazwy pliku .inc





następnie w treści wydanych danych z tych plików .inc



np.:



<a href="serwis/druk.php" target="_blank" title="wydrukuj artykuł"><img src="<? echo $str1?>/00gr/drukarka_art.png" border="0" hspace="5" vspace="5" align="right" alt="" title="wydrukuj artykuł" onmouseover="if(document.images) this.src='<? echo $str1?>/00gr/drukarka_art2.png'" onmouseout="if(document.images) this.src='<? echo $str1?>/00gr/drukarka_art.png'"></a>



Zainstaluj też zamiast członu 00gr wstaw <? echo $gafik1?>



tak zrobiłem menu, artykuły i inne elementy strony...



wszystko działa OK., gdy na dodatek był php5...



gdy pojawi się rodzaj zmiany hostingu, gdzie obowiązywał php8, zaczął być problem – przestała wyświetlać się prawidłowo :(



gdzie jest problem? co trzeba zrobić, aby ponownie wystąpić problem? – skutki uboczne?



niestety webmaster ze mnie zwykły licznik na Waszą pomoc :)...
 
Hello,

A long time ago an interesting php script appeared, which can be run in the construction and expansion of the site:

two files with the extension .inc

for example, I created:

00g0.inc where there are parameters, data that I use on the main page

for example:

<?

////////////////////////////basic data for pages

//page address
$str1 = "page address";

//page name
$nazwa1 = "page name";

//start file
$start0 = "index.php";

//name to the list
$sciezka0 = "serwis ...";

//technical .css and .js files directory
$tech1 = "00tech";

//graphics root directory
$gafiki1 = "00gr";

etc….

?>

in the page code I add before the <html> tag

<?php require("00g.inc"); ?>
<?php include("../00g0.php"); ?> - if you need another file with other data (parameters) in the file being created, another file name but also .inc extension

then in the content of the page being created I enter e.g.

<a href="serwis/druk.php" target=" _blank" title="print article"><img src="<? echo $str1?>/00gr/drukarka_art.png" border="0" hspace="5" vspace="5" alignment="dobre" alt="" title="print article" onmouseover="if(document.images) this.src='<? echo $str1?>/00gr/drukarka_art2.png'" onmouseout="if(document.images) to. src='<? echo $str1?>/00gr/drukarka_art.png'"></a>

I could also insert <? instead of the 00gr element echo $gafik1?>

this is how the menu, articles and other elements of the page are created...

everything works OK., when the server was php5...

when I changed the hosting, where php8 is required, there was a problem - the script stopped working :(

where is the problem? what do I need to do to make the script work again?

unfortunately I am a weak webmaster, I count on your help :)...
 
From PHP5 to PHP8 numerous changes have been made. To be honest, you should consider the idea of restructuring your site, because checking the changes in PHP versions is going crazy (many updates suddenly).
I recommend migrating your application to Laravel, believe me, you will save time, code and headaches.
PS: with Laravel it will be easier for you and you will not break your head thinking about the security of your site
 
As damanyer said, many changes have been made since PHP5. My suggestion is to go back to the drawing board and revise the changes. It's hard to even read your code as it is not formatted on the forums correctly using
Code:
 
Back
Top