PHP - While and echo on HTML Div -
i have problem :
i have 2 php files > index.php , control.php.
inside control.php variable called "$controlnumber"
, has default value on 10 , variable called "$name"
inside index.php have while condition ($controlnumber < 10)
, each time it's executed , $controlnumber
increased 1.
the end of code made div name of "$name"
, doesn't work.
i execute code way href link :
<?php if ($_get['run_func'] == 'yes') { include "control.php"; $controlnumber--; } else { echo '<a href="?run_func=yes">press here 2 add player</a>'; } ?>
code inside while :
<?php include "control.php"; while($controlnumber < 10) { $controlnumber++; echo '<div id="linea1" style="background-color#751313; color:white; font- size:150%;";>' . $name .'</div>'; $name = "used"; } ?>
code of "control.php"
<?php $controlnumber; $controlnumber = 10; $name = "john"; ?>
i try lot of different options when writing code , "text/echo"
doesn't work or appears.
this not work because of var $controlnumber = 10
, while
condition run if var less 10
try declare var $controlnumber = 0
may work ^^
Comments
Post a Comment