Jump to content

cory011202

Members
  • Posts

    15
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

cory011202's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks smerny & givememore!! I have been researching this for awhile now as a side project trying to figure this out for local home server. I want to do certain web pages are shown depending on their permissions (rank). I have not implemented this fully but have played with it to ensure I fully understood what you were telling me. thanks again!
  2. Hello all, I have came to this site and received amazing help and I am hoping that you can point me into the right direction in what I am trying to accomplish. I have a site that I want to have a login page that a user logs into. With a successful login they have access to certain areas of the site. I have scoured the internet looking for a tutorial that might explain how this would work. Hopefully someone on here can point me to a place that will point me in the right direction. Work flow will be something like this User logs in as admin: they will see an admin option for user management and what not as users need to be confirmed manually. user logs in as a regular user: they see certain pages but possibly not all pages depending on what their authorized to see. That is it in a nutshell any help will be greatly appreciated.
  3. Greetings all, I have a project I am looking to start and I am sure I will be picking your brains for help along the way as I have done some php applications and databases in the past so im not a total noob but not much past noobness. However, I am going to be writing a web front end to my linux file server that is on my home network. I have it broke out into public and private directories. Currently I use .htaccess to protect these directories. I have friends and family that would like to access the files that in the public directory. I want to be able to have a user login and based on who they are then they will see public only or both if they have a need to such as me or my wife. I would like to do this with php using a mysql database to store username and password and other info such as privilege. Currently I use a phpscript that you can access after using apache auth but it will still list out the private directory and its contents and just not let you access them. So my question is php vs apache for auth? My apologies for rambling hopefully I didn't over complicate it.
  4. I thought that could have been the culprit before but it still doesn't bring the names with it. I just tried it to be sure and it didnt bring them again. I tried changing playerName = $_POST['name'][$key]; to playerName = $_POST['player'][$key]; as well as playerName = $_POST['player[]'][$key]; I am at a loss for what is keeping this from posting the names.
  5. Mkesta707, My code follows per your request. This is the function that builds the table of players. function populatePlayerTblNames($teamID) { //Query for players $aPlayers = mysql_query("SELECT l_name, f_name, number FROM bbball_stats WHERE team_ID = '$teamID' ORDER BY number") or die(mysql_error()); //Loop to display players while ($row = mysql_fetch_array($aPlayers)) { //Initialize the coutner for the alt row color if statement $i++; //Begin the row for the table //code to alternate color and build the table if($i % 2){//this divied $i by 2 and if there is a remainder echo "<tr bgcolor=\"white\" id=\"row" . $i . "\">\n";} else {//This means that $i divided by 2 is an even number echo "<tr bgcolor=\"#aaaaaa\" id=\"row" . $i . "\">\n"; } //list the player name for the team echo "<td><input type=\"hidden\" name=\"player[]\" />" . $row["l_name"] . " " . $row["f_name"] . "</td>\n"; //For loop to insert input boxes for player stats for ($r = 1; $r<14; $r++) { //insert the input boxes echo "<td><INPUT name=\"stat" . "$r" . "[]\" type=\"text\" size=\"1\"></td>\n"; //End input box for loop } echo "</tr>\n"; //End player while loop } //End Function } This coded is my the code from the page that the form posts the information to. This includes the code from your second posting on trying to get the names with the stats. foreach($_POST['player'] as $key => $player){ //every row has the same key in the post array, so the key for //the player name's will be the same key for his stats. so we can do $playerStat1 = $_POST['stat1'][$key]; //and now we have the players stat1 //do the rest for the others $playerStat2 = $_POST['stat2'][$key]; $playerStat3 = $_POST['stat3'][$key]; $playerStat4 = $_POST['stat4'][$key]; $playerStat5 = $_POST['stat5'][$key]; $playerStat6 = $_POST['stat6'][$key]; $playerStat7 = $_POST['stat7'][$key]; $playerStat8 = $_POST['stat8'][$key]; $playerStat9 = $_POST['stat9'][$key]; $playerStat10 = $_POST['stat10'][$key]; $playerStat11 = $_POST['stat11'][$key]; $playerStat12 = $_POST['stat12'][$key]; $playerStat13 = $_POST['stat13'][$key]; //Echo the player stats. echo $playerStat1 . " " . $playerStat2 . " " . $playerStat3 . " " . $playerStat4 . " " . $playerStat5 . " " . $playerStat6 . " " . $playerStat7 . " " . $playerStat8 . " " . $playerStat9 . " " . $playerStat10 . " " . $playerStat11 . " " . $playerStat12 . " " . $playerStat13 . "<br />"; //This is the code I added from your second post. $playerName = $_POST['name'][$key]; echo $playerName; } Again thanks for all your help. Cory
  6. mikesta707, Thank you for all your help. I tried your suggestion and I did follow your advice on the hidden field. I added your extra code and it still only returns numbers for the stats. Any other help you could offer would help tremendously. Thanks, Cory
  7. Thanks this worked out great! However, When I post it I would like to echo the results of the post before I insert into the database. So now I can get it to echo all of the players stats. I would like for it to post the players name in front of the stats as well. Any further help would be greatly appreciated.
  8. Hello all, I have a site I am working on. Its a sports site and I am trying to add stats to a DB. I have a table that will have varying amounts of rows depending on how many kids are on the team. I need to take the rows of the stats table and be able to add them to the DB with a single submit button. Here is the code for my table. The form is calling another php page for processing. I am thinking I will need a foreach to pull all the rows out of the table but not sure on how to reference the table in the POST. Any help would be greatly appreciated. <table align="center" width="780 px" name="aStatsInput"> <tr> <td align="center" colspan="14"><b>Away Team </b>Bushnell-Prairie City/Avon</td> </tr> <tr> <th style="table-layout: fixed; align: left; width: 100 px;">Player</th> <th>fgM</th> <th> fgA</th> <th> ftM</th> <th> ftA</th> <th> 3ptM</th> <th> 3ptA</th> <th> OReb</th> <th> DReb</th> <th> Assts</th> <th> Steals</th> <th> Fouls</th> <th> TFouls</th> <th> Turnovrs</th> </tr> <tr bgcolor="white" id="row1"> <td>Hulett Dewain</td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> </tr> <tr bgcolor="#aaaaaa" id="row2"> <td>Powell Cory</td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> <td><INPUT name="" type="text" size="1"></td> </tr> </table>
  9. All, I am hoping someone here can steer me in the right direction. I have googled this as many ways as I can think of. I have a customers website that is for high school sports in our area. Its using word press as its content managements system. My customer would like to be able to stream audio only high school games via the website . I am at a loss on how to get this going. They are using Bluehost as their hosting site. Any help or expertise or links to software or services that could help would be greatly appreciated. Thanks!
  10. Well that fixed the issued of only showing the first letter. Still only pulls the last info record. I need to somehow pull out the information from the radio button after it is updated and send it to the query
  11. Thanks for the quick response! however it still only takes the last input and now it will only display the first letter of whatever I type in. I dont know know why its only taking the last row and using that to update the other records. I am guessing since it will update the other records then the id is working correctly
  12. Hello You have helped me out before lets hope we can keep the streak alive! My problem is I am working on a page for a racer that wants to be able to update his schedule of races and have it display on his web page. I have the database queries working ( Still need to work on the date) and I can post,update and retrieve information with the db. My problem is it will only read information from the very last record pulled from the db. So if I have 5 records and I edit 1 -4 nothing will happen. if I edit 5 then I will get that information posted. if I edit 1-4 record 5 is still posted. Now if I have the radio button check on 1-4 then it wll update with the same info as the 5th record has. I am guessing I am not calling the record id or something as id is the primary key. thanks for your help. <!--table to display and edit schedule information--> <table id="schedtable" align="center"> <tr> <td width="50">Edit</td <td width="250">Date</td> <td width="250">Track</td> <td width="250">Information</td> <td width="250">Race Results</td> </tr> <!--start form--> <form method="post" action="schedule_update.php"> <?php // loop to display info from db while ( $row = mysql_fetch_array($cur_sched)) { echo "<tr>"; echo "<td width='50'>" . "<input name='id'type='radio' value=" . $row['id'] . " >" . "</td>"; echo "<td width='250'>" . "<input name='date' type='text' value=" . $row['date'] . ">" . "</td>"; echo "<td width='250'>" . "<input name='track' type='text' value=" . $row['track'] . ">" . "</td>"; echo "<td width='250'>" . "<input name='information' type='text' value=" . $row['other'] . ">" . "</td>"; echo "<td width='250'>" . "<input name='results' type='text' value=" . $row['results'] . ">" . "</td>"; echo "</tr>"; //end loop } ?> <!--buttons for form--> <tr> <td colspan="5" align="center"> <INPUT type="submit" value="Update" name="submit" /> </td> </tr> <!--end form--> </form> </table> This is the php file for the query <?php //connect to the db require_once('includes/connection.php'); //Gets the Schedule from the schedule page $id = $_POST['id']; $date = $_POST['date']; $track = $_POST['track']; $information = $_POST['information']; $results = $_POST['results']; //Query to insert data into database $result = mysql_query("UPDATE raceinfo SET date='$date', track='$track', other='$information', results='$results' WHERE id='$id' ") or die(mysql_error()); //here for troubleshooting echo $id; echo $date; echo $track; echo $information; echo $results; //redirect after query header("Location:schedule.php"); ?>
  13. Thank you as this was able to do exactly what I needed thank you for the help.
  14. Hello all, I am fairly new to php and I am trying to create an array from files listed in a directory such as images. Below is my code so far. I would like to take the results and put them into an array that I can display on a page. In the end I will have the images change every hour from top to bottom (that is the plan atleast). Any help or direction anyone can give would be greatly appreciated. I hope I have posted this in the correct forum topic. Thanks in advance. <?php $open = opendir("./test/"); while ($read = readdir($open)) { if ($read!= "." && $read!= "..") { echo $read . '<br>'; } } closedir($open); ?>
  15. All I am designing a website for a motorcycle club. One of the pages they want is member profiles viewable by the public and they want the picture and info able to be updated by the user. I would like to have the profile page have about 8 entries on it and you click on they photo or name and you go to their full member profile page. And I would like it to paginate for more than 8 profiles. I would like the page to display 8 with the pics on the left side with there name or nick name and go horizontally on the page. Any help would be greatly appreciated. I do not want anything but a picture name age hometown quote to be listed nothing fnacy just cut and dry. I know for a seasoned php/mysql guy this is a simple task I am still quite a noobie at php. Thank you in advance for any responses. Also if there is a commercial opensource solution I am open for that as well but I have googled and found nothing once again thank you for your time
×
×
  • 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.