Jump to content
#StayAtHome ×

Wal-Wal-2

New Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Wal-Wal-2

  • Rank
    Newbie
  1. I have php code that uses mp3 audio files stored in a database for the user to listen to. The page loads and the audio controls work and the files play on a desktop and laptop just fine. When trying to play a file on an android or IPhone, when you press the play (or any other control) nothing happens. It acts like the page is static. There is a home button on the webpage and it works so I know the page is interactive. Below is the code. I would appreciate any help. Thank you. <?php $sermons = $database->select("sermon","*");; foreach( $sermons as $sermon ) { $audio_file = 'http://xxxxxxx.com/sermons/'.$sermon['file_name']; $player = "<audio id='sermon_'$sermon[id] controls> <source src='$audio_file' type='audio/mpeg'> <source src='$audio_file' type='audio/mp3'> Your browser does not support the audio element. </audio>"; echo "<tr> <td>$sermon[sermon_date]</td> <td>$sermon[title]</td> <td>$sermon[speaker]</td> <td>$player</td> </tr>"; } ?>
  2. ginerjm - Thank you. I am not sure why the {}'s are around the array ( {$row['link']} ) code. I am really interested in learning. If you can, and it is appropriate here, can you explain it to me? I am new to the forum so not sure what the protocol is. Thanks again.
  3. requinix - I have been working on this for a couple of days. I have researched and tried many many options to no avail. I just saw Barand's latest post with an updated corrected code. Thank you for following up. I tried Barand's code and it worked great. I never thought about putting it in the code there.
  4. Barand - I know the syntax of the standard <a> tag but I have not been able to figure out how to include it in the echo "<a href='".$row[link]."'>&diams;&nbsp;&nbsp; ".$row[title]."</a><br>"; code. Maybe you know how to do that?
  5. I have researched the subject and found a few 'solutions' for my problem but cannot get it to work (I looked at ones in this forum). I have php while loop that uses variables for db values and wrapped inside <a></a> tags that work as desired. What I want to have the link open in a new tab. Here is the code I am working with: <?php //loop to collect and output db data as hyperlink with target="_blank" while($row = mysqli_fetch_assoc($result)) { //output data from each row echo "<a href='".$row[link]."'>&diams;&nbsp;&nbsp; ".$row[title]."</a><br>"; } ?>
  6. I have an array of data in which I want to display in a table with the first row of data to not be formatted. In the second row of data, I want it formatted with the CSS class of "success". When I run this code, I do not get any formatting of any rows in the table. I have tried various different options without success. Any help would be greatly appreciated. <?php $counter = 0; while($row = mysql_fetch_array($query)) { if($counter % 2 == 0) { //output data from each row of data with no class of "success" echo "<tr class='text-left'>"; if (empty($row[endDate])) { echo "<td>".$row[startDate]."</td>"; /* only one date */ } else { echo "<td>".$row[startDate].'-'.$row[endDate]."</td>"; /*date range */ } echo "<td>".$row[rideName]."</td>"; echo "<td>".$row[rideDesc]."</td>"; echo "<td>".$row[location]."</td>"; echo "<td><a href='".$row[link]."'>".$row[source]."</a></th>"; echo "</tr>"; $counter++; } else { //output data from each row echo "<tr class='text-left success'>"; if (empty($row[endDate])) { echo "<td>".$row[startDate]."</td>"; } else { echo "<td>".$row[startDate].'-'.$row[endDate]."</td>"; } echo "<td>".$row[rideName]."</td>"; echo "<td>".$row[rideDesc]."</td>"; echo "<td>".$row[location]."</td>"; echo "<td><a href='".$row[link]."'>".$row[source]."</a></th>"; echo "</tr>"; $counter++; } /* end if else */ } /* end while */ ?>
×
×
  • 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.