Jump to content

( ! ) Parse error: syntax error, unexpected $end in (line 77)


Lorenzdakid

Recommended Posts

I'm not very good at php, but this is my full code. I'm not sure what the problem is. If anyone could give me a hand, I would surely appreciate it. Line 77 in the last line of the this code.

 

 

 

<html>

<head>

<title>Ace!</title>

</head>

<body>

<h1>Ace!</h1>

<h3>Demonstrates if statement</h3>

 

<?php

 

$begin = rand(1,10);

print "You picked roman number $begin";

 

printNumber16($begin);

printNumber110($begin);

 

 

function printNumber16($begin){

    global $begin;

 

if ($begin == 1 ){

  print "I";

} else if ($begin == 2){

    print "II";

} else if ($begin == 3){

    print "III";

} else if ($begin == 4){

    print "IV";

} else if ($begin == 5){

    print "V";

} else {

    print "I don't know what you talking bout broham";

}

 

 

 

 

function printNumber110($begin) {

 

  global $begin;

 

  switch ($begin){

  case 1:

    $roman = "I";

    break;

  case 2:

    $roman = "II";

    break;

  case 3:

    $roman = "III";

    break;

  case 4:

    $roman = "IV";

    break;

  case 5:

    $roman = "V";

    break;

  case 6:

  $roman = "VI";

    break;

  default:

    print "This is an illegal die!";

}

 

 

print "<br>";

print "<br>";

print "You chose roman number $roman";

print "<br>";

print "<br>";

?>

 

<br>

Refresh this page in the browser to roll another die.

 

</body>

</html>

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.