473,796 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1425
Message-ID: <q9mTf.1326$3t1 .818@trndny08> from <ne****@php.wor ld>
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.wor ld> wrote in message news:q9mTf.1326 $3t1.818@trndny 08...
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
1610
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: EXd=document;EXw?"":EXw="na";EXb?"":EXb="na"; and this one: EXd.write("<img src=\"http://t0.extreme-dm.com","/0.gif?tag=abc&j=y&srw="+EXw+"&srb="+EXb+"& ","l="+escape(EXd.referrer)+"\" height=1 width=1>");//-->
14
5434
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 the following format (date,headline,article); "181003","news title","news article" "171003","older news title","news article" The form adds the data in reverse chronological order with newest at the top of the list. Now I wish to be able to write...
4
5487
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 working. It works when i click on one, but then when i want to click on another, it's not working. What am i doing wrong? thanks in advance
17
2349
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 displayed is $9.94 ! If you add ANYTHING else the total is correct, 9.95 plus whatever you add. That is the only price in these samples that is doing that. All the others display properly. If you change the 9.95 to ANY other number it displays...
2
2408
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 that I am not calling the function correctly. The MyInsertMethod function is the function that comes in the Web Matrix Toolbox <%@ Page Language="VB" %>
1
1492
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 tables. I have a createTable.php script which I believe is a standard script, it runs but tell me "NO TABLES". There is a function in the script called _createTableList() which is looking for tables not finding any (I don't really
0
5577
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 ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
2
1866
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 dictionary that I've uploaded from elsewhere. These scripts have run hundreds of times in the last few weeks with no problems. But recently they continue to bail on the mycursor.execute('An SQL Statement') after the table has been created. I get the...
4
1355
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 following: <script type="text/javascript"> createForms(); </script> I don't understand the "createForms()". I know it must be JavaScript but I have looked in the index of several references and do not find any such entry in their indices. My online...
53
8422
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 language="javascript" type="text/javascript">
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9533
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10461
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9057
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7555
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5447
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4122
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.