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 6069277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:48:18+00:00 2026-05-23T09:48:18+00:00

I’m still confusing about RESTfull concept. I have a service it’s like here include

  • 0

I’m still confusing about RESTfull concept. I have a service it’s like here

include '../includeall.php';
$query = Q_GET_FACT_GIVEN_TABLE;

$i = 0;
$queryall = null;
if (isset($_GET['year'])) {
    $year = $_GET['year'];
    $queryall[$i++] = "f.year=" . $year;
}

if (isset($_GET['period_id'])) {
    $period_id = $_GET['period_id'];
    $queryall[$i++] = "f.period_id=" . $period_id;
}

if (isset($_GET['month_id'])) {
    $month_id = $_GET['month_id'];
    $queryall[$i++] = "f.month_id=" . $month_id;]
}

if (isset($_GET['var_in_cat_id'])) {
    $var_in_cat_id = $_GET['var_in_cat_id'];
    $queryall[$i++] = "f.var_in_cat_id=" . $var_in_cat_id;
}

if (isset($_GET['reg_id'])) {
    $reg_id = $_GET['reg_id'];
    if ($reg_id == "prop")
        $queryall[$i++] = "substring(reg_id,-2)='00' AND reg_id<>'0000'";
    else
        $queryall[$i++] = "f.reg_id=" . $reg_id;
}

if (isset($_GET['id_prop'])) {
    $idprop = $_GET['id_prop'];
    $queryall[$i++] = "substring(reg_id,1,2)='$idprop' AND substring(reg_id,-2)<>'00'";
}

if (isset($_GET['data_source_id'])) {
    $data_source_id = $_GET['data_source_id'];
    $queryall[$i++] = "f.data_source_id=" . $data_source_id;
}

for($i=0;$i<count($queryall);$i++){
    $queryi=$queryall[$i];
    $query.=" AND ".$queryi;
}

$query.=" ORDER BY reg_id,month_id";

$database = new Database();
$queryResult = $database->query($query);
$resultArray = Utils::convertToJSON($queryResult);
?>

Is my implementation code above can be called as web service??
It’s contains of JSON implementation in output as user request on some url.
If it can be categorized as a web service what kind of service do I have??
Can it be call as a RESTfull web service..
Please help me..

  • 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-23T09:48:19+00:00Added an answer on May 23, 2026 at 9:48 am

    Well, you could consider it a web service, but its interface there’s no REST aspect in there. I’d call it … a search function.

    REST(Representational State Transfer) means that the HTTP method defines the action you’re taking. For example, a DELETE HTTP request will actually cause a deletion, and a PUT will write a resource. As presented above, your application consists of a search function, and therefore does not apply.

    In php, you can determine the HTTP method used in the request from $_SERVER['REQUEST_METHOD'].

    By the way, you should not initialize $queryall as null, but array(). You can also dispose of the $i and just write $queryall[] = ... instead of $queryall[$i++].

    Also, you should not construct a database query by concatenating input strings, as this code makes your application vulnerable to SQL injections. Use prepared statements to avoid SQL injection vulnerabilities.

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

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.