Jump to content

[SOLVED] _get var undefined error


zapdbf

Recommended Posts

i am getting "Undefined variable: _get in" error

 

Here is the calling page

<?

$host= 'localhost:3306';

    $dbName= 'zapdbfco_main';

    $user= 'zapdbfco_xuser';

    $pass= 'xuser';

    $conn= mysql_connect($host,$user,$pass) or die(mysql_error());

    $db= mysql_select_db($dbName,$conn) or die(mysql_error());

    $NewQuizTitle= $_POST['title'];

   

    $sql= " insert into  tblQuizHead  (Title) values('{$NewQuizTitle}')";

   

      $result= mysql_query($sql,$conn) or die(mysql_error());

      $sql= 'select max(ident) as idt from tblQuizHead';

   

      $result= mysql_query($sql,$conn) or die(mysql_error());

      $data= mysql_fetch_array($result);

    header("Location: enterq.php?d={$data['idt']}");

     

      exit();

        ?>

 

 

 

 

here is the destination page

 

 

<?php

    $host= 'localhost:3306';

    $dbName= 'zapdbfco_main';

    $user= 'zapdbfco_xuser';

    $pass= 'xuser';

    $Ident = $_get['d'];  <<<< error is here >>>>>

    $conn= mysql_connect($host,$user,$pass) or die(mysql_error());

    $db= mysql_select_db($dbName,$conn) or die(mysql_error());

    $sql = "select Title form tblquizhead where ident = {$ident}";

    $result = mysql_query($sql,$conn);

    $data = mysql_fetch_array($result);

    echo " Quiz Name: {$data['Title']}";

    echo "<input type=hidden name=qnum value={$ident}>";

   

?>

 

 

<form method="post" action="pquest.php">

Question  <textarea name="question" rows="3" cols="40"></textarea><br><br>

answer 1  <textarea name="a1" rows="3" cols="30"></textarea> <input type="radio" name="correcta" value="1"><br>

answer 2  <textarea name="a2" rows="3" cols="30"></textarea> <input type="radio" name="correcta" value="2"><br>

answer 3  <textarea name="a3" rows="3" cols="30"></textarea> <input type="radio" name="correcta" value="3"><br>

answer 4  <textarea name="a4" rows="3" cols="30"></textarea> <input type="radio" name="correcta" value="4"><br>

answer 5  <textarea name="a5" rows="3" cols="30"></textarea> <input type="radio" name="correcta" value="5"> <br>

answer 6  <textarea name="a6" rows="3" cols="30"></textarea> <input type="radio" name="correcta" value="6"><br>

<input type="submit" value = "Add Another"> <input type="submit" value = "Done">  <input type="reset">

</form>

 

 

Why am i getting this error i am passing a form query string ?

Link to comment
https://forums.phpfreaks.com/topic/62757-solved-_get-var-undefined-error/
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.