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

  • SEARCH
  • Home
  • 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 6340607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:52:04+00:00 2026-05-24T19:52:04+00:00

A very good morning, i am currently working on a simple php project, the

  • 0

A very good morning, i am currently working on a simple php project, the goal of the application is to read Oracle data and display the result, i’ve completed this part. I am having a little doubt on how to pass querystring along with JQuery, please advice. Many thanks in advance.

index.php – this is where i am passing the querystring
index.php?campus=abc&floor=xyz

<html>
<head>`enter code here`
    <title>Olympia College :: Kiosk</title>
    <link rel="Stylesheet" type="text/css" href="assets/css/kiosk.css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
// $(document).ready(function()
// {
//   $("#responsecontainer").load("contents.php");
//   var refreshId = setInterval(function()
//   {
//       $("#responsecontainer").load('contents.php?randval='+ Math.random());
//   }, 1000);
//   $.ajaxSetup({ cache: false });
// });

function update() {
  $("#notice_div").html('<img src="indicator.gif" alt="Synchronizing data, please wait a moment.."/>&nbsp;&nbsp;Synchronizing data, please wait a moment..');
  $.ajax({
    type: 'POST',
//    data: '{campus, floor}',
    url: 'timetable.php',
    timeout: 5000,

        success: function(data) {
          $("#some_div").html(data);
          $("#notice_div").html('');
          window.setTimeout(update, 10000);
        },

        error: function (XMLHttpRequest, textStatus, errorThrown) {
          $("#notice_div").html('Timeout contacting server..');
          window.setTimeout(update, 60000);
        }
    });
}
$(document).ready(function() {
    update();
});

</script>
</head>
<body>
    <!--<div id="responsecontainer">
    <?php //echo date("l, F d, Y h:i:s" ,time());?>
    </div>-->
    <div id="main">
        <div id="left"><img src="assets/images/oc_logo.png" alt="Olympia College Malaysia"></img></div>
        <div id="right"><div id="notice_div"></div><div id="fright"><a href="setting.php" title="Change settings">Setting</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="bug.php" title="Send bug report">Bug Report</a></div></div>    
    </div>
    <div id="line"></div>

    <br />
    <div id="some_div"></div>
</body>

timetable.php

<?php
$datasource = "******";
$hostname = "******";
$username = "*****";
$password = "*****";
$database = "*****";
$campus = $_REQUEST['campus'];
$floor = $_REQUEST['floor'];

//KL CAMPUS
if ($campus == 'ockl')
    $campus = 'KL CAMPUS';
elseif ($campus == 'ocpj')
    $campus = 'PJ CAMPUS';
elseif ($campus == 'ocpg')
    $campus = 'PENANG CAMPUS';
elseif ($campus == 'ocip')
    $campus = 'IPOH CAMPUS';
elseif ($campus == 'ockt')
    $campus = 'KUANTAN CAMPUS';
elseif ($campus == 'ocjb')
    $campus = 'JB CAMPUS';

//echo $_REQUEST['campus'];

$connect = odbc_connect($datasource, $username, $password);

    if(!$connect){
        echo "Unable to connect!<br /><br />";
    }
    else {
        //echo "Successfully connected!<br /><br />";
    };

$query = "SELECT DISTINCT 
          RESOURCE_DAY_TIME_SETUP.DAY, 
          RESOURCE_DAY_TIME_SETUP.FLOOR_CODE,
          RESOURCE_DAY_TIME_SETUP.RESOURCES_CODE,
          RESOURCE_DAY_TIME_SETUP.CAMPUS 
          FROM RESOURCE_DAY_TIME_SETUP WHERE CAMPUS LIKE '" . $campus . "'";
$result = odbc_exec($connect, $query);

echo "<table border='1'>";
echo "<tr> <th>Day</th> <th>Floor</th> <th>Room</th> <th>Duration</th> <th>Start</th> <th>End</th> <th>Lecturer</th> <th>Status</th> <th>Campus</th> </tr>";

while (odbc_fetch_row($result)){
    $day = odbc_result($result,1);
        $floor_code = odbc_result($result, 2);
    $resources_code = odbc_result($result,3);      
    $campus = odbc_result($result,4);
        echo "<tr>";
        echo "<td>$day</td>";
        echo "<td>$floor_code</td>";
        echo "<td>$resources_code</td>";
        echo "<td>$resources_code</td>";
        echo "<td>$resources_code</td>";
        echo "<td>$resources_code</td>";
        echo "<td>$resources_code</td>";
        echo "<td>$resources_code</td>";
        echo "<td>$campus</td>";
        echo "</tr>";
}

odbc_close($connect);

echo "</table>";
?>

Hope someone here can shed some light to point me in the correct direction, many thanks in advance.

  • 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-24T19:52:05+00:00Added an answer on May 24, 2026 at 7:52 pm

    Since you’re not posting any data other than your query string I think you want to be using GET instead of POST, but since your php file uses $_REQUEST both will work. Just format your data like this:

    type: 'GET',
    data: {campus: 'abc', floor: 'xyz'},
    url: 'timetable.php',
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This morning, I read a very good question about what the person should expect
Good morning everyone, I'm running into an issue using a SharePoint workflow project (C#,
Good morning, afternoon, evening or night (depending on your timezone). This is just a
Good morning, all. This is my first question on stackoverflow, so hopefully this isn't
Good morning! We have a SVN-Repository, which holds a VS-Solution. In this solution are
Good morning, I am at the moment writing my master thesis and hence I
Good Morning, I have 2 views: ICCUDays which contains one record per account with
I'm working on a rather large classic asp / SQL Server application. A new
Good morning, I have a question regarding default values and NULL values in Sybase
I'm not very good at regular expressions at all. I've been using a lot

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.