Auto complete page Adress

http://www.saudimeta.com/txt/arabic/SAUDIMETA_AR_DAY_27_04_2006.txt
I want to open above link page direct with a part of its adrees

example:
http://www.saudimeta.com/txt/arabic/SAUDIMETA_AR_DAY

I do not like to determine the date every day.
sal1150Asked:
Who is Participating?
 
ixtiCommented:
create a file on your local server

<?php
$todate = date("d_m_Y");
echo "<a href="http://www.saudimeta.com/txt/arabic/SAUDIMETA_AR_DAY_{$today}.txt">http://www.saudimeta.com/txt/arabic/SAUDIMETA_AR_DAY_{$today}.txt</a>";
?>
0
 
soapergemCommented:
Um...what? The second link gives a 404 error, and I don't understand your question at all. Please explain in much more detail.
0
 
sal1150Author Commented:
0
 
ixtiCommented:
create a subdir called "SAUDIMETA_AR_DAY"in "arabic"
Then create an index.php theer with the following:
<?php
$todate = date("d_m_Y");
header("Location: http://www.saudimeta.com/txt/arabic/SAUDIMETA_AR_DAY_{$today}.txt");
exit();
?>

or something like this:
<?php
$last_date = date("d_m_Y");
$file = "../SAUDIMETA_AR_DAY_[%DATE%].txt";
while (!file_exists(str_replace("[%DATE%]", $last_date)) {
    if (!isset($step)) $step = 1;
    $last_date = date("d_m_Y", strtotime("Now -". $step++ . " Days"));
}
$file = str_replace("[%DATE%]", $last_date);
require_once $file;
exit();
?>
0
 
sal1150Author Commented:
hi ixti,
how can I creat subdir???
it is not my site.

I want function to give me the current 'txt' file by this link
(http://www.saudimeta.com/txt/arabic/SAUDIMETA_AR_DAY
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.