maanib
پنج شنبه 05 فروردین 1389, 17:42 عصر
سلام! سال نو رو به همه دوستان شادباش میگم.
خواستم بدونم چطور میشه یک داده رو که از دیتابیس فراخوانی کردیم، بگذاریمش توی یک تگِ script بطوریکه بتونه اون داده رو هم نمایش بده؟
لطفا به دستور زیر یک نگاهی بندازید: ($typer[title] رو می خوام بگذارم توی این دستور اما پی اچ پی اونو نمی خونه. وقتی این کد رو توی قالب قرار میدم، نمی تونه لینکش کنه و میزنه undefined.)
$typer1 = mysql_query("SELECT * FROM articles ORDER BY date");
$typer = mysql_fetch_assoc($typer1);
<script>
<!--
function correct(){
if (finished){
setTimeout('begin()',3000)
}
return true
}
window.onerror=correct
function begin(){
if (!document.all)
return
if (maxheight==null)
maxheight=temp.offsetHeight
whatsnew.style.height=maxheight
temp.style.display='none'
c=1
finished=true
change()
}
//-->
</script>
<style>
<!--
#whatsnew a{color:730073;text-decoration:none}
#whatsnew, #temp {font-weight:bold; font-family:Arial}
#whatsnew a:hover{color:red}
-->
</style>
<script language=\"javascript1.2\">
<!--
var head=''
var top=0
var maxheight
var finished=false
var tickers=new Array()
tickers[0]='<a href=\"0.htm\">$typer[title]</a>' ==> inja ro manzuram hast bachehaa
for (i=1;i<=tickers.length-1;i++){
if (tickers[i].length>=tickers[top].length)
top=i
}
if (document.all)
document.write('<span id=\"whatsnew\" style=\"width:100%;height=10;filter:revealTrans(du ration=2,transition=19)\">'+tickers[0]+'</span>')
function change(){
whatsnew.innerHTML=''
whatsnew.filters.revealTrans.apply()
whatsnew.filters.revealTrans.play()
whatsnew.innerHTML=tickers[c]
if (c==tickers.length-1)
c=0
else
c+=1
setTimeout('change()',5000)
}
if (document.all)
document.write('<span id=ns style=\"display:none;\">')
//-->
</script>
<!--Insert alternate HTML codes here
that will be seen by browsers OTHER
than IE 4.x-->
</span>
<span id=temp style=\"position:absolute;left:0;top:0\" style=&{head};>
<script>
<!--
if (document.all){
temp.style.width=whatsnew.style.width
document.write(tickers[top])
}
//-->
</script>
</span><br>
خواستم بدونم چطور میشه یک داده رو که از دیتابیس فراخوانی کردیم، بگذاریمش توی یک تگِ script بطوریکه بتونه اون داده رو هم نمایش بده؟
لطفا به دستور زیر یک نگاهی بندازید: ($typer[title] رو می خوام بگذارم توی این دستور اما پی اچ پی اونو نمی خونه. وقتی این کد رو توی قالب قرار میدم، نمی تونه لینکش کنه و میزنه undefined.)
$typer1 = mysql_query("SELECT * FROM articles ORDER BY date");
$typer = mysql_fetch_assoc($typer1);
<script>
<!--
function correct(){
if (finished){
setTimeout('begin()',3000)
}
return true
}
window.onerror=correct
function begin(){
if (!document.all)
return
if (maxheight==null)
maxheight=temp.offsetHeight
whatsnew.style.height=maxheight
temp.style.display='none'
c=1
finished=true
change()
}
//-->
</script>
<style>
<!--
#whatsnew a{color:730073;text-decoration:none}
#whatsnew, #temp {font-weight:bold; font-family:Arial}
#whatsnew a:hover{color:red}
-->
</style>
<script language=\"javascript1.2\">
<!--
var head=''
var top=0
var maxheight
var finished=false
var tickers=new Array()
tickers[0]='<a href=\"0.htm\">$typer[title]</a>' ==> inja ro manzuram hast bachehaa
for (i=1;i<=tickers.length-1;i++){
if (tickers[i].length>=tickers[top].length)
top=i
}
if (document.all)
document.write('<span id=\"whatsnew\" style=\"width:100%;height=10;filter:revealTrans(du ration=2,transition=19)\">'+tickers[0]+'</span>')
function change(){
whatsnew.innerHTML=''
whatsnew.filters.revealTrans.apply()
whatsnew.filters.revealTrans.play()
whatsnew.innerHTML=tickers[c]
if (c==tickers.length-1)
c=0
else
c+=1
setTimeout('change()',5000)
}
if (document.all)
document.write('<span id=ns style=\"display:none;\">')
//-->
</script>
<!--Insert alternate HTML codes here
that will be seen by browsers OTHER
than IE 4.x-->
</span>
<span id=temp style=\"position:absolute;left:0;top:0\" style=&{head};>
<script>
<!--
if (document.all){
temp.style.width=whatsnew.style.width
document.write(tickers[top])
}
//-->
</script>
</span><br>