Re: Has anyone seen this error before?

From: Date: Fri, 28 Jan 2005 19:34:02 +0000
Subject: Re: Has anyone seen this error before?
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-25474@lists.php.net to get a copy of this message
This worked! Thank you. Now, my question is why it worked. Also, the word FORM shows up at the bottom of the browser window ...is there anything I can do to make that go away? --- The Disguised Jedi <disguised.jedi@gmail.com> wrote: > it means php was looking for the end of file marker, > and didn't find > it before the $end (end of php parser "?>") > > just use this new version of 'write_form()' and it > should work... > > //==new function ... do not include this line....== > > function write_form() { > print ' > <form method="post" action="{' . > $_SERVER['PHP_SELF'] . '}"> > > <p><input type="text" name="sound" /> > Does venue have mixer?</p> > > <p><input type="text" name="equip" /> > Does venue have its own > equipment?</p> > > <p><input type="text" name="food" /> > What kind of food deal?</p> > > <p><input type="text" name="drink" /> > What kind of drink deal?</p> > > <p><input type="text" name="comp" /> > What is our compensation?</p> > > <p><input type="submit" > value="submit!" /></p> > </form> > > FORM'; > } > > //==end of new function...do not include this > line....== > > > On Thu, 27 Jan 2005 18:20:18 -0800 (PST), Patrick > Roane > <fojomo@sbcglobal.net> wrote: > > Parse error: syntax error, unexpected $end in > > c:\wamp\www\php_excercises\schedule.php on line > 81: > > > > line 81 is all the way at the bottom. > > > > Here is my code: > > > > <!DOCTYPE html PUBLIC > > "-//W3C//DTD XHTML 1.0 Strict//EN" > > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > > <html> > > <head> > > <title>Listing 13.1 Opening a Connection to a > > Database</title> > > </head> > > <body> > > <?php > > > > if ( ! empty( $_REQUEST['sound'] )&& > > ! empty( $_REQUEST['equip'] )&& > > ! empty( $_REQUEST['food'] )&& > > ! empty( $_REQUEST['drink'] )&& > > ! empty( $_REQUEST['comp'] ) ){ > > // check user imput here! > > $dberror = ""; > > $ret = add_to_database( > $_REQUEST['sound'], > > $_REQUEST['equip'], > > $_REQUEST['food'], > > $_REQUEST['drink'], > > $_REQUEST['comp'], > $dberror ); > > if ( ! $ret ) { > > print "Error: $dberror<br > />\n"; > > } else { > > print "Thank you very much<br > />\n"; > > } > > } else { > > write_form(); > > } > > function add_to_database( $sound, $equip, $food, > > $drink, $comp, &$dberror ) { > > $sound = mysql_real_escape_string( $sound > ); > > $equip = mysql_real_escape_string( $equip ); > > $food = mysql_real_escape_string( $food ); > > $drink = mysql_real_escape_string( $drink > ); > > $comp = mysql_real_escape_string( $comp ); > > $link = mysql_pconnect( "localhost", "", "" ); > > if ( ! $link ) { > > $dberror = mysql_error(); > > return false; > > } > > if ( ! mysql_select_db( "schedule05", $link ) > ) { > > $dberror = mysql_error(); > > return false; > > } > > $query = "INSERT INTO specs( sound, equip, > food, > > drink, comp ) > > values('$sound', '$equip', > '$food', '$drink', > > '$comp' )"; > > if ( ! mysql_query( $query, $link ) ) { > > $dberror = mysql_error(); > > return false; > > } > > return true; > > } > > > > function write_form() { > > print <<<EOF > > <form method="post" > action="{$_SERVER['PHP_SELF']}"> > > > > <p><input type="text" name="sound" > /> > > Does venue have mixer?</p> > > > > <p><input type="text" name="equip" > /> > > Does venue have its own > equipment?</p> > > > > <p><input type="text" name="food" > /> > > What kind of food deal?</p> > > > > <p><input type="text" name="drink" > /> > > What kind of drink deal?</p> > > > > <p><input type="text" name="comp" > /> > > What is our compensation?</p> > > > > <p><input type="submit" > value="submit!" /></p> > > </form> > > > > FORM; > > } > > ?> > > </BODY> > > </HTML> > > > > Thanks- > > > > ===== > > > > ---------------- > > "forget your lust for the rich man's gold. All > that you need, is in your soul. You can do this if > you try. All that I want for you my son, is to be > satisfied" > > > > ~ Lynard Skynard > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, visit: > http://www.php.net/unsub.php > > > > > > > -- > The Disguised Jedi > disguised.jedi@gmail.com > > PHP rocks! > "Knowledge is Power. Power Corrupts. Go to school, > become evil" > > Disclaimer: Any disclaimer attached to this message > may be ignored. > This message is Certified Virus Free > ===== ---------------- "forget your lust for the rich man's gold. All that you need, is in your soul. You can do this if you try. All that I want for you my son, is to be satisfied" ~ Lynard Skynard

« previous php.windows (#25474) next »