Jump to content

MLL

Members
  • Posts

    8
  • Joined

  • Last visited

About MLL

  • Birthday 01/24/1998

Contact Methods

  • Website URL
    http://malamut.hu

Profile Information

  • Gender
    Male

MLL's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. IT shows the square like in the title of this topic
  2. Hi! I wanna export data from my mysql database but when i do it, the php on the other site whith the same code shows a ? mark in a square like <?>. I tried everything but nothing works. Please help
  3. Big thanks to all you, guys! It was a very big help! I also asked exactly this question at stackoverflow and nobody could write a normal answer. So thank you
  4. Thank you! IT WORKS!!!
  5. Thanks but I don't fully understand what you wrote. I am a VERY beginner developer. Can you write the things in my code? Also if it is possible, with comments, so I can learn from it. Thank you very much
  6. This is my structure. Hope it helps
  7. It can connect, connect to table and have the vallues. something is wrong with the code. I am sure :/
  8. Hi all! I am new so don't hate if I write something in a bad way. Thanks. I have a "logical captcha" which is like a quiz. Here is my code. I don't know what is wrong with it <?php $database_db="general"; $user_db="root"; $password_db="somepass"; $host_db="localhost"; $link = mysqli_connect($host_db, $user_db, $password_db, $database_db); if (mysqli_connect_errno()) { die ("couldnot connect: ".mysqli_connect_error()); exit(); } $answer = $_POST['answer']; if (array_key_exists("answer", $_POST) AND array_key_exists("question", $_POST)) { $id = intval($_POST['question']); $sql="SELECT question, answer FROM captcha WHERE question='$id' AND answer='".mysqli_real_escape_string($link, $answer)."'"; $result = mysqli_query($link, $sql) or exit('$sql failed: '.mysqli_error($link)); $num_rows = mysqli_num_rows($result); if($num_rows > 0) { header("Location: success.php"); } else { header("Location: error.php"); } exit; } else { $query = "SELECT id, question FROM `captcha` ORDER BY RAND() LIMIT 1"; if ($result = mysqli_query($link, $query)) { if ($row = mysqli_fetch_assoc($result)) { $id = $row["id"]; $question = $row["question"]; } } } ?> <html> <body> <form method="post"> <?php echo $question; ?><br /> <input type="hidden" name="question" id="question" value="<?php echo $id; ?>" /> <input type="text" name="answer" id="answer" /><br /> <input type="submit" name="submit" value="submit" /><br /> </form> </body> </html> So the problem is that it always redirects to error.php, even if I enter the right answer
×
×
  • 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.