Jump to content

Syntax error


freddyw

Recommended Posts

So im creating a page where users can directly update their twitter status and im recieving this error

 

Parse error: syntax error, unexpected '{'  on line 19

 

I dont understand.

 

heres my code

 

<h2>Update Twitter Status</h2>
    <?php
    if (!isset($_POST['submit'])) {
    ?>
    <form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
      Username: <br/>
      <input type="text" name="user" /><br/>
      Password: <br/>
      <input type="password" name="pass" /><br/>
      New status message: <br/>
      <textarea name="status" cols="15"></textarea><br/>
      <input type="submit" name="submit" value="Update Status" />      
    </form>
    </form>
    <?php
    } else {
      // include class
      include_once 'Services/Twitter.php';
      try {
        // read form input
        $user = $_POST['user'];
        $pass = $_POST['pass'];
        $status = $_POST['status'];
        
        // initialize service object
        $service = new Services_Twitter($user, $pass);
        
        // update status
        $service->statuses->update($status);
        
        // perform logout
        $service->account->end_session();        
        echo 'Status updated!';
      } catch (Exception $e) { 
        die('ERROR: ' . $e->getMessage());
      }
    }
    ?>

 

any clues?

Link to comment
https://forums.phpfreaks.com/topic/184538-syntax-error/
Share on other sites

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.