[KLUG Members] php Q

Richard Harding rick at ricksweb.info
Sat Nov 6 23:01:07 EST 2004


Well I am not 100% sure, but some cleanup I guess.

First are you getting to the second page at all? I would suggest doing 
thing like enclosing your action in quote as well as the method.

You also need to close the form tag which you're missing at the end of 
page one.

If you are getting to page two use var_dump($_GET) to see if anything is 
coming across in the $_GET variable.

I am betting it only work on certain things due to browsers handling the 
errors in HTML differently.

HTH

Rick

Lunitix wrote:

> Ok.  I am doing another *AMP (Mac/Linux-Apache-MySQL-PHP) project. 
> Basically I've taken working code from my previous project, which only 
> seems to work on my Mac (but that's another Q), and have inserted new 
> variables and database but the data flow from page to page to database 
> remains the same.  My issue here is that the entered data does not 
> seem to be getting to the 2nd page or the database.  Any thoughts 
> would be welcomed.
>
> Precursors - I know I have used the word "jeopardy" as the username, 
> password, and database name.  Sorry but while I'm working this out, I 
> like to keep particulars simple (at least for me).  And the error code 
> in the second page I modified from the earlier project in hopes it 
> would lead me somewhere, but all to no avail.
>
> ----Page 1----
>
> <form action=singjeopsubmit.php method=GET>
>         Category Title
>         <br>
>         <input max="255" size="50" value="" name="jeop_category" 
> type="text">
>         <br>
>         <p>
>         2 Point Question
>         <br>
>         <input max="255" size="100" value="" name="jeop_ques2" 
> type="text">
>         <br>
>         <font size="2">Maximum 255 Characters</font>
>         </p>
>          <p>
>         2 Point Answer
>         <br>
>         <input max="255" size="100" value="" name="jeop_ans2" 
> type="text">
>         <br>
>         <font size="2">Maximum 255 Characters</font>
>         </p>
> <br>
>         <input value="Submit Category" name="singjeopsubmit" 
> type="submit">
>
>
> ----Page 2-----
>
> <?php
> $_GET['$jeop_category'];
> $_GET['$jeop_ques2'];$_GET['$jeop_ans2'];
> $link=mysql_connect ("traveller.local", "jeopardy", "jeopardy");
>    if (!$link) {
>      die("Your database is screwed: " . mysql_error());
>     }
> mysql_select_db ("jeopardy");
> $query="INSERT INTO single ( category, ques2, ans2)
> VALUES ( '$_GET[jeop_category]', '$_GET[jeop_ques2]', 
> '$_GET[jeop_ans2]' )
> ";
> $result=mysql_query($query, $link);
>    if (!$result) {
>      die("Your data is hosed: " .mysql_error());
> }
> print ("Category")
> print ($jeop_category);
> print (" ");
>
> print ("2 Point Question")
> print ($jeop_ques2);
> print (" ");
> print ($jeop_ans2);
> print (" ");
> print ("<p>");
> print ("Single Jeopardy Category, Questions, and Answers submitted");
> ?>
> _______________________________________________
> Members mailing list
> Members at kalamazoolinux.org
> 




More information about the Members mailing list