i am trying to query a text file
here is my query:
url of page
abc.1352.html?&db_id=1352
<?
$lines = file('/home/yo2015/public_html/data/abc.data');
foreach ($lines as $line) {
$parts = explode('|', $line);
if ($parts[0] == $_GET['db_id']) {
echo "$parts[50] $parts[51], $parts[28], $parts[26], $parts[15], $parts[16] ";
}}
?>
this works ok, what Im trying to get to is querying by striping the page file name,
to replace the need to input the &db_id=1352 into the end of the url.
What I have to work with is
abc.1352.html
This is what Ive come up with - Im just a newbee
<?php $agent = $_SERVER["REQUEST_URI"];
$agent = str_replace (".html", "", $agent);
$agent = str_replace ("abc", "", $agent);
print("$agent"); ?>
$lines = file('/home/yo2015/public_html/data/abc.data');
foreach ($lines as $line) {
$parts = explode('|', $line);
if ($parts[0] == $_GET['$agent']) {
echo "$parts[50] $parts[51], $parts[28], $parts[26], $parts[15], $parts[16] ";
}}
?>