-1

I'm trying to create two PHP pages. The first is a form to take the user's input on what color they want the background, and text, of the output to say. The second page will take these inputs and print them. The error is coming at line 12, which is the first print statement, but even if I delete this it appears there's something wrong with the second print statement as well.

I'm currently getting the following error:

Parse error: syntax error, unexpected '>' in /students/ralvar71/public_html/cs130a/color_output.php on line 12

Below is what I've written for the second page to pull the selected values from the first with "Print the colors" as the title.

Print the colors

<?php

$backgroundColor = $_REQUEST[‘Background’];
$textColor = $_REQUEST[’Text’];

print “<p>The background color is: $backgroundColor</p>”;
print “<p>The text color is: $textColor</p>”;


?>

Ron A
  • 15
  • 3

1 Answers1

0

Try this:

<?php
$backgroundColor = $_REQUEST['Background'];
$textColor = $_REQUEST['Text'];

echo '<p>The background color is: '.$backgroundColor.'</p>';
echo '<p>The text color is: '.$textColor.'</p>';
?>
Payer Ahammed
  • 887
  • 1
  • 5
  • 16