1) Always using long tags (<?php ?>) means that your script will be
recognised on machines whaere short tags are turned off
 2) The default (from about version 4.2 or something) is for
register_globals to be turned off. This is for security reasons. The effect
is that giving a form element a name (e.g. <input type ="text" name =
"guess" value = "$guess">) means that you cannot access that value via
$guess, you have to use $_GET['guess'}. You can set up your own machine with
register_globals = On, but in the real world, most sites won't have it.
 3) You are choosing a different number each time. You need to save it -
hidden input fields are ok but...
 4) Your form needs to be method="post" (not the default of "get") since
with GET, when you save your number, it will be visible in the address box
as number=13 or whatever
 5) You need a way to indicate to your script that this is (or isn't) the
start of a new game. You could have a separate variable for this or you
could use $guesses - i.e. when it is zero, we're starting a new game.
 6) You need to initialise your variables. The first time through, the form
variables won't be set, so you need to do something like:
 $guesses=0;
if ( isset($_POST['guesses'])) $guesses = $_POST['guesses'];
 7) You need to output your table AFTER you process the data. Imagine that
$guessCounter (somehow) got set to 7. Currently, you set the form value to
7, THEN process the guess where $guessCounter might go up to 8.
Nevertheless, the form field still has 7 in it.
 There might be more problems, but let us know after you've had a go at
these.
 Ian


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to