473,385 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help understanding a script

I was wondering if anyone can help explain this code for me

[CODE
]<table width="<?= $TABLE_WIDTH ?>" border="0" cellspacing="0" cellpadding="0">
<?php
for ($x=1; $x<=pow(2, $COLUMNS); $x++) {
// open the row
printf('<tr>');

// draw each of the columns in this row...
for ($y=1; $y<=$COLUMNS; $y++) {

// begin with a default style
$style = "line";
$value = "";

// Determine the content for the data cells (if there is any) and
// add the underline style always
if (($x % pow(2, $y)) == pow(2, $y-1)) {
[/code]
From what I try to understand this code

Expand|Select|Wrap|Line Numbers
  1. if (($x % pow(2, $y)) == pow(2, $y-1)) {
  2.  
would be a smaller number divided by a larger number and would give the remainder. I have tried a smaller number divided by a larger number in a simple script, but the remainder always seems to equal the smaller number.

[code]
<?php
$a=6;
$b=11;
$c=$a%$b;

echo "$a % $b = $c";

?>
Mar 20 '06 #1
7 1411
Message-ID: <q9mTf.1326$3t1.818@trndny08> from <ne****@php.world>
contained the following:
would be a smaller number divided by a larger number and would give the remainder. I have tried a smaller number divided by a larger number in a simple script, but the remainder always seems to equal the smaller number.


well...yeah.

six divided by eleven = zero, remainder six

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Mar 20 '06 #2
ME
Interesting. Back when I was taught this in school you would skip the units
and put a decimal and move to the tenths and change six to sixty, thereby
never knowing this. Any whoo still dont understand script.
Mar 20 '06 #3
Message-ID: <5FmTf.1327$3t1.1243@trndny08> from ME@newbie.com contained
the following:
Interesting. Back when I was taught this in school you would skip the units
and put a decimal and move to the tenths and change six to sixty, thereby
never knowing this. Any whoo still dont understand script.


What is it supposed to do?
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Mar 20 '06 #4
Geoff Berrow wrote:
Message-ID: <5FmTf.1327$3t1.1243@trndny08> from ME@newbie.com contained
the following:
Interesting. Back when I was taught this in school you would skip the units
and put a decimal and move to the tenths and change six to sixty, thereby
never knowing this. Any whoo still dont understand script.


What is it supposed to do?
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/


I can't figure out what it's supposed to do. Do you have more code?
There is definitely a regular relationship as the code below shows.
But what is that relationship used for?
<?php
echo '<table border="1" cellspacing="5" cellpadding="5">';
echo '<tr><th>$x</th><th>$y</th><th>$x % pow(2, $y)</th><th>pow(2,
$y-1)</th>';
echo
'<th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th>';
echo '<th>8</th><th>9</th><th>10</th></tr>';
for ($x=1; $x<=pow(2, 10); $x++) {
for ($y=1; $y<=10; $y++) {

$xcmp = $x % pow(2, $y);
$ycmp = pow(2, $y-1);
if ($xcmp == $ycmp) {
echo "<tr><td>$x</td><td>$y</td><td
align=\"center\">".$xcmp."</td>";
echo "<td align=\"center\">".$ycmp."</td>";
for ($i=1; $i<=10; $i++){
if ($i == $ycmp) echo "<td>X</td>";
else echo "<td>&nbsp</td>";
}
echo "</tr>";
}
}
}
echo '</table>';
?>

Mar 20 '06 #5
On Sun, 19 Mar 2006 23:52:54 +0000, newbie wrote:
I was wondering if anyone can help explain this code for me

Expand|Select|Wrap|Line Numbers
  1.   <table width="<?= $TABLE_WIDTH ?>" border="0" cellspacing="0"
  2.          cellpadding="0">
  3.  <?php
  4.  for ($x=1; $x<=pow(2, $COLUMNS); $x++) {
  5.      // open the row
  6.      printf('<tr>');
  7.      // draw each of the columns in this row...
  8.      for ($y=1; $y<=$COLUMNS; $y++) {
  9.          // begin with a default style
  10.          $style = "line";
  11.          $value = "";
  12.          // Determine the content for the data cells (if there is any)
  13.          // and add the underline style always
  14.          if (($x % pow(2, $y)) ==  pow(2, $y-1)) {
  15.  

From what I try to understand this code

Expand|Select|Wrap|Line Numbers
  1.   if (($x % pow(2, $y)) == pow(2, $y-1)) {
  2.   

would be a smaller number divided by a larger number and would give the
remainder. I have tried a smaller number divided by a larger number in a
simple script, but the remainder always seems to equal the smaller
number.


Not always. $x is often bigger than pow(2, $y). It looks like code you'd
use to layout the draw in an N-round knockout tournament (N == $COLUMNS):

The cells selected by that test alternate in the first column, are one in
four of the second, one in eight in the third and so on... All lined up
so no row has more than one selected cell. It is quite clever but it
could do with a comment or two, though!

What is it actually for?

--
Ben.
Mar 20 '06 #6
ME
Yes it is for a round knockout tournament, it uses a ini file for data. I
want to convert the script to be used in a database for a site. Here is the
rest of the code. I found it on the internet, the guys was giving the code
for people to download for free. The top part ot the code above the php code
is actually the ini file that was name .txt that i switch to .php thinking i
could use it for variable and getting info from the db, which i have found I
can't, and need to recode everything but the math.

Expand|Select|Wrap|Line Numbers
  1. ________________________________________________________________________________________________________________
  2.  
  3. [bracket]
  4. columns = 5;
  5. column_width = 120;
  6. title = "Your Title Here";
  7.  
  8. [column7]
  9. 1 = ""
  10. 2 = ""
  11. 3 = ""
  12. 4 = ""
  13. 5 = ""
  14. 6 = ""
  15. 7 = ""
  16. 8 = ""
  17. 9 = ""
  18. 10 = ""
  19. 11 = ""
  20. 12 = ""
  21. 13 = ""
  22. 14 = ""
  23. 15 = ""
  24. 16 = ""
  25. 17 = ""
  26. 18 = ""
  27. 19 = ""
  28. 20 = ""
  29. 21 = ""
  30. 22 = ""
  31. 23 = ""
  32. 24 = ""
  33. 25 = ""
  34. 26 = ""
  35. 27 = ""
  36. 28 = ""
  37. 29 = ""
  38. 30 = ""
  39. 31 = ""
  40. 32 = ""
  41. 33 = ""
  42. 34 = ""
  43. 35 = ""
  44. 36 = ""
  45. 37 = ""
  46. 38 = ""
  47. 39 = ""
  48. 40 = ""
  49. 41 = ""
  50. 42 = ""
  51. 43 = ""
  52. 44 = ""
  53. 45 = ""
  54. 46 = ""
  55. 47 = ""
  56. 48 = ""
  57. 49 = ""
  58. 50 = ""
  59. 51 = ""
  60. 52 = ""
  61. 53 = ""
  62. 54 = ""
  63. 55 = ""
  64. 56 = ""
  65. 57 = ""
  66. 58 = ""
  67. 59 = ""
  68. 60 = ""
  69. 61 = ""
  70. 62 = ""
  71. 63 = ""
  72. 64 = ""
  73.  
  74. [column6]
  75. 1 = ""
  76. 2 = ""
  77. 3 = ""
  78. 4 = ""
  79. 5 = ""
  80. 6 = ""
  81. 7 = ""
  82. 8 = ""
  83. 9 = ""
  84. 10 = ""
  85. 11 = ""
  86. 12 = ""
  87. 13 = ""
  88. 14 = ""
  89. 15 = ""
  90. 16 = ""
  91. 17 = ""
  92. 18 = ""
  93. 19 = ""
  94. 20 = ""
  95. 21 = ""
  96. 22 = ""
  97. 23 = ""
  98. 24 = ""
  99. 25 = ""
  100. 26 = ""
  101. 27 = ""
  102. 28 = ""
  103. 29 = ""
  104. 30 = ""
  105. 31 = ""
  106. 32 = ""
  107.  
  108. [column5]
  109. 1 = "team name between quotes"
  110. 2 = ""
  111. 3 = ""
  112. 4 = ""
  113. 5 = ""
  114. 6 = ""
  115. 7 = ""
  116. 8 = ""
  117. 9 = ""
  118. 10 = ""
  119. 11 = ""
  120. 12 = ""
  121. 13 = ""
  122. 14 = ""
  123. 15 = ""
  124. 16 = ""
  125.  
  126. [column4]
  127. 1 = ""
  128. 2 = ""
  129. 3 = ""
  130. 4 = ""
  131. 5 = ""
  132. 6 = ""
  133. 7 = ""
  134. 8 = ""
  135.  
  136. [column3]
  137. 1 = ""
  138. 2 = ""
  139. 3 = ""
  140. 4 = ""
  141.  
  142. [column2]
  143. 1 = ""
  144. 2 = ""
  145.  
  146. [column1]
  147. 1 = "<i>Champion</i>"
  148.  
  149.  
  150.  
  151. ________________________________________________________________________________________________________________
  152.  
  153.  
  154. <?php
  155. //----------------------------------------------------------------------
  156. $DATA         = parse_ini_file("data_sheet.php", true);
  157. $COLUMNS      = $DATA["bracket"]["columns"];
  158. $COLUMN_WIDTH = $DATA["bracket"]["column_width"];
  159. $TABLE_WIDTH  = $COLUMN_WIDTH * $COLUMNS;
  160. //----------------------------------------------------------------------
  161. ?>
  162. <html>
  163. <head>
  164. <title><?= htmlspecialchars($DATA["bracket"]["title"]); ?></title>
  165. <style type="text/css">
  166. P {
  167. font-family : Arial, Helvetica, sans-serif;
  168. font-size : 11px;
  169. font-weight : normal;
  170. color : Black;
  171. }
  172. EM {
  173. font-family : Arial, Helvetica, sans-serif;
  174. font-size : 11px;
  175. font-weight : normal;
  176. color : #CC0000;
  177. }
  178. A {
  179. font-family : Arial, Helvetica, sans-serif;
  180. font-size : 11px;
  181. font-weight : normal;
  182. color : Blue;
  183. }
  184. .line {
  185. font-family : Arial, Helvetica, sans-serif;
  186. font-size : 11px;
  187. font-weight : normal;
  188. padding : 1px 3px 1px 3px;
  189.  
  190. }
  191. .line-right {
  192. font-family : Arial, Helvetica, sans-serif;
  193. font-size : 11px;
  194. font-weight : normal;
  195. padding : 1px 3px 1px 3px;
  196. border-right : 1px solid Red;
  197. }
  198. .line-under {
  199. font-family : Arial, Helvetica, sans-serif;
  200. font-size : 11px;
  201. font-weight : normal;
  202. padding : 1px 3px 1px 3px;
  203. border-bottom : 1px solid Green;
  204. }
  205. .line-under-right {
  206. font-family : Arial, Helvetica, sans-serif;
  207. font-size : 11px;
  208. font-weight : normal;
  209. padding : 1px 3px 1px 3px;
  210. border-bottom : 1px solid Blue;
  211. border-right : 1px solid Grey;
  212. }
  213. .right {
  214. font-family : Arial, Helvetica, sans-serif;
  215. font-size : 11px;
  216. font-weight : bold;
  217. color : Green;
  218. }
  219. .wrong {
  220. font-family : Arial, Helvetica, sans-serif;
  221. font-size : 11px;
  222. font-weight : bold;
  223. color : Red;
  224. }
  225. </style>
  226. </head>
  227.  
  228. <body bgcolor="blue" leftmargin="20" topmargin="20" rightmargin="20"
  229. bottommargin="20" marginwidth="20">
  230. <div align="center">
  231. <table width="700" border="0" cellspacing="0" cellpadding="20"
  232. bgcolor="gray">
  233. <tr>
  234. <td align="center" valign="top">
  235. <p>
  236.  
  237. <h1 style="font-family: Arial, Helvetica, sans-serif;">
  238. <?= htmlspecialchars($DATA["bracket"]["title"]); ?>
  239. </h1>
  240.  
  241. <table width="<?= $TABLE_WIDTH ?>" border="0" cellspacing="0"
  242. cellpadding="0">
  243. <?php
  244. for ($x=1; $x<=pow(2, $COLUMNS); $x++) {
  245. // open the row
  246. printf('<tr>');
  247.  
  248. // draw each of the columns in this row...
  249. for ($y=1; $y<=$COLUMNS; $y++) {
  250.  
  251. // begin with a default style
  252. $style = "line";
  253. $value = "";
  254.  
  255. // Determine the content for the data cells (if there is any) and
  256. // add the underline style always
  257. if (($x % pow(2, $y)) == pow(2, $y-1)) {
  258. $round    = "column" . ($COLUMNS - $y +1);
  259. $posit    = ceil($x/pow(2, $y));
  260. $data    = (isset($DATA[$round][$posit])) ?
  261. trim($DATA[$round][$posit]) : '';
  262. $parts    = split("\|", $data);
  263. $value    = array_shift($parts);
  264. $value    = sprintf($value);
  265. $style .= "-under";
  266. }
  267.  
  268. // Add the right bar line for cells that need it...
  269. if ($y != $COLUMNS) {
  270. if ((($x + pow(2, $y-1) - 1) % pow(2, $y+1)) >= pow(2, $y)) {
  271. $style .= "-right";
  272. }
  273. }
  274.  
  275. // make sure we don't print empty content
  276. if (empty($value)) {
  277. $value = "&nbsp;";
  278. }
  279.  
  280. // draw this cell
  281. printf('<td width="%d" class="%s">%s</td>',
  282. $COLUMN_WIDTH, $style, $value);
  283. print("\n");
  284. }
  285.  
  286. // close the row
  287. printf("</tr>\n");
  288. }
  289. ?>
  290. </table>
  291. </p>
  292.  
  293. <p align="left">
  294. ****NOTE****<br>
  295. </p>
  296. </td>
  297. </tr>
  298. </table>
  299.  
  300. </div>
  301.  
  302.  
  303. </body>
  304. </html>
  305.  
Any help with converting code to be used with a db would be greatly
appreciated.
Mar 20 '06 #7
Yes it is for a round knockout tournament, it uses a ini file for data. I
want to convert the script to be used in a database for a site. Here is the
rest of the code. I found it on the internet, the guys was giving the code
for people to download for free. The top part ot the code above the php code
is actually the ini file that was name .txt that i switch to .php thinking i
could use it for variable and getting info from the db, which i have found I
can't, and need to recode everything but the math.

Expand|Select|Wrap|Line Numbers
  1. ________________________________________________________________________________________________________________
  2.  
  3. [bracket]
  4. columns = 5;
  5. column_width = 120;
  6. title = "Your Title Here";
  7.  
  8. [column7]
  9. 1 = ""
  10. 2 = ""
  11. 3 = ""
  12. 4 = ""
  13. 5 = ""
  14. 6 = ""
  15. 7 = ""
  16. 8 = ""
  17. 9 = ""
  18. 10 = ""
  19. 11 = ""
  20. 12 = ""
  21. 13 = ""
  22. 14 = ""
  23. 15 = ""
  24. 16 = ""
  25. 17 = ""
  26. 18 = ""
  27. 19 = ""
  28. 20 = ""
  29. 21 = ""
  30. 22 = ""
  31. 23 = ""
  32. 24 = ""
  33. 25 = ""
  34. 26 = ""
  35. 27 = ""
  36. 28 = ""
  37. 29 = ""
  38. 30 = ""
  39. 31 = ""
  40. 32 = ""
  41. 33 = ""
  42. 34 = ""
  43. 35 = ""
  44. 36 = ""
  45. 37 = ""
  46. 38 = ""
  47. 39 = ""
  48. 40 = ""
  49. 41 = ""
  50. 42 = ""
  51. 43 = ""
  52. 44 = ""
  53. 45 = ""
  54. 46 = ""
  55. 47 = ""
  56. 48 = ""
  57. 49 = ""
  58. 50 = ""
  59. 51 = ""
  60. 52 = ""
  61. 53 = ""
  62. 54 = ""
  63. 55 = ""
  64. 56 = ""
  65. 57 = ""
  66. 58 = ""
  67. 59 = ""
  68. 60 = ""
  69. 61 = ""
  70. 62 = ""
  71. 63 = ""
  72. 64 = ""
  73.  
  74. [column6]
  75. 1 = ""
  76. 2 = ""
  77. 3 = ""
  78. 4 = ""
  79. 5 = ""
  80. 6 = ""
  81. 7 = ""
  82. 8 = ""
  83. 9 = ""
  84. 10 = ""
  85. 11 = ""
  86. 12 = ""
  87. 13 = ""
  88. 14 = ""
  89. 15 = ""
  90. 16 = ""
  91. 17 = ""
  92. 18 = ""
  93. 19 = ""
  94. 20 = ""
  95. 21 = ""
  96. 22 = ""
  97. 23 = ""
  98. 24 = ""
  99. 25 = ""
  100. 26 = ""
  101. 27 = ""
  102. 28 = ""
  103. 29 = ""
  104. 30 = ""
  105. 31 = ""
  106. 32 = ""
  107.  
  108. [column5]
  109. 1 = "team name between quotes"
  110. 2 = ""
  111. 3 = ""
  112. 4 = ""
  113. 5 = ""
  114. 6 = ""
  115. 7 = ""
  116. 8 = ""
  117. 9 = ""
  118. 10 = ""
  119. 11 = ""
  120. 12 = ""
  121. 13 = ""
  122. 14 = ""
  123. 15 = ""
  124. 16 = ""
  125.  
  126. [column4]
  127. 1 = ""
  128. 2 = ""
  129. 3 = ""
  130. 4 = ""
  131. 5 = ""
  132. 6 = ""
  133. 7 = ""
  134. 8 = ""
  135.  
  136. [column3]
  137. 1 = ""
  138. 2 = ""
  139. 3 = ""
  140. 4 = ""
  141.  
  142. [column2]
  143. 1 = ""
  144. 2 = ""
  145.  
  146. [column1]
  147. 1 = "<i>Champion</i>"
  148.  
  149.  
  150.  
  151. ________________________________________________________________________________________________________________
  152.  
  153.  
  154. <?php
  155. //----------------------------------------------------------------------
  156. $DATA         = parse_ini_file("data_sheet.php", true);
  157. $COLUMNS      = $DATA["bracket"]["columns"];
  158. $COLUMN_WIDTH = $DATA["bracket"]["column_width"];
  159. $TABLE_WIDTH  = $COLUMN_WIDTH * $COLUMNS;
  160. //----------------------------------------------------------------------
  161. ?>
  162. <html>
  163. <head>
  164. <title><?= htmlspecialchars($DATA["bracket"]["title"]); ?></title>
  165. <style type="text/css">
  166. P {
  167. font-family : Arial, Helvetica, sans-serif;
  168. font-size : 11px;
  169. font-weight : normal;
  170. color : Black;
  171. }
  172. EM {
  173. font-family : Arial, Helvetica, sans-serif;
  174. font-size : 11px;
  175. font-weight : normal;
  176. color : #CC0000;
  177. }
  178. A {
  179. font-family : Arial, Helvetica, sans-serif;
  180. font-size : 11px;
  181. font-weight : normal;
  182. color : Blue;
  183. }
  184. .line {
  185. font-family : Arial, Helvetica, sans-serif;
  186. font-size : 11px;
  187. font-weight : normal;
  188. padding : 1px 3px 1px 3px;
  189.  
  190. }
  191. .line-right {
  192. font-family : Arial, Helvetica, sans-serif;
  193. font-size : 11px;
  194. font-weight : normal;
  195. padding : 1px 3px 1px 3px;
  196. border-right : 1px solid Red;
  197. }
  198. .line-under {
  199. font-family : Arial, Helvetica, sans-serif;
  200. font-size : 11px;
  201. font-weight : normal;
  202. padding : 1px 3px 1px 3px;
  203. border-bottom : 1px solid Green;
  204. }
  205. .line-under-right {
  206. font-family : Arial, Helvetica, sans-serif;
  207. font-size : 11px;
  208. font-weight : normal;
  209. padding : 1px 3px 1px 3px;
  210. border-bottom : 1px solid Blue;
  211. border-right : 1px solid Grey;
  212. }
  213. .right {
  214. font-family : Arial, Helvetica, sans-serif;
  215. font-size : 11px;
  216. font-weight : bold;
  217. color : Green;
  218. }
  219. .wrong {
  220. font-family : Arial, Helvetica, sans-serif;
  221. font-size : 11px;
  222. font-weight : bold;
  223. color : Red;
  224. }
  225. </style>
  226. </head>
  227.  
  228. <body bgcolor="blue" leftmargin="20" topmargin="20" rightmargin="20"
  229. bottommargin="20" marginwidth="20">
  230. <div align="center">
  231. <table width="700" border="0" cellspacing="0" cellpadding="20"
  232. bgcolor="gray">
  233. <tr>
  234. <td align="center" valign="top">
  235. <p>
  236.  
  237. <h1 style="font-family: Arial, Helvetica, sans-serif;">
  238. <?= htmlspecialchars($DATA["bracket"]["title"]); ?>
  239. </h1>
  240.  
  241. <table width="<?= $TABLE_WIDTH ?>" border="0" cellspacing="0"
  242. cellpadding="0">
  243. <?php
  244. for ($x=1; $x<=pow(2, $COLUMNS); $x++) {
  245. // open the row
  246. printf('<tr>');
  247.  
  248. // draw each of the columns in this row...
  249. for ($y=1; $y<=$COLUMNS; $y++) {
  250.  
  251. // begin with a default style
  252. $style = "line";
  253. $value = "";
  254.  
  255. // Determine the content for the data cells (if there is any) and
  256. // add the underline style always
  257. if (($x % pow(2, $y)) == pow(2, $y-1)) {
  258. $round    = "column" . ($COLUMNS - $y +1);
  259. $posit    = ceil($x/pow(2, $y));
  260. $data    = (isset($DATA[$round][$posit])) ?
  261. trim($DATA[$round][$posit]) : '';
  262. $parts    = split("\|", $data);
  263. $value    = array_shift($parts);
  264. $value    = sprintf($value);
  265. $style .= "-under";
  266. }
  267.  
  268. // Add the right bar line for cells that need it...
  269. if ($y != $COLUMNS) {
  270. if ((($x + pow(2, $y-1) - 1) % pow(2, $y+1)) >= pow(2, $y)) {
  271. $style .= "-right";
  272. }
  273. }
  274.  
  275. // make sure we don't print empty content
  276. if (empty($value)) {
  277. $value = "&nbsp;";
  278. }
  279.  
  280. // draw this cell
  281. printf('<td width="%d" class="%s">%s</td>',
  282. $COLUMN_WIDTH, $style, $value);
  283. print("\n");
  284. }
  285.  
  286. // close the row
  287. printf("</tr>\n");
  288. }
  289. ?>
  290. </table>
  291. </p>
  292.  
  293. <p align="left">
  294. ****NOTE****<br>
  295. </p>
  296. </td>
  297. </tr>
  298. </table>
  299.  
  300. </div>
  301.  
  302.  
  303. </body>
  304. </html>
  305.  
Any help with converting code to be used with a db would be greatly
appreciated.
<ne****@php.world> wrote in message news:q9mTf.1326$3t1.818@trndny08...
I was wondering if anyone can help explain this code for me

[CODE
]<table width="<?= $TABLE_WIDTH ?>" border="0" cellspacing="0"
cellpadding="0">
<?php
for ($x=1; $x<=pow(2, $COLUMNS); $x++) {
// open the row
printf('<tr>');

// draw each of the columns in this row...
for ($y=1; $y<=$COLUMNS; $y++) {

// begin with a default style
$style = "line";
$value = "";

// Determine the content for the data cells (if there is any) and
// add the underline style always
if (($x % pow(2, $y)) == pow(2, $y-1)) {
[/code]
From what I try to understand this code

Expand|Select|Wrap|Line Numbers
  1.  if (($x % pow(2, $y)) == pow(2, $y-1)) {
  2.  

would be a smaller number divided by a larger number and would give the
remainder. I have tried a smaller number divided by a larger number in a
simple script, but the remainder always seems to equal the smaller number.

[code]
<?php
$a=6;
$b=11;
$c=$a%$b;

echo "$a % $b = $c";

?>

Mar 21 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Elmbrook | last post by:
Hi, I've been trying to figure out this javascript code used here (this code is used for supplying browser info to a tracking company): In particular I'm trying to understand this line:...
14
by: StumpY | last post by:
HI, I have set up a page with a form which appends data to a .csv file on my asp server, this is to enable a limited number of users to add news threads to this file, which contains the data in...
4
by: Gequina | last post by:
Something goes wrong in my script. I'm all new to it so i don't know much yet. I have a set of buttons. And when you click on either of them, the background image will change. Only it's not...
17
by: Phil McKraken | last post by:
I am having a problem putting together a shopping cart with the below script. Everything displays fine, adds totals fine, and works perfect EXCEPT if you choose the 9.95 item #5 BY ITSELF the total...
2
by: Polyhedron_12 | last post by:
I am having problems calling functions in general in VB. I keep getting alot of errors. Can anybody help me out with this? I put the error message on the same line that it says it is at. I believe...
1
by: hel | last post by:
Hi I have just adopted a PHP project and need some help understanding DB_DataObject. I've looked around on the web and can't find a simple explanation. Basically, my MySQL database has no...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
2
by: Greg Corradini | last post by:
Hello All, A few weeks ago, I wrote two scripts using mx.ODBC on an Access DB. Among other things, both scripts create new tables, perform a query and then populate the tables with data in a...
4
by: eBob.com | last post by:
I am trying to understand a bit of JavaScript from http://developer.yahoo.com/maps/simple/jspost.html (appended below). I'd appreciate help understanding two things it. The first is the...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.