I have been building a website with some PHP coding but im stuck on one bit!!
I want the script to automatically open the hyperlink without the visitor clicking on the link... (similar to browser re-direct)
It currently displays the match result and then invites the visitor to click in order to view the match report, I just want the match report to display instantly without having to click.
I have been tring everything but no joy.
Could you help (save me from going mad)
Thanks
Ian
Code: Select all
<?php
$host = 'localhost';
$user = '****';
$password = '****';
$txt_db_name = '****';
$connection = mysql_connect("$host","$user","$password")
or die(mysql_error());
mysql_select_db("$txt_db_name",$connection)
or die(mysql_error());
$pref = mysql_query("
SELECT TeamName AS teamname
FROM tplss_preferences
WHERE ID = '0'
", $connection)
or die(mysql_error());
$teamname = mysql_fetch_array($pref);
mysql_free_result($pref);
$get_report = mysql_query("
SELECT
M.MatchID AS id,
MT.MatchTypeName AS typename,
O.OpponentName AS opp,
M.MatchPlaceID AS place,
M.MatchGoals AS gf,
M.MatchGoalsOpponent AS ga,
DATE_FORMAT(M.MatchDateTime, '%W %d %b') AS time
FROM tplss_matches M, tplss_matchtypes MT, tplss_opponents O
WHERE M.MatchDateTime < CURRENT_TIMESTAMP AND M.MatchReport != '' AND
MT.MatchTypeID = M.MatchTypeID AND
O.OpponentID = M.MatchOpponent
ORDER BY M.MatchDateTime DESC
LIMIT 1", $connection)
or die(mysql_error());
$data = mysql_fetch_array($get_report);
//Check if it's home or away game
if($data['place'] == 1)
{
echo"
$data[time]<br>
$data[typename]<br>
$teamname[teamname] $data[gf] - $data[opp] $data[ga]<br>
<a href=\"matchdetails.php?id=$data[id]\"target=\"_self\">match report</a>";
}
elseif($data['place'] == 2)
{
echo"
$data[time]<br>
$data[typename]<br>
$data[opp] $data[ga] - $teamname[teamname] $data[gf]<br>
<a href=\"matchdetails.php?id=$data[id]\"target=\"_self\">match report</a>";
}
mysql_free_result($get_report);