A bit of help if anyone can help please.
I have this PHP script Im trying out:
All files and cgi-bin are in the same folder and server.
SCRIPT
$lines = file('/cgi-bin/data/car.data');
foreach ($lines as $line) {
$parts = explode('|', $line);
if ($parts[0] == $_GET['db_id']) {
print_r($parts);
} }
END
Basically, the script grabs "db_id=1352"
from the url:
domain.com/cgi-bin/cl.cgi?db=car&db_id=1352
and searches a text data file.
"/cgi-bin/data/car.data"
The text data file, shown next line:
1352|markz|Domestic Cars|Pontiac|Bonneville|$23,400 obo|FOR SALE:
continues on a new line for each entry.
1353|..|....|
1354|...|....|
etc...
The result from the script is working,
but the script shows every field entry per line.
I would like to be able to choose the exact field
entry and display it as needed.
The script seperates and displays all lines like this:
Array
(
[0] => 1352
[1] => markz
[2] => Domestic Cars
[3] => Pontiac
[4] => Bonneville
[5] => $23,400 obo
[6] => FOR SALE:
)
How can I show, only
field 6 - field 3, field 4
and not the entire line?
The action would be to get some unique data into the title.
<title> field 6 - field 3, field 4 </title>
or
<title> FOR SALE: - Pontiac, Bonneville </title>