Date Decoding 
Author Message
 Date Decoding

I have a page that I need to decode the date string for the query in the
page.  I have used the decode() command with no success.
The result page address appears as:
http://www.*-*-*.com/ %2F...
oDate=2003%2F1%2F9&Submit=Search, for example, but won't decode the date
format.

Any ideas would be greatly appreciated.

The search page is at http://www.*-*-*.com/

The basic php code of the results page minus the decode command is:

<?php require_once('Connections/coahsi.php'); ?>
<?php
$maxRows_rsDate = 10;
$pageNum_rsDate = 0;
if (isset($HTTP_GET_VARS['pageNum_rsDate'])) {
  $pageNum_rsDate = $HTTP_GET_VARS['pageNum_rsDate'];

Quote:
}

$startRow_rsDate = $pageNum_rsDate * $maxRows_rsDate;
$colname_rsDate = "1";
if (isset($FROMDATE)) {
  $colname_rsDate = (get_magic_quotes_gpc()) ? $FROMDATE :
addslashes($FROMDATE);
Quote:
}

$colname2_rsDate = "2";
if (isset($TODATE)) {
  $colname2_rsDate = (get_magic_quotes_gpc()) ? $TODATE :
addslashes($TODATE);
Quote:
}

$maxRows_rsDate = 10;;
$pageNum_rsDate = 0;
if (isset($HTTP_GET_VARS['pageNum_rsDate'])) {
  $pageNum_rsDate = $HTTP_GET_VARS['pageNum_rsDate'];
Quote:
}

$startRow_rsDate = $pageNum_rsDate * $maxRows_rsDate;

$end_rsDate = "1";
if (isset($HTTP_GET_VARS['ToDate'])) {
  $end_rsDate = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['ToDate'] :
addslashes($HTTP_GET_VARS['ToDate']);

Quote:
}

$colname_rsDate = "1";
if (isset($HTTP_GET_VARS['FromDate'])) {
  $colname_rsDate = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['FromDate'] :
addslashes($HTTP_GET_VARS['FromDate']);
Quote:
}

mysql_select_db($database_coahsi, $coahsi);
$query_rsDate = sprintf("SELECT * FROM TEvent WHERE StartDate > '%s' and
EndDate < '%s'", $colname_rsDate,$end_rsDate);
$query_limit_rsDate = sprintf("%s LIMIT %d, %d", $query_rsDate,
$startRow_rsDate, $maxRows_rsDate);
$rsDate = mysql_query($query_limit_rsDate, $coahsi) or die(mysql_error());
$row_rsDate = mysql_fetch_assoc($rsDate);

if (isset($HTTP_GET_VARS['totalRows_rsDate'])) {
  $totalRows_rsDate = $HTTP_GET_VARS['totalRows_rsDate'];

Quote:
} else {

  $all_rsDate = mysql_query($query_rsDate);
  $totalRows_rsDate = mysql_num_rows($all_rsDate);
Quote:
}

$totalPages_rsDate = ceil($totalRows_rsDate/$maxRows_rsDate)-1;
?>

______________________________________________________________________________
Posted Via Binaries.net = SPEED+RETENTION+COMPLETION = http://www.*-*-*.com/



Wed, 22 Jun 2005 06:41:26 GMT  
 Date Decoding

Quote:

> I have a page that I need to decode the date string for the query in the
> page.  I have used the decode() command with no success.
> The result page address appears as:
> http://www.jet-base.com/COAHSI/SearchResultsDate.php?FromDate=2003%2F...
> oDate=2003%2F1%2F9&Submit=Search, for example, but won't decode the date
> format.

I dont know what decode() function you are referring to, but there is
an urldecode() function available.

I tried to urldecode() your url above like this:

$ php
<?php echo
urldecode('http://www.jet-base.com/COAHSI/SearchResultsDate.php?FromDate=2003%2F...)
?>
X-Powered-By: PHP/4.2.2
Content-type: text/html

http://www.jet-base.com/COAHSI/SearchResultsDate.php?FromDate=2003/1/...

Looks good to me anyway.

Btw, you could avoid the whole issue by using dashes instead of
slashes in your dates.



Wed, 22 Jun 2005 18:42:04 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Reed-Solomon Decoding with decoding failure signal

2. Invalid dates - 215 using Btrieve/Clipper DATE format

3. how to convert clarion date to sql date

4. Create Time / date or Modified Time / date of a txt file

5. Clarion date to MS SQL date.

6. Dataflex dates to Clarion dates

7. CW2.003 File copy changes the date.....need a way to copy w/o date change

8. Clarion Date (Long) -> Access Date\Time

9. Converting dates exported by CCVT to DBF dates

10. convert labview date/time to excel date/time

11. Search a spreadsheet for a character string (date) and read to another date

 

 
Powered by phpBB® Forum Software