Severity: 8192
Message: Return type of CI_Session_files_driver::open($save_path, $name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 113
Severity: 8192
Message: Return type of CI_Session_files_driver::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 280
Severity: 8192
Message: Return type of CI_Session_files_driver::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 145
Severity: 8192
Message: Return type of CI_Session_files_driver::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 223
Severity: 8192
Message: Return type of CI_Session_files_driver::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 303
Severity: 8192
Message: Return type of CI_Session_files_driver::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 344
Severity: 8192
Message: setcookie(): Passing null to parameter #7 ($httponly) of type bool is deprecated
Filename: core/Input.php
Line Number: 410
Yine karşılaştığım problemlerden birisi GET metodundaki linkten (URL) değişkenleri almak. İnternette epey tarama yaptıktan sonra çözümü birisinin paylaştığı bir fonksiyonla sağladım. Daha sonrasında bir çözüm yolu daha buldum ve şimdi 2 fonksiyonu birden paylaşacağım. Kullanma tercihi size kalmış.
Problem
Bildiğiniz gibi GET metodunda linkler aşağıdaki gibi gözükür. Bizim istediğimiz ise id veya isim karşısında bulunan değeri almak.
http://hakantasan.com.com/index.php?id=123&isim=hakan
Çözüm Fonksiyonu 1
function GetUrlValue(VarSearch)
{
var SearchString = window.location.search.substring(1);
var VariableArray = SearchString.split('&');
for(var i = 0; i < VariableArray.length; i++){
var KeyValuePair = VariableArray[i].split('=');
if(KeyValuePair[0] == VarSearch){
return KeyValuePair[1];
}
}
}
Fonksiyon Kullanım Örneği: GetUrlValue('isim'); => Bu sayede isim değişkeninin değerini alabiliyoruz.
Çözüm Fonksiyonu 2
function getUrlVars()
{
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value){
vars[key] = value;
});
return vars;
}
Fonksiyon Kullanım Örneği: getUrlVars()["id"]; => Bu sayede id değişkeninin değerini alabiliyoruz.
Nasıl çalıştığını görmeniz açısından kodları paylaşıyorum.
YORUMLAR