By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,708 Members | 1,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,708 IT Pros & Developers. It's quick & easy.

Array arguments

P: 4
Warning: array_unshift() [function.array-unshift]: The first argument should be an array in /home/mash99/public_html/thebestoptions.co.cc/book-store/finstall.php on line 383

Warning: array_unshift() [function.array-unshift]: The first argument should be an array in /home/mash99/public_html/thebestoptions.co.cc/book-store/finstall.php on line 384

How could I fix it???
Apr 23 '10 #1
Share this Question
Share on Google+
5 Replies


chathura86
100+
P: 227
The first argument should be an array
i think this tells you the problem

any way post your code so we can have a look

Regards
Apr 23 '10 #2

P: 4
@mahhood
Expand|Select|Wrap|Line Numbers
  1. array_unshift($robots,$crlf);                                             // prepend a blank separator line...
  2.   array_unshift($robots,'Sitemap: '.$freeburl.'Bookshop_index.xml'.$crlf);  // ...then prepend the sitemap directive
  3.   $robots[]='User-agent: *'.$crlf;
  4.   $robots[]='Disallow: '.$localslash.$localurl.$crlf;
  5.   $robots[]='Allow: '.$localslash.$localurl.'allbooks/allbooks.'.$crlf;
  6.   $robots[]='Allow: '.$localslash.$localurl.$myshop.$crlf;
  7.   $robots[]='Allow: '.$localslash.$localurl.'abechange.php'.$crlf;
  8.   $robots[]='Allow: '.$localslash.$localurl.'abes.php'.$crlf;
  9.   $robots[]='Allow: '.$localslash.$localurl.'book-search.php'.$crlf;
  10.   $robots[]='Allow: '.$localslash.$localurl.'free.php'.$crlf;
  11.   $robots[]='Allow: '.$localslash.$localurl.'holder.php'.$crlf;
  12.   $robots[]='Allow: '.$localslash.$localurl.'search.php'.$crlf;
  13.   $robots[]='Allow: '.$localslash.$localurl.'used-books.php'.$crlf;
  14.   $robots[]='Allow: '.$localslash.$localurl.'Bookshop_index.xml'.$crlf;
  15.   $robots[]='Allow: '.$localslash.$localurl.$freebdirname.'-sitemap'.$crlf;
Apr 23 '10 #3

Dormilich
Expert Mod 5K+
P: 8,639
how do you define $robots?
Apr 23 '10 #4

P: 4
@Dormilich
Expand|Select|Wrap|Line Numbers
  1. //       process:  
  2.   $robots=NULL;
  3.   if ($oldrobots!=NULL)
  4.   {
  5.     $target=$localslash.$localurl;  
  6.     foreach($oldrobots as $line)
  7.     {if (strpos($line,$target)===FALSE && strpos($line,$localslash.'freebie'.$localslash)===FALSE) $robots[]=$line;}      $top=count($robots);
  8.     $top=$top-1;  // convert to 0-based offset
  9.     if (trim($oldrobots[$top])!=NULL) $robots[]=$crlf;  // tag on blank separator line (if extant file)
Apr 23 '10 #5

Dormilich
Expert Mod 5K+
P: 8,639
$robots is NULL, as long as $oldrobots (and some of its conditions) is NULL. that’s all I can see in the posted code. it may well be that $robots is passing your code without being altered.
Apr 23 '10 #6

Post your reply

Sign in to post your reply or Sign up for a free account.