Log in

View Full Version : load data from mysql and write html ?



bernhard
06-24-2013, 05:00 PM
Is there a simple script that loads a name and a link from a database and writes that automatically into a html site ?

The output html site should be just a simple html site, with a name .. and the name should have a hyperlink to that specific url.

thank you so much for any little help !

traq
06-24-2013, 05:17 PM
Something like this is not complicated, but the implementation will depend on your specific needs. Do you have an existing database? If so, can you describe its structure?

molendijk
06-24-2013, 09:08 PM
If you just want a name and a url to be written onto the html site (let's call it 'main.html'), and if you decide to store the data in another html site (let's call it 'data.html'), and if you use built-in code (no javascript of your own) then you could simply do:

main.html:

<body>
<iframe src="data.html" style="position: absolute; top: -10000px"></iframe>
<div id="data_receiver"></div>
</body>
data.html:

<body onload="parent.document.getElementById('data_receiver').innerHTML=document.getElementById('the_data').innerHTML">
<div id="the_data">
<a href="javascript: void(0)" onclick="window.open('http://www.dynamicdrive.com'); return false">DD</a>
</div>
</body>