-4

I am developing a page in HTML and PHP, but a specific part of PHP doesn't work (the other parts work, including alerts, database connection, etc)... Does anybody have any clue? Thanks in advance! Gabriel

<form>
    <div class="col-md-4">
        <div class="control-group">
            <label class="control-label" for="edition_eventname">Nome do Evento</label>
            <div class="controls">
                <select id="edition_eventname" name="edition_eventname" class="form-control">   
                    <?php alert("oi"); ?>
                </select>
            </div>
        </div> 
    </div>
    <div class="col-md-4">
    </div>
    <div class="col-md-4">
    </div>
</form>
TerryG
  • 309
  • 1
  • 10
Gabriel Sotero
  • 155
  • 1
  • 13

1 Answers1

1

You can not use alert in PHP. That function does not exist.

There are several other functions that print data.

For example:

<?php
   echo "my String";
   var_dump( $mixedVar );
   print "hello world";
?>

echo and print are not real functions ( language construct ), that's why you can use them with and without parentheses.

TheFrozenOne
  • 1,695
  • 9
  • 19