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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.