hi I wrote php code
do.php
<?php session_start(); ob_start();
$salladim = $_SESSION['salla'];
$salladin = isset($_GET['url'])?$_GET['url']:'' ;
if(!in_array($salladin,$salladim))
{
header( 'refresh: 1; url='.$_SERVER['HTTP_REFERER'].'' );
echo '<h2>Hazirlaniyor...</h2>';
exit();
}
file.php
<?php session_start();
function kodsalla($uzunluk)
{
$karakterler = "0123456789"."ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$kod = "";
while(strlen($kod) < $uzunluk)
{
$kod .= substr($karakterler, (rand() % strlen($karakterler)), 1);
}
return($kod);
}
$kodsalla = kodsalla(8);
$_SESSION['salla'][] = $kodsalla;
When i run this code, i get the following error :
PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /home/site/public_html/do.php on line 5