<table>
<thead>
<tr>
<th width="50%">URL= http://hizlitestplay.xyz:8080</th>
</tr>
<tr>
<th width="50%">KULLANICI ADI=</th>
</tr>
<tr>
<th width="50%">PAROLA=</th>
</tr>
</thead>
<tbody>
<?php
$url = 'http://webdizey.com'; // Doğru URL'yi belirtin
// Sorgu dizesini oluşturun
$query = http_build_query($rUser);
// Sorgu dizesi ile tam URL'yi oluşturun
$fullUrl = $url . '?' . $query;
// Belirtilen URL'den JSON verilerini alın
$json = json_decode(file_get_contents($fullUrl), true);
// JSON verilerini döngü ile işleyin ve tabloya ekleyin
foreach ($json as $userData) {
?>
<tr>
<td><center><strong><?php echo $rUser = getUser($_POST["username"]); ?></strong></center></td>
<td><center><strong><?php echo $userData["password"]; ?></strong></center></td>
</tr>
<?php } ?>
</tbody>
</table>ana dosya burada: https://file.io/DbQOI5uSYOZg PHP post hakkınıda yardıma ihtiyacım var
7
●188
- 30-11-2023, 01:52:43merhaba arkadaşlar php hakkında bir yardıma ihtiyacım var open source bir projede bir formda boş bir yere sıralı array yazdırmak istiyorum yardımcı olurmusunuz örnek dosyayı ekte atıyorum.
- 30-11-2023, 01:55:55foreach ($json as $userData) {
satırını
foreach ($userData as $json) {
şeklinde günceller misin. - 30-11-2023, 02:58:49
<table> <thead> <tr> <th width="50%">URL= http://hizlitestplay.xyz:8080</th> </tr> <tr> <th width="50%">KULLANICI ADI=</th> </tr> <tr> <th width="50%">PAROLA=</th> </tr> </thead> <tbody> <?php $url = 'http://webdizey.com'; // Doğru URL'yi belirtin // Sorgu dizesini oluşturun $query = http_build_query($rUser); // Sorgu dizesi ile tam URL'yi oluşturun $fullUrl = $url . '?' . $query; // Belirtilen URL'den JSON verilerini alın $json = json_decode(file_get_contents($fullUrl), true); // JSON verilerini döngü ile işleyin ve tabloya ekleyin foreach ($json as $userData) { ?> <tr> <td><center><strong><?php echo $userData["username"]; ?></strong></center></td> <td><center><strong><?php echo $userData["password"]; ?></strong></center></td> </tr> <?php } ?> </tbody> </table> - 30-11-2023, 16:18:52Kodunuzda $rUser değişkenini oluşturduktan sonra, bu değişkeni http_build_query fonksiyonuna kullanıyorsunuz, ancak $rUser'ı tanımlamamışsınız.
Ayrıca, getUser fonksiyonu da kodunuzda tanımlanmamış gibi görünüyor. Bu fonksiyonun nasıl çalıştığını ve hangi değerleri döndürdüğünü bilmem gerekiyor.
Aşağıda, sıralı bir array'i formda yazdırmak için örnek bir kod parçası bulunmaktadır. Ancak, bu kodu ihtiyacınıza göre uyarmanız gerekebilir:
<table> <thead> <tr> <th width="50%">URL= http://hizlitestplay.xyz:8080</th> </tr> <tr> <th width="50%">KULLANICI ADI=</th> </tr> <tr> <th width="50%">PAROLA=</th> </tr> </thead> <tbody> <?php // Örnek bir sıralı array $sampleArray = array( array("username" => "user1", "password" => "pass1"), array("username" => "user2", "password" => "pass2"), // Diğer array elemanları... ); // Sıralı array'i döngü ile işleyin ve tabloya ekleyin foreach ($sampleArray as $userData) { ?> <tr> <td><center><strong><?php echo $userData["username"]; ?></strong></center></td> <td><center><strong><?php echo $userData["password"]; ?></strong></center></td> </tr> <?php } ?> </tbody> </table>Bu örnek, $sampleArray adlı bir sıralı array içerir ve bu array'deki verileri tabloya ekler. Siz bu kodu, gerçek verileriniz ve kullanım senaryonuza göre uyarlayabilirsiniz. Ayrıca, eksik olan fonksiyonları ve değişkenleri de doğru bir şekilde tanımlamanız gerekecek.
ChatGPT - 30-11-2023, 19:13:16