Warning: Cannot use a scalar value as an array in

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Warning: Cannot use a scalar value as an array in

    Hi all

    This has just started coming up on a site I run. I haven't changed
    anything, it just started happening. Unfortunately, it's an adult site so I
    can't post the URL here.

    "Warning: Cannot use a scalar value as an array in..."

    In a nutshell, the site is a photo gallery for amateurs. They can upload
    images into the various albums. My gut feeling is that someone has uploaded
    something with illegal characters in a filename or something. This would
    explain why ti wasn't happening yesterdayand it is today.

    If, from this small piece of imformation, someone can give me some pointers,
    I'd be most grateful.

    A


    Redcat Guest

  2. Similar Questions and Discussions

    1. #40752 [NEW]: parse_ini_file() segfaults when a scalar setting is redeclared as an array
      From: hubert dot roksor at gmail dot com Operating system: PHP version: 5.2.1 PHP Bug Type: Reproducible crash Bug...
    2. #38974 [Opn->Bgs]: array should throw warning
      ID: 38974 Updated by: derick@php.net Reported By: hendlerman at yahoo dot com -Status: Open +Status: ...
    3. Array into scalar
      Hi, I have an array derived from a set of radio buttons that I want to break down into a single variable for use with a database. How can I do...
    4. testing for array or scalar in a hash.
      Hi, I have a hash containing, data, everything is generated on the fly so my hash, has some scalars, and some arrays, in it. How can I test wether...
    5. letters in a scalar to array
      hello. i'd like to take the letters in a scalar and make each of them an element in an array. here's what i've got so far.... #!/usr/bin/perl...
  3. #2

    Default Re: Warning: Cannot use a scalar value as an array in


    "Redcat" <nospam@redcatmedia.co.uk> schreef in bericht
    news:bf0lch$os4$1@sparta.btinternet.com...
    > Hi all
    >
    > This has just started coming up on a site I run. I haven't changed
    > anything, it just started happening. Unfortunately, it's an adult site so
    I
    > can't post the URL here.
    >
    > "Warning: Cannot use a scalar value as an array in..."
    >
    You don't have to post an URL, only significant code which is pointed out by
    the line number in the error message. The only I can do for now is to show
    you how to reproduce this error:

    <?
    $scalar = 1;
    $scalar[] = 1;
    ?>

    $scalar is initiated as an integer, which is a scalar. In the second line,
    $scalar gets a value assigned the way you would assign a value to an array.
    Only, $scalar isn't an array but a scalar and this causes the warning.

    Look at the line indicated by the error message in your file and look for
    something simular to this example.


    JW


    Janwillem Borleffs Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139