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