Jump to content

help!! Warning: extract() [function.extract]: First argument should be an array


thingjimenez

Recommended Posts

hello im a student and creating a registration form for my blog page , can anyone here can help me with this error

 

Warning: extract() [function.extract]: First argument should be an array in /home/content/t/h/i/thingjimenez/html/titi/PersonalSiteManager/registration.php on line 2

 

Warning: extract() [function.extract]: First argument should be an array in /home/content/t/h/i/thingjimenez/html/titi/PersonalSiteManager/registration.php on line 3

 

i cant figure it out . pls help me guyz.

<?
extract($HTTP_GET_VARS); 
extract($HTTP_POST_VARS);
include("konf.php");
error_reporting(E_ALL ^ E_NOTICE);

if($action == "register")
{

$email = $_POST['email'];
$pporuka = $_POST['pporuka'];
$fullname = $_POST['fullname'];
$username = $_POST['username'];
$password = $_POST['password'];
$mjesto = $_POST['mjesto'];
$mdpass = base64_encode($password);

$stremail = $email ;
$strpporuka = $pporuka ;
$strfname = $fullname ;
$struname = $username ;
$strpwrd = $password ;
$strmjesto = $mjesto;

if (ereg("[^A-Za-z0-9]", $username))
{
?>
<script>alert('Username can contain only letters and numbers !');</script>
<meta http-equiv="refresh" content="0; URL=javascript:history.go(-1)">
<?
exit;
}

if ((strlen($username) < 5) or (strlen($username) > 30))
{
?>
<script>alert('Username must have min. 5 or max. 50 letters or numbers !');</script>
<meta http-equiv="refresh" content="0; URL=javascript:history.go(-1)">
<?
exit;
}

$u_path = "$korisnici/ime-{$username}.dat";
if (file_exists($u_path))
{
?>
<script>alert('Username already taken !');</script>
<meta http-equiv="refresh" content="0; URL=javascript:history.go(-1)">
<?
exit;
}

if ((strlen($password) < 5) or (strlen($password) > 50))
{
?>
<script>alert('Password must have min. 5 or max. 50 letters or numbers !');</script>
<meta http-equiv="refresh" content="0; URL=javascript:history.go(-1)">
<?
exit;
}

if ((strlen($fullname) < 5) or (strlen($fullname) > 50))
{
?>
<script>alert('Real name must have min. 5 or max. 50 letters or numbers !');</script>
<meta http-equiv="refresh" content="0; URL=javascript:history.go(-1)">
<?
exit;
}


if ((strlen($email) < 5) or (strlen($email) > 50))
{
?>
<script>alert('Email must have min. 5 or max. 50 letters or numbers !');</script>
<meta http-equiv="refresh" content="0; URL=javascript:history.go(-1)">
<?
exit;
}


if (!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
'@'.
'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email))
{
?>
<script>alert('U must enter a valid email address !');</script>
<meta http-equiv="refresh" content="0; URL=javascript:history.go(-1)">
<?
exit;
}


$imefajla = $_FILES['upfajl']['name'];
$velicina = $_FILES['upfajl']['size'];

if (file_exists($dir.$imefajla))
{
?>
<script>alert('Image already exists !');</script>
<meta http-equiv="refresh" content="0; URL=javascript:history.go(-1)">
<?
exit;
}

if(isset($dozvoljene)){
$dozvoljeno = 0;
foreach($dozvoljene as $ext) {
if(substr($imefajla, (0 - (strlen($ext)+1) )) == ".".$ext)
$dozvoljeno = 1;
}
if($dozvoljeno==0) {
?>
<script>alert('That file type is not allowed to upload !');</script>
<meta http-equiv="refresh" content="0; URL=javascript:history.go(-1)">
<?
exit;
}
}

if($velicina==0) {
?>
<script>alert('Need picture !');</script>
<meta http-equiv="refresh" content="0; URL=javascript:history.go(-1)">
<?
exit;
}

$velicina = $velicina / 1048576;

if($velicina > $maxvelicina) {
?>
<script>alert('Picture is too big !');</script>
<meta http-equiv="refresh" content="0; URL=javascript:history.go(-1)">
<?
exit;
}

$pomjeri = "$dir" . $imefajla;
move_uploaded_file($_FILES['upfajl']['tmp_name'], $pomjeri);
$slika = $dir.basename($_FILES['upfajl']['name']);

$u_data = $email."}{".$pporuka."}{".$fullname."}{".$username."}{".$mdpass."}{".date("j.m.Y")."}{".$mjesto."}{".$slika."}{";
$to = $email;
$year = date("Y");
$potpis = "Personal Site Manager Copyright $year";
$subject="$firma - Registration";
$mess = "Cao $strfname\n\nNow u can login at $firma :\n\nUsername: $username \n\nPassword: $password\n\n$firma\n\n$firmaurl\n\n_______________________________________________________________\n$potpis";
$mailheaders="Return-path: $adminlazni\n";
$mailheaders.="From: $adminlazni\n";
$mailheaders.="Reply-To: $adminlazni\n";
$sent = 1;

$uf = fopen($u_path, "w");
fputs($uf, $u_data);
fclose($uf);

function upisi($post) 
{
include("konf.php");
$datum = date("j.m.Y");
$slika = $dir.basename($_FILES['upfajl']['name']);
$snimi = file($bazapod3);
$imefajla = fopen($bazapod3, "r+");
$izlaz3 = $post."|".$datum."|".$slika."\n";
fwrite($imefajla, $izlaz3);

foreach ($snimi as $prebaci) 
{
fwrite($imefajla, $prebaci);
}
fclose($imefajla);		
}
upisi($username);

if($sent == 1)
{
mail($to, $subject, $mess, $mailheaders);
}
else
{
echo "Molim da provjerite dali ste upisali ispravan email, ne mozemo poslati email na adresu koju ste upisali."; exit;
}
?>
<script>alert('Account created!');</script>
<meta http-equiv="refresh" content="0; URL=index.php">
<?
exit;
}
else
{
?>
<div id="sadrzaj">
<form enctype="multipart/form-data"  action="registration.php?action=register" method="post">
Username: <br>
<input type="text" name="username" value="" size="20"> <font color="#FF0000">*</font><br>
Password: <br>
<input name="password" type="text" id="password"> <font color="#FF0000">*</font><br>
Email: <br>
<input type="text" name="email" value="" size="20"> <font color="#FF0000">*</font><br>
Real name: <br>
<input type="text" name="fullname" value="" size="20"> <font color="#FF0000">*</font><br>
Image: <br>
<input type="file" name="upfajl" size="20"> <font color="#FF0000">*</font><br>
Location: <br>
<input type="text" name="mjesto" value="" size="20"> <font color="#FF0000">*</font><br>
Special message: <br>
<input type="text" name="pporuka" value="" size="20"> <font color="#FF0000">*</font><br>
<br><input type="submit" value="Register !"><br><br>
<font color="#FF0000">*</font>
Must enter
</form>
<br><br>
</div>
<?
exit;
}
?>

 

[attachment deleted by admin]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.