<?php
error_reporting(E_ALL);
$a = "http://www.google.com";
$b = "http://www.yahoo.com";
if ($result == "COMPLETED") {
echo "<meta http-equiv=\"refresh\" content=\"0;URL=$a\">";
} else {
echo "<meta http-equiv=\"refresh\" content=\"0;URL=$b\">";
}
?>
<?php
error_reporting(E_ALL);
$result=$sql_result;
// create connection
$connection = odbc_connect("database","user","password");
// test connection
if (!$connection) {
echo "Couldn't make a connection!";
exit;
}
// create SQL statement
$sql="
SELECT
[Status]
FROM
t_status.dbo.LoadStatus
";
// prepare SQL statement
$sql_result = odbc_prepare($connection,$sql);
// execute SQL statement and get results
odbc_execute($sql_result);
// format result in HTML table
odbc_result_all($sql_result,"border=1");
// free resources and close connection
//odbc_free_result($sql_result);
//odbc_close($connection);
?>
<?php
error_reporting(E_ALL);
// http://us.php.net/manual/en/function.odbc-connect.php
if (!$con = odbc_connect("database","user","password")) die('CONNECT FAILED');
http://us.php.net/manual/en/function.odbc-prepare.php
$sql="SELECT Status FROM t_status.dbo.LoadStatus";
$res = odbc_prepare($con,$sql);
// http://us.php.net/manual/en/function.odbc-execute.php
odbc_execute($res);
// http://us.php.net/manual/en/function.odbc-result.php
$thing = odbc_result($res);
// SHOW THE THING WE GOT FROM THE QUERY
echo "<pre>";
var_dump($thing);
die();
array(1) { ["COMPLETED"]=> int(1) }
LoadStatus
COMPLETED
int(1)
ob_start(); // start buffer
include ("redirect-test.php");
$content = ob_get_contents(); // assign buffer contents to variable
ob_end_clean(); // end buffer and remove buffer contents
echo $content;
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
// create connection
$connection = odbc_connect("database","user","password");
// test connection
if (!$connection) {
echo "Couldn't make a connection!";
exit;
}
// create SQL statement
$sql="
SELECT
[Status]
FROM
t_status.dbo.LoadStatus";
// prepare SQL statement
$sql_result = odbc_prepare($connection,$sql);
// execute SQL statement and get results
odbc_execute($sql_result);
// format result in HTML table
//odbc_result_all($sql_result,"border=1");
// free resources and close connection
echo odbc_result_all($sql_result);
sleep(5);
if (odbc_result_all($sql_result) == 'COMPLETED')
{
printf("<script>location.href='http://www.google.com'</script>");
}
else
{
// show other stuffs
printf("<script>location.href='http://www.yahoo.com'</script>");
}
odbc_free_result($sql_result);
odbc_close($connection);
var_dump($sql_result)
?>
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
// create connection
$connection = odbc_connect("database","user","password");
// test connection
if (!$connection) {
echo "Couldn't make a connection!";
exit;
}
// create SQL statement
$sql="
SELECT
[Status]
FROM
t_status.dbo.LoadStatus";
// prepare SQL statement
$sql_result = odbc_prepare($connection,$sql);
// execute SQL statement and get results
odbc_execute($sql_result);
// format result in HTML table
//odbc_result_all($sql_result,"border=1");
// free resources and close connection
echo odbc_result_all($sql_result);
sleep(5);
if (odbc_result_all($sql_result) == 'COMPLETED')
{
printf("<script>window.location='http://www.google.com'</script>");
}
else
{
// show other stuffs
printf("<script>window.location.='http://www.yahoo.com'</script>");
}
odbc_free_result($sql_result);
odbc_close($connection);
var_dump($sql_result)
?>
<?php // RAY_temp_akashj.php
echo "<pre>";
// SHOW AN ARRAY
$thing = array( 'COMPLETED' => 1 );
var_dump($thing);
// SHOW AN INTEGER
$thing = 1;
var_dump($thing);
// SHOW A BOOLEAN
$thing = TRUE;
var_dump($thing);
// SHOW A STRING
$thing = 'COMPLETED';
var_dump($thing);
// SHOW ANOTHER STRING THAT WILL LOOK THE SAME WHEN PRINTED IN HTML
$thing = 'COMPLETED ';
var_dump($thing);
/* *********** OUTPUT OF CODE EXECUTION FOLLOWS
array(1) {
["COMPLETED"]=>
int(1)
}
int(1)
bool(true)
string(9) "COMPLETED"
string(10) "COMPLETED "