Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Notice: Undefined variable
  • Under my view the form page (including pages that should be displaying data from mysql) are showing the following error for the isset function. Is it possible to ignore the error message?

    Fuel\Core\PhpErrorException [ Notice ]:
    Undefined variable: error

    <? if (isset($error)): ?><p class="error-msg"><?= $error ?></p><? endif ?>

    I am just trying to connect to an external database but this error is hindering progress.


    Thanks in advance
  • Never mind, I had to enable PHP short tags for the code to work.

  • HarroHarro
    Accepted Answer
    You have to be careful with those, some consider short tags "evil", and quite a few hosting companies have them disabled.
  • Hmm thanks for the heads up! I normally wouldn't enable the tags but since I am going to be migrating a single page (from localhost) to the live site I am hoping it should be fine. Also, I needed to turn them on in order to run the site in IIS 7.
  • HarroHarro
    Accepted Answer
    As long as you're in control of the server, and you can enable short tags in the php.ini. Because it is disabled by default in a lot of cases.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion