obey-robots.txt
October 16 2018 01:35:09
Navigation
Your ad can be here below
Facebook Like
Portfolio
BetterClimate.Net
ComplaintSupport.Com
Daily-Breaking-News.Com
Kidiot.Org
Php-Fusion.Asia
Php-Fusion.Cn
Php-Fusion.Fr
Php-Fusion.In
Php-Fusion.Start-Pages.Com
Rain-Radar.Com
Speed-Testing.Net
Start-Pages.Com
WebhostingTrouble.Com
WebmasterTrouble.Com
View Thread
Post your improvements and modifications to forum index.php here.
 Print Thread

php help

afoster
I did not see a forum category that would allow me to post this so I am adding it here. First of all...this is not php-fusion related and just looking for some help. I am trying to pull information from a file and have it displayed in two columns except that I want the first piece of data in the first column, then the next one in the second column and the next one in the first column again, etc. I have looked everywhere and can't find any sample code that will allow me to do this and hope that you can help. I've got it displaying in one column already but want it in two columns. This data is being updated dynamically and the display would also be displayed dynamically.

Any help would be much appreciated.
 
Ad-Bot
 
If you can read this your code works.
Tutorial Insert an advertisement panel between forum posts


Join Ad-Vertise.nl Especially for php-fusion users i have created a free text ads exchange system. How does it work? Register, select "Ads English PHP-Fusion" and create your own text advertisement. Choose an ad size, adjust colors and integrate html code on your site. Now your advertisements are shown on all participating sites who also choose "Ads English PHP-Fusion".
Fusioneer
Can you post your php code?
How is the data in the file separated?
Warning about ParkingCrew.com! Case: ParkingCrew.com acquires NameDrive.com but earnings are not transferred despite assurances and promises. Inquiries about this are ignored! It's just a con compagny. Don't do business with them!
 
afoster
Here is the code I am using:

Download source  GeSHi: PHP
  1. <?php
  2. $team[0] = "Kansas St";
  3. $team[4] = "Kentucky";
  4. $team[8] = "Loyola, Chi";
  5. $team[12] = "Nevada";
  6. $team[16] = "Florida St";
  7. $team[20] = "Gonzaga";
  8. $team[24] = "Michigan";
  9. $team[28] = "Texas AM";
  10. $team[32] = "Villanova";
  11. $team[36] = "W. Virginia";
  12. $team[40] = "Texas Tech";
  13. $team[44] = "Purdue";
  14. $team[48] = "Kansas";
  15. $team[52] = "Clemson";
  16. $team[56] = "ASU/Syr";
  17. $team[60] = "Duke";
  18. // Change this file to match your tournament picks file
  19. $file = "playerpicks18_sw16.ttw";
  20. echo "<body bgcolor=#e3e3e3>";
  21. echo "<center>";
  22. //echo "<font size=4 color=#ff0000 face=tahoma><b>Tournament Tracker 2018 - Sweet 16 " ;
  23. //echo "<br>";
  24. if (file_exists($file)) {
  25. $data = file_get_contents($file);
  26. $num = preg_match_all("/PLAYERID=(.*),PLAYERINFO1=(.*),PLAYERINFO2=(.*),PLAYERINFO3=(.*),PLAYERINFO4=(.*),PLAYERINFO5=(.*),G1=.*,G15=(.*),TIEBREAKER=(.*),PLAYERCOMMENT=(.*),SUBMITTED=(.*),TIMESTAMP=(.*)/i", $data, $matches);
  27. echo "<font size=2 color=#000000><b>Total Number Of Submitted Player Picks: $num</b> <br>";
  28. //echo $num, "<br>";
  29. echo "<div align=center>";
  30. echo "<center>";
  31. echo "<table border=0 cellpadding=0 cellspacing=0><tr><td valign=top>";
  32. echo "<table border=1 cellpadding=2 cellspacing=1 bgcolor=#ffffff><tr>";
  33. echo "<td align=center><b>Player</b></td>";
  34. echo "<td align=center><b>Champion</b></td>";
  35. echo "<td align=center><b>Tiebreaker</b></td>";
  36. echo "<td align=center><b>Submitted&nbsp</b></td></tr>";
  37. for ($i=0; $i<$num /2; $i++) {
  38. echo "<tr>";
  39. echo "<td align=left>" . $matches[1][$i] . "</td>";
  40. echo "<td align=left>" . $team[$matches[7][$i]] . "</td>";
  41. echo "<td align=center>" . $matches[8][$i] . "</td>";
  42. echo "<td align=left>" . $matches[11][$i] . "</td>";
  43. echo "</tr>";
  44. }
  45. echo "</table>";
  46. echo "</td><td valign=top align=center width=15></td><td valign=top>";
  47. echo "<table border=1 cellpadding=2 cellspacing=1 bgcolor=#ffffff><tr>";
  48. echo "<td align=center><b>Player</b></td>";
  49. echo "<td align=center><b>Champion</b></td>";
  50. echo "<td align=center><b>Tiebreaker</b></td>";
  51. echo "<td align=center><b>Submitted&nbsp</b></td></tr>";
  52. for ($i=6; $i<$num; $i++) {
  53. echo "<tr>";
  54. echo "<td align=left>" . $matches[1][$i] . "</td>";
  55. echo "<td align=left>" . $team[$matches[7][$i]] . "</td>";
  56. echo "<td align=center>" . $matches[8][$i] . "</td>";
  57. echo "<td align=left>" . $matches[11][$i] . "</td>";
  58. }
  59. echo "</tr></table>";
  60. echo "</td></tr></table>";
  61. echo "</center>";
  62. echo "</div>";
  63. }else{
  64. echo "<h3><font size=4>There are no entries at this time : (</h3></center>";
  65. }
  66. ?>
Parsed in 0.042 seconds, using GeSHi 1.0.8.10


The file that it is pulling from is the attachethis. (It would not let me attach the file.

Download source  Code
SECTION=HEADER
TITLE=TURBO TOURNEY PRO WEB WIZARD
VERSION=2005
POOLSIZE=16
POOLTYPE=3
TEAMSIZE=16
QUADRANT1=South
QUADRANT2=West
QUADRANT3=East
QUADRANT4=Midwest
INCLUDETIES=Y
PLAYERIDLAB=Name First, L
PLAYERINFO1LAB=Phone Number
PLAYERINFO1INC=N
PLAYERINFO1REQ=N
PLAYERINFO2LAB=Fax Number
PLAYERINFO2INC=N
PLAYERINFO2REQ=N
PLAYERINFO3LAB=E-Mail Address
PLAYERINFO3INC=Y
PLAYERINFO3REQ=Y
PLAYERINFO4LAB=Hamby
PLAYERINFO4INC=N
PLAYERINFO4REQ=N
PLAYERINFO5LAB=Hilton
PLAYERINFO5INC=N
PLAYERINFO5REQ=N
SECTION=DATA
PLAYERID=Bobby D,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@msn.com,PLAYERINFO4=D,PLAYERINFO5=D,G1=4,G2=12,G3=20,G4=28,G5=32,G6=40,G7=48,G8=60,G9=4,G10=20,G11=32,G12=48,G13=4,G14=48,G15=48,TIEBREAKER=105,PLAYERCOMMENT=,SUBMITTED=3/19/2018 11:51:39,TIMESTAMP=Mon Mar 19 11:51:39 2018
PLAYERID=Shary W,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@sbcglobal.net,PLAYERINFO4=D,PLAYERINFO5=D,G1=0,G2=12,G3=16,G4=24,G5=32,G6=44,G7=52,G8=60,G9=0,G10=24,G11=44,G12=60,G13=0,G14=44,G15=44,TIEBREAKER=201,PLAYERCOMMENT=,SUBMITTED=3/19/2018 12:34:14,TIMESTAMP=Mon Mar 19 12:34:14 2018
PLAYERID=Tom O,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@gmail.com,PLAYERINFO4=D,PLAYERINFO5=D,G1=4,G2=12,G3=20,G4=24,G5=32,G6=44,G7=52,G8=60,G9=12,G10=20,G11=32,G12=60,G13=20,G14=60,G15=60,TIEBREAKER=144,PLAYERCOMMENT=,SUBMITTED=3/19/2018 13:36:38,TIMESTAMP=Mon Mar 19 13:36:38 2018
PLAYERID=Marty B,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@aol.com,PLAYERINFO4=D,PLAYERINFO5=D,G1=4,G2=12,G3=20,G4=24,G5=32,G6=40,G7=48,G8=60,G9=4,G10=20,G11=32,G12=48,G13=20,G14=32,G15=32,TIEBREAKER=145,PLAYERCOMMENT=,SUBMITTED=3/19/2018 15:26:1,TIMESTAMP=Mon Mar 19 15:26:01 2018
PLAYERID=Alan B,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@gmail.com,PLAYERINFO4=D,PLAYERINFO5=D,G1=4,G2=12,G3=16,G4=24,G5=32,G6=40,G7=48,G8=60,G9=4,G10=24,G11=32,G12=60,G13=4,G14=60,G15=60,TIEBREAKER=137,PLAYERCOMMENT=,SUBMITTED=3/19/2018 20:15:36,TIMESTAMP=Mon Mar 19 20:15:36 2018
PLAYERID=Sara B,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1_1@yahoo.com,PLAYERINFO4=D,PLAYERINFO5=D,G1=4,G2=12,G3=20,G4=24,G5=32,G6=44,G7=48,G8=60,G9=4,G10=20,G11=32,G12=60,G13=4,G14=32,G15=32,TIEBREAKER=163,PLAYERCOMMENT=,SUBMITTED=3/20/2018 0:14:51,TIMESTAMP=Tue Mar 20 00:14:51 2018
PLAYERID=Rick T,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@comcast.net,PLAYERINFO4=D,PLAYERINFO5=D,G1=4,G2=8,G3=20,G4=24,G5=32,G6=40,G7=48,G8=60,G9=4,G10=20,G11=32,G12=48,G13=20,G14=32,G15=20,TIEBREAKER=172,PLAYERCOMMENT=,SUBMITTED=3/20/2018 1:40:40,TIMESTAMP=Tue Mar 20 01:40:40 2018
PLAYERID=Ger-Shine,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@pacbell.net,PLAYERINFO4=D,PLAYERINFO5=D,G1=0,G2=12,G3=20,G4=24,G5=32,G6=44,G7=48,G8=60,G9=0,G10=20,G11=32,G12=48,G13=20,G14=32,G15=32,TIEBREAKER=159,PLAYERCOMMENT=,SUBMITTED=3/20/2018 9:17:21,TIMESTAMP=Tue Mar 20 09:17:21 2018
PLAYERID=Jayce D,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@gmail.com,PLAYERINFO4=D,PLAYERINFO5=D,G1=4,G2=8,G3=20,G4=28,G5=32,G6=40,G7=48,G8=60,G9=4,G10=20,G11=40,G12=60,G13=20,G14=60,G15=20,TIEBREAKER=135,PLAYERCOMMENT=,SUBMITTED=3/20/2018 10:13:30,TIMESTAMP=Tue Mar 20 10:13:30 2018
PLAYERID=Brian B,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@yahoo.com,PLAYERINFO4=D,PLAYERINFO5=D,G1=4,G2=8,G3=20,G4=24,G5=32,G6=44,G7=48,G8=60,G9=4,G10=20,G11=32,G12=60,G13=20,G14=32,G15=32,TIEBREAKER=156,PLAYERCOMMENT=,SUBMITTED=3/20/2018 14:30:26,TIMESTAMP=Tue Mar 20 14:30:26 2018
PLAYERID=Mike D,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@yahoo.com,PLAYERINFO4=D,PLAYERINFO5=D,G1=4,G2=12,G3=20,G4=28,G5=32,G6=40,G7=48,G8=60,G9=4,G10=20,G11=32,G12=60,G13=4,G14=32,G15=32,TIEBREAKER=141,PLAYERCOMMENT=,SUBMITTED=3/20/2018 16:9:28,TIMESTAMP=Tue Mar 20 16:09:28 2018
PLAYERID=Chris R,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@yahoo.com,PLAYERINFO4=D,PLAYERINFO5=D,G1=4,G2=12,G3=20,G4=24,G5=32,G6=44,G7=48,G8=60,G9=4,G10=24,G11=32,G12=60,G13=4,G14=60,G15=60,TIEBREAKER=134,PLAYERCOMMENT=,SUBMITTED=3/20/2018 20:17:37,TIMESTAMP=Tue Mar 20 20:17:37 2018
PLAYERID=Denise C,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@gmail.com,PLAYERINFO4=D,PLAYERINFO5=D,G1=4,G2=8,G3=20,G4=28,G5=32,G6=44,G7=48,G8=60,G9=4,G10=20,G11=32,G12=48,G13=4,G14=32,G15=32,TIEBREAKER=152,PLAYERCOMMENT=,SUBMITTED=3/20/2018 22:12:55,TIMESTAMP=Tue Mar 20 22:12:55 2018
PLAYERID=Alex M,PLAYERINFO1=,PLAYERINFO2=,PLAYERINFO3=1@aol.com,PLAYERINFO4=D,PLAYERINFO5=D,G1=4,G2=12,G3=16,G4=24,G5=32,G6=44,G7=48,G8=60,G9=4,G10=24,G11=32,G12=60,G13=24,G14=60,G15=60,TIEBREAKER=137,PLAYERCOMMENT=,SUBMITTED=3/20/2018 22:34:8,TIMESTAMP=Tue Mar 20 22:34:08 2018



Edited by Fusioneer on 22-03-2018 21:32
 
afoster
The last post is the one you need to look at...disregard the first two responses.
 
Fusioneer
Cleaned up this thread a bit and removed the email addresses from your data.

I've added your code to a panel and is displayed at the front page at the bottom.

Can you describe what you want?
Warning about ParkingCrew.com! Case: ParkingCrew.com acquires NameDrive.com but earnings are not transferred despite assurances and promises. Inquiries about this are ignored! It's just a con compagny. Don't do business with them!
 
afoster
The panel that you have added is pretty much what I want except that as you can see, it is duplicating some of the information. As an example, the information for Rick T is displayed as the last entry in column one and the first entry in column 2. This information would be dynamically updated as the players submit their information and what I want is for the first player to submit his info to appear in column one, the second player to submit his info displayed in column two, the third player to submit his info back in column one and etc. That is what I have been struggling with.
 
afoster
A friend of mine figured out how to do it dynamically. The change is in the second column code as follows:

for ($x=$i; $x<$num; $x++) { (line 85 of the file)

This line replaces the line that showed:

for ($i=22; $i<$num; $i++) { (line 100 of the file)

Thanks Fusioneer for your help.
 
Jump to Forum:
New Thread Post Reply
Gebruik BBcode of HTML om naar; 'php help', te verwijzen!
BBcode:
HTML:
Users Online
Guests Online: 3

Members Online: 0

Total Members: 52
Newest Member: domdekority103
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Last Seen Users
Language Switcher
Theme Switcher
Shoutbox
You must login to post a message.

No messages have been posted.
Member Poll
PHP-Fusion, I might try it.

Yes
Member Poll: PHP-Fusion, I might try it. Yes 100% [5 Votes]
100% [5 Votes]

No
Member Poll: PHP-Fusion, I might try it. No 0% [0 Votes]
0% [0 Votes]

Maybe
Member Poll: PHP-Fusion, I might try it. Maybe 0% [0 Votes]
0% [0 Votes]

Votes: 5
You must login to vote.
Started: 20-10-2011
Latest Articles
No Articles available
897,885 unique visits