Jump to content

parse error when making a form remember last user input


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?

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.