Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6685849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:06:17+00:00 2026-05-26T05:06:17+00:00

Not completely new to PHP itself, but new to using OOP w/ PHP. Object

  • 0

Not completely new to PHP itself, but new to using OOP w/ PHP.

Object instantiation & calling method exist in different file.

index.php has this:

<?php
require_once 'scripts/twitteroauth/oauth_index.php';
?>

oauth_index.php has this:

$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);

and the file submitting the tweet, submitMessage.php contains this:

include 'twitteroauth/oauth_index.php';

$message = $_GET['message'];
$time = $_GET['time'];

$status = "#" . $message . $time; 

$twitter->updateStatus($status);
$output = $twitter->updateStatus($status);

Have tested:
The form submits successfully & gets to the PHP file. The updateStatus() method works fine if it is used within index.php. However, when I submit the form, it is passed to a js function, which passes the variables to the submitMessage.php, and then responds with all the text after $twitter->. It responds “updateStatus($status);$output = $twitter->updateStatus($status);”

Any ideas as to what I’m doing wrong? Thanks for any help.

entirety of sendMessage.php

<?

include 'twitteroauth/oauth_index.php';

$message = $_GET['message'];
$time = $_GET['time'];

$status = "#" . $message . $time; 

$output = $twitter->updateStatus($status);
$twitterReturn = new SimpleXMLElement($output);
echo $output;

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:06:17+00:00Added an answer on May 26, 2026 at 5:06 am

    You need to echo the $output;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Goodmorning everybody! I'm not completely new to PHP as in self but still kinda
I'm using a new no-name framework that I'm not completely familiar with and I'm
Disclaimer: completely new to Python from a PHP background Ok I'm using Python on
I have worked with ASP.NET(C#, classic/MVC), Django(Python) and CI(php) but I am completely new
Completely new to using simple XML library in PHP, and have been using the
Not completely a programming question, but its close enough so here goes: In Mac
I'm not completely sure I understand the workflow way of doing things, but if
I wrote a site using ASP.NET MVC, and although it is not completely SEO
I'm currently converting my site from PHP to Django, but as I'm new to
I am not completely sure about the following table alt text http://files.getdropbox.com/u/175564/algTranslation.png The table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.