Hello Paul, well problem is this: you don't have defined variable $action....maybe you are not posting it correctly from form...what is on first 12 lines?
try to add $action="value"; on line 12...just define any suitable value... -- Best regards, Martin mail [EMAIL PROTECTED] mobile +421.907.303.393 icq 34358414 www http://www.corwin.sk PGP key fingerprint 21365ca05ecfd8aeb1cf19c838fff033 "In those days spirits were brave, the stakes were high, men were real men, women were real women and small furry creatures from Alpha Centauri were real small furry creatures from Alpha Centauri." by Douglas Adams Wednesday, January 8, 2003, 11:43:12 PM, you wrote: PF> Can anyone see a problem in this? When i run the script i am getting this PF> error "Notice: Undefined variable: action in PF> C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13" PF> <? PF> // addpoll.php PF> // Case Study 1: User Poll - Foundation PHP for Flash PF> // If the form has been submitted... PF> (line 13) if ($action == "add") { PF> // Include config file PF> include('common.php'); PF> // Connect to database PF> $link = dbConnect(); PF> // Get date for new poll PF> $posted = time(); PF> // Build query to insert new poll PF> $query = "INSERT INTO polls (question, option1, option2, option3, PF> posted) PF> VALUES('$question', '$option1', '$option2', '$option3', PF> $posted)"; PF> // Execute query PF> $result = @mysql_query($query); PF> // If query failed... PF> if (!$result) { PF> // Display error PF> print "<font color=\"#ff0000\">Could not insert poll</font><br>\n"; PF> } else { PF> print "<font color=\"#0000ff\">Poll added</font><br>\n"; PF> } PF> mysql_close($link); PF> } ?>> PF> please anyone -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php