Jump to content

JEB

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

JEB's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi - I have been attempting to do this myself, but just can't figure out what code and where I need to add. If anyone could help it would be really appreciated.
  2. Thanks - Like I saw I know absolutely nothing about PHP. Where would I put the block of code, and what would it look like to have an option in the list that says "All Competitive Matches". Any help would be appreciated.
  3. I am a complete novice with PHP and require some assistance if possible please. This URL pulls up a stats page for a local football club. There are several different match types, League, Cup etc. If you select the "All" option it gives all results including; Bounce Game, Friendly and Testimonial. http://briskham.co.uk/playerstats/index.php I would like to add another option in the Match Type drop-down list that will be called "All Competitive" and for this to include all match types apart from; Friendly, Bounce Game, Testimonial - MatchTypeID - 6, 8 and 9. I have attached a copy of the PHP file, could someone manage to help me out with this one please? Many thanks 18780_.php
  4. Thanks for that, but I said be gentle  :) The words Double and Dutch spring to mind  ???. I'll have a hunt around and see if I can find some examples of it working in something as a pointer. Thanks for responding.
  5. Can I start by saying I know absolutly nothing about PHP, but I'm starting to learn, so please be gentle with me. All I want to do is produce a simple .php file that lists in date order all of the files in my server. I've got this code that runs fine on a test server, but on the server I want to run it in anger on is hosted, and the bin directory is set to chmod 111, and I can't change it. When my code gets to that dir it falls over. Can someone help show me what I have to do to add so something to my code to skip certain directories I can list, such as bin or lib directories. Thank you. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> body, td { font-size: 8pt; font-family: sans-serif; } a:link, a:hover, a:active, a:visited { font-size: 8pt; color: #0000FF; } </style> </head> <body> <?php $dir = "."; $directories = array(); $files = array(); function recursedir($rootdir){ $directories = array(); $files = array(); $dir = (substr($rootdir, -1) == '/') ? substr($rootdir, 0, -1) : $rootdir; if(is_dir($dir)){ if($handle = opendir($dir)){ while(false !== ($file = readdir($handle))){ if($file != "." && $file != ".."){ $filename = $dir.'/'.$file; if(is_dir($filename)){ $folder = $filename; $files = array_merge($files, recursedir($filename)); //echo $folder."<br />"; } else { $files[$filename] = filemtime($filename); } } } closedir($handle); } else { die('Could not open directory.'); } } else { die('Invalid directory.'); } return $files; } $files = recursedir("."); if($_GET['sort'] == 'alpha'){ if($_GET['mode'] == 'desc'){ krsort($files); $highlight = 'alpha_desc'; } else { ksort($files); $highlight = 'alpha_asc'; } } else { if($_GET['mode'] == 'asc'){ asort($files, SORT_NUMERIC); $highlight = 'date_asc'; } else { arsort($files, SORT_NUMERIC); $highlight = 'date_desc'; } } $sort_alpha_asc = ($highlight == 'alpha_asc') ? '<b>Asc</b>' : '<a href="?sort=alpha&mode=asc">Asc</a>'; $sort_alpha_desc = ($highlight == 'alpha_desc') ? '<b>Desc</b>' : '<a href="?sort=alpha&mode=desc">Desc</a>'; $sort_date_asc = ($highlight == 'date_asc') ? '<b>Asc</b>' : '<a href="?sort=date&mode=asc">Asc</a>'; $sort_date_desc = ($highlight == 'date_desc') ? '<b>Desc</b>' : '<a href="?sort=date&mode=desc">Desc</a>'; echo "Sort by: Date- $sort_date_asc | $sort_date_desc; Name- $sort_alpha_asc | $sort_alpha_desc<br />\n<br />\n"; echo "<table border=\"0\">\n<tr><td><u>File</u></td><td width=\"25\"></td><td><u>Size</u></td><td width=\"25\"></td><td><u>Last Modified</u></td></tr>\n"; foreach($files as $file => $timestamp){ echo "<tr><td><a href=\"$dir/$file\">$file</a></td><td></td><td>"; $filesize = filesize($file); if($filesize >= 1048576){ echo round($filesize / 1048576, 1).'MB'; } else { echo round($filesize / 1024, 1).'kb'; } echo '</td><td></td><td>'.date('d M Y H:i:s', $timestamp)."</td></tr>\n"; } echo '</table>'; ?> </body> </html>
  6. I've got a SQL db running on my web server and I wanted to query some records in it back to a web page. I'm using MX V6.0. I can connect to my site & DB ok, can see the tables, and have created a Recordset. I've dragged a field from the recordset onto my web page, and when I try to preview it I get the following error:- Parse error: parse error, unexpected T_STRING in /home/craftyiorg/public_html/TMP4kp26y67bj.php on line 5 My full code is:- <?php require_once('Connections/Test.php'); ?> <?php mysql_select_db($database_Test, $Test); $query_TestMatches = "SELECT MatchID, MatchTypeID, MatchSeasonID, MatchDateTime, MatchOpponent, MatchPlaceID, MatchStadium, MatchReferee, MatchGoals, MatchGoalsOpponent FROM tplss_matches ORDER BY MatchDateTime ASC"; $TestMatches = mysql_query($query_TestMatches, $Test) or die(mysql_error()); $row_TestMatches = mysql_fetch_assoc($TestMatches); $totalRows_TestMatches = mysql_num_rows($TestMatches); ?> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php echo $row_TestMatches['MatchID']; ?> </body> </html> <?php mysql_free_result($TestMatches); ?> My connection is called 'test', and my Recordest is called 'TestMatches'. I've also tried saving the .php file and ftping it onto my webspace, but it won't run from there either. Has anyone got any ideas what may be causing this please?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.