Jump to content

XLOSS

New Members
  • Posts

    2
  • Joined

  • Last visited

XLOSS's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. data.php : <?php $ch = curl_init('example.com/'); // set curl option to fetch (get) $result = curl_exec($ch); echo $result; $conn = new mysqli('localhost', 'root', '', 'shoutout'); if ($conn->connect_error) { die("Connection error: " . $conn->connect_error); } $result = $conn->query("SELECT channel1 FROM users"); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { echo $row['channel1']. '<br>'; } } ?> index.php : <?php include('data.php') <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> <body> <iframe id="w2" src="data.php" height="80px" width="300px" frameborder="0" style="border: 0; width:300px; height:80px; background-color: #FFF;"></iframe> </body> </html> i made some changes ,, i can retrive values but it is not appending , please help. i want to make url by using variable and database value . and want to load in iframe. thank you
  2. I AM WORKING ON A PROJECT , I NEED YOUR HELP. I WANT TO USE EXISTING SRC OF IFRAME + RETRIVED VALUE FROM DATABASE INTO IFRAME This is my data.php to retrive values from database into iframe without refresh web page. <?php $conn = new mysqli('localhost', 'root', '', 'x'); if ($conn->connect_error) { die("Connection error: " . $conn->connect_error); } $result = $conn->query("SELECT number1 FROM users"); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { echo $row['number1'] . '<br>'; } } ?> FOLLOWING IS INDEX FILE <?php include('data.php') ?> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> <body> <div id="show"></div> <script type="text/javascript" src="jquery-3.1.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { setInterval(function () { $('#show').load('data.php') }, 1000); }); </script> <iframe id="w3" src="DATABASE RETRIVED VALUE" height="80px" width="300px" frameborder="0" style="border: 0; width:300px; height:80px; background-color: #FFF;"></iframe> </body> </html> INDEX FILE CODES CAN SUCCESSFULLY RETRIVE VALUES FROM DATABASE BUT, I WANT TO STORE IT IN IFRAME SRC . VAR= URLS = 'HTTP://WWW.GOOGLE.COM' IFRAME SRC WILL BE VAR URLS + RETRIEVED VALUE FROM DATABASE
×
×
  • 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.