Jump to content

parse error when making a form remember last user input


pandu

Recommended Posts

Im trying to make my form remember the last input made by user, so I wrote the following and I get a syntax error on the input line. The error is:

 

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\wamp\www\ezsynonym\index.php on line 90

 


                <form id="searchform" method="post" action="index.php">
                <input id="input" name="synonymsearch" type="text" value="<?php echo $_POST['synonymsearch']; ?>" maxlength="400px" />
                </form>

 

TIA

that only looks to see if the variable is set. At most php would just give a notice.  The error posted here means that somewhere in his code he isn't using quotes properly.  But the code posted in and of itself is fine.  So he needs to look around it.

It is possible that I've gone crazy, but the syntax looks a little busted to me:

 

You wrote:

 

<?php 
if (isset($_POST['synonymsearch'])) echo { 
     $_POST ['synonymsearch']; 
} 
?>

 

I think it should be:

<?php 
if (isset($_POST['synonymsearch'])) { 
     echo $_POST ['synonymsearch']; 
} 
?>

 

What do you think?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.