zapdbf Posted July 31, 2007 Share Posted July 31, 2007 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 ? Quote Link to comment https://forums.phpfreaks.com/topic/62757-solved-_get-var-undefined-error/ Share on other sites More sharing options...
teng84 Posted August 1, 2007 Share Posted August 1, 2007 try to use the upper case get $_GET['p'] Quote Link to comment https://forums.phpfreaks.com/topic/62757-solved-_get-var-undefined-error/#findComment-312403 Share on other sites More sharing options...
cooldude832 Posted August 1, 2007 Share Posted August 1, 2007 all super globals will need to be caps if you have strict erroring on. (session, request, post, get to name a few) Quote Link to comment https://forums.phpfreaks.com/topic/62757-solved-_get-var-undefined-error/#findComment-312405 Share on other sites More sharing options...
zapdbf Posted August 1, 2007 Author Share Posted August 1, 2007 try to use the upper case get $_GET['p'] Thanks that did it i am new to php, i did not realize it was case sensitive Quote Link to comment https://forums.phpfreaks.com/topic/62757-solved-_get-var-undefined-error/#findComment-312409 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.