Jump to content

Stops echoing?


rednebmas

Recommended Posts

It is not outputting anything after the third echo. This is where it is http://sambender.com/brandon/review.php?subject=Math%20Problems

 

echo "<table border='0'><tr><td><div id='question'><b>Question:</b><br/>$question</div></td></tr>";
echo "<tr><td><div id='answer' style='display:none;'><b>Answer:</b><br/>$answer</div>";
echo "<a href=\"javascript:showdiv('answer')\">Show Answer</a></td></tr>";
echo "<td><tr><a href='submitanswer.php?correct?=yes&correctid=$correctid>I got this correct!</a></tr></td></table>";

 

It just outputs

<table border='0'><tr><td><div id='question'><b>Question:</b><br/>What is your name?</div></td></tr><tr><td><div id='answer' style='display:none;'><b>Answer:</b><br/>Rooba holabint</div><a href="javascript:showdiv('answer')">Show Answer</a></td></tr><td><tr>

Link to comment
https://forums.phpfreaks.com/topic/221441-stops-echoing/
Share on other sites

Yep. Entire php section

<?php
$subject = $_GET['subject'];
$userID = $_COOKIE['userID'];

include("database.php");
$today = dateAdd("now","+0 days");
$correctRow = selectrow("SELECT * FROM correct WHERE nextTimeToAnswer <= '$today' and subject = '$subject' and userid = $userID");
$problemid = $correctRow['problemid'];
$correctid = $correctRow['id'];
$problemRow = selectrow("SELECT * FROM problems WHERE id = $problemid");
$question = $problemRow['question'];
$answer = $problemRow['answer'];

echo "<table border='0'><tr><td><div id='question'><b>Question:</b><br/>$question</div></td></tr>";
echo "<tr><td><div id='answer' style='display:none;'><b>Answer:</b><br/>$answer</div>";
echo "<a href=\"javascript:showdiv('answer')\">Show Answer</a></td></tr>";
echo "<td><tr><a href='submitanswer.php?correct?=yes&correctid=$correctid>I got this correct!</a></tr></td></table>";

?>

 

Forgot to close the href with '

Link to comment
https://forums.phpfreaks.com/topic/221441-stops-echoing/#findComment-1146384
Share on other sites

echo "<td><tr><a href='submitanswer.php?correct?=yes&correctid=$correctid>I got this correct!</a></tr></td></table>";

 

should be

 

echo "<td><tr><a href='submitanswer.php?correct?=yes&correctid=$correctid'>I got this correct!</a></tr></td></table>";

 

you are missing a ' after $correctid

 

 

Edit: apparently i was to slow typing.. hehe

Link to comment
https://forums.phpfreaks.com/topic/221441-stops-echoing/#findComment-1146386
Share on other sites

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.