Jump to content

Chunk78

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by Chunk78

  1. Thanks for the comments MrAdam. The banner shows a picture of their Playing field and incorporates their Shirt Badge and originally they played in Orange and Black hence the colours of the Team name. Any chance you can expand upon what it is you dislike? I agree about the gradients - not sure what I was trying to achieve there but I think I'll look to change that in with my next batch of updates Any suggestions on how to improve the images in the nav section - took me a while to find any images in the 1st place - I'm not that great when it comes to images editing really but willing to have a go!!!
  2. Hi Guys Any chance you can take a look at the following site: www.tredegar-arms-afc.co.uk Any comments would be appreciated as this is my first major php effort Site is a little out of date as the secretary of the club has not provided any data updates for the last few weeks. Thanks
  3. Hi Guys Any chance you can take a look at the following site: www.tredegar-arms-afc.co.uk Any comments would be appreciated as i'm pretty new to php Thanks
  4. Hi all Just a quick question? Can I use MySQL with Java without Apache installed on my PC? If so how. Reason for asking: I am creating a Java Program that I want to use it in conjuntion with a MySQL database I use on my website. While I'm testing it I don't want to mess with the live data so I'm looking to create a copy on my local HardDrive. To add to this I'm also a novice at Java so I guess this is going to be a steep learning curve. Thanks
  5. Thanks both I'll give this a try and see how I get on
  6. Hi I'm a newbie to php and I'm struggling with the following problem: I am using php/mySQL to display a photo gallery. I have it working OK at the moment if I want to display all photos from the database. However I would like to smarten up the page a bit. Each of the photos in the database are arranged into catagories so I would like to use a drop down menu to allow the user to filter the photos by Catagory. My plan would be to build a drop-down menu based on the catagories stored in the database. The user would select the catagory then use a submit button to rebuild the page with the new filter as part of the query. 1) How do I dynamically build a drop-down menu. 2) If the user selects an option from the drop-down menu how do I store the value selected and use it to filter the MYSQL query. I have no problem with the MySQL syntax for this, just using the selected Value. I also want to redisplay the option chosen by user I hope the above makes sense I would appreciate it if somebody could point me in the right direction Many Thanks
  7. Hi all I'm a complete newbie when it comes to AJAX but after reading the tutorials on here and some of the posts I thought I would give it a go. I am writing a Players profile section for my local football team. I have a drop down box that allows you to filter the profiles by position. Each time the List box value changes it populates a list box with all the players matching that position. Clicking on a players name will then display their Statistics. When I was writing the page I carried out my testing using Firefox and couldn't believe how smoothly things were going. I then tried testing it in Opera and Internet Explorer and on both occasions I cannot get the List Box to populate. I have attached an image of the error message I get from IE: Any help would be much appreciated: Code is as follows: HTML Page: <head> <script src="database/scripts/playerprofile.js"></script> </head> <body onload="filterProfiles('All Profiles')"> <div id="contentwide"> <h2>Tredegar Arms AFC - Player Profiles </h2> <p>This section will introduce you to the Tredegar Arms AFC Players.</p> <form> <table width="80%"> <tr> <td> <select id="CatagorySelect" name="CatagorySelect" onchange="filterProfiles(this.value)"> <option value="AL" selected="selected">All Profiles</option> <option value="NP">Non Players</option> <option value="GK">Goalkeepers</option> <option value="DF">Defenders</option> <option value="MD">Midfielders</option> <option value="ST">Strikers</option> </select> </td> </tr> </table> <p></p> <table> <tr> <td width="25%" rowspan="10" valign="top"> <select id="Playerlist" name="Playerlist" size="15" onchange="displayProfiles(this.value)"> </select> </td> </tr> <tr> <td> <div id="buildProfile" name="buildProfile"> </div> </td> </tr> </table> </form> </body> </html> This is the JavaScript Code: var xmlHttp = false //This function returns the Available Profiles function stateChanged() { alert(xmlHttp.readyState+" -- "+xmlHttp.responseText) if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("Playerlist").innerHTML=xmlHttp.responseText } } //This Function returns the Player Profiles Values function stateChanged2() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { //alert(xmlHttp.responseText) document.getElementById("buildProfile").innerHTML=xmlHttp.responseText } } //This function sets up the XMLHttp variable function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } // This function will search the database for all players that match the Filter Criteria function filterProfiles(filterString) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="./database/include/pro_filters.php" url=url+"?q="+filterString url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } //This function will display the Profiles on the screen function displayProfiles(PlayerID) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="./database/include/pro_display.php" url=url+"?q="+PlayerID url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged2 xmlHttp.open("GET",url,true) xmlHttp.send(null) } This is the php for populating the Player Information <?php $q=$_GET["q"]; $pos = strpos ( $q , ', ' , 0 ); $SName=substr($q, 0, $pos); $FName=substr($q, $pos+2); include ("db_con.php"); //Run Query $query = "SELECT player_aka, player_DOB, player_pos_full, player_favourite, player_ambition, player_imageid, player_cur_played, player_cur_scored FROM tbl_player_profile WHERE player_fname= '".$FName."' AND player_sname='".$SName."'"; $result = mysql_query($query) or die("Invalid Query Type: - Query failed:"); echo "<table>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<th>Name:</th>"; echo "<td>" .$FName." ".$SName."</td>"; echo "<td rowspan='3'><div align='center'><img src='./images/".$row['player_imageid'].".jpg' alt='Picture for" .$FName." ".$SName."' width='100' height='100' id='PlayerPicture' /></div></td>"; echo "</tr>"; echo "<tr>"; echo "<th>Nickname:</th>"; echo "<td>" . $row['player_aka'] . "</td>"; echo "</tr>"; echo "<tr>"; echo "<th>Position:</th>"; echo "<td>" . $row['player_pos_full'] . "</td>"; echo "</tr>"; echo "<tr>"; echo "<th>DOB:</th>"; echo "<td colspan=2>" . $row['player_DOB'] . "</td>"; echo "</tr>"; echo "<tr>"; echo "<th>Ambition:</th>"; echo "<td colspan=2>" . $row['player_ambition'] . "</td>"; echo "</tr>"; echo "<tr>"; echo "<th>Fav Player:</th>"; echo "<td colspan=2>" . $row['player_favourite'] . "</td>"; echo "</tr>"; echo "<tr>"; echo "<th>Played:</th>"; echo "<td colspan=2>" . $row['player_cur_played'] . "</td>"; echo "</tr>"; echo "<tr>"; if ($row['player_pos_full']=="Goalkeepers") { echo "<th>Conceded:</th>"; } else { echo "<th>Scored:</th>"; } echo "<td colspan=2>" . $row['player_cur_scored'] . "</td>"; echo "</tr>"; } echo "</table>"; ?> This is the php for populating the list box <?php $q=$_GET["q"]; include ("db_con.php"); switch ($q) { case 'NP': // Non Playing Staff Profiles have been selected $buildQuery = " WHERE player_pos_short = 'CS' OR player_pos_short = 'CO' OR player_pos_short = 'MA' OR player_pos_short = 'CS' "; break; case 'GK': // GoalKeepers Profiles have been selected $buildQuery = " WHERE player_pos_short = 'GK' "; break; case 'DF': // Defenders Profiles have been selected $buildQuery = " WHERE player_pos_short = 'DF' "; break; case 'MD': // Midfielders Profiles have been selected $buildQuery = " WHERE player_pos_short = 'MD' "; break; case 'ST': // GoalKeepers Profiles have been selected $buildQuery = " WHERE player_pos_short = 'ST' "; break; default: // All Profiles have been selected $buildQuery = " "; } //Run Query $query = "SELECT player_id, player_sname, player_fname FROM tbl_player_profile $buildQuery ORDER BY player_sname ASC, player_fname ASC"; $result = mysql_query($query) or die("Invalid Query Type: - Query failed:"); $numberOfRows = MYSQL_NUMROWS($result); if ($numberOfRows==0) { echo "<option>No Profiles Found</option>"; } else if ($numberOfRows>0) { while ($i < $numberOfRows) { $thisFname = MYSQL_RESULT($result,$i,"player_fname"); $thisSname = MYSQL_RESULT($result,$i,"player_sname"); $displayProfile = $thisSname.", ".$thisFname; echo "<option>$displayProfile</option>\n"; $i ++; } } ?> [attachment deleted by admin]
  8. Hi All I'm complete novice to php so I was wondering if anybody can point me in the right direction. I have a function that will read records from the database and populate an area of my webpage based on a value selected from a list box. I have got it to work fine if the user hits a submit button but I was wondering if it possible to perform the function dynamically each time the user changes the value in the list box. Hope the above makes sense......any help would be much appreciated
×
×
  • 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.