Jump to content
xisto Community

dvayne

Members
  • Content Count

    11
  • Joined

  • Last visited

  1. I have a Viewsonic E70f Monitor and the "Brightness" level box keeps popping up. I can hit the menu button and it goes off, or if we're not at the computer, it goes off itself. Any idea what's going on?
  2. thanks whats the difference between your code with this code? <?php$step = 0;$integer = intval($_GET['integer']);if ($integer < 1) { echo "Please Enter a Positive Integer";} else { echo "Entered Number is: ".$integer."<br />"; while($integer != 1 AND $integer >= 1) { $modulus = $integer%2; if ($modulus == 0) { $integer = $integer/2; echo $integer."<br />"; } else { $integer = $integer*3; $integer = $integer+1; echo $integer."<br />"; $integer = $integer/2; echo $integer."<br />"; } $step++; }}echo "Total step: ".$step;?>
  3. Write a php script that will accept a positive integer, if it is even, divide it by 2 and if it is odd, multiply it by 3 and add 1. Repeat the process until the value is 1, printing out each value. Finally print out how many of these operations you performed. If the input value is less than 1, print error and perform an exit(); For example: Initial value: 9 Next value: 28 Next value: 14 Next value: 7 Next value: 22 Next value: 11 Next value: 34 Next value: 17 Next value: 52 Next value: 26 Next value: 13 Next value: 40 Next value: 20 Next value: 10 Next value: 5 Next value: 16 Next value: 8 Next value: 4 Next value:2 Final value:1 Number of steps: 19 Could you please modify this code? <?php$integer = intval($_GET['integer']);if ($integer < 1) { echo "Please Enter a Positive Integer";} else { echo "Entered Number is: ".$integer."<br />"; while($integer != 1 AND $integer >= 1) { $modulus = $integer%2; if ($modulus == 0) { $integer = $integer/2; echo $integer."<br />"; } else { $integer = $integer*3; $integer = $integer+1; echo $integer."<br />"; $integer = $integer/2;; echo $integer."<br />"; } }}?> Any help would be appreciated.
  4. Create a PHP program with the followingrequirements Create a program that does the following: creates a variable called “test” (remember the dollar sign) stores the number 35 to test and prints the result adds 10.0000 to test and prints the result subtracts 5.123123 from test and prints it out stores the character string “happy to be here” to test andprints adds 10.0000 to the variable test (try to guess what willhappen)whats the solution to this problem? any help would be appreciated.
  5. where will I put $rowsperpage=5; ? before include("config/config.inc.php"); ?
  6. how to display 10 messages per page? <?php include("config/config.inc.php"); include("config/dbcon.php"); include("checksession.php"); if(isset($_POST['action'])){ $gname = $_POST['gname']; $gemail = $_POST['mail']; $gmsg = $_POST['gmsg']; $date = date("m.d.y");$sql = "insert into tblguestbook ";$sql .= "(guestname, guestemail, guestmessage, guestdate)";$sql .=" values('$gname','$gemail','$gmsg','$date')"; mysql_query($sql); }?><html><head><title>My Guestbook</title><link href="styles/style.css" rel="stylesheet" /><script language="javascript" src="includes/validate.js"></script><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css"><!--body { background-color: #000000;}--></style></head><body><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="17%"> </td> <td width="83%" valign="bottom" > </td> </tr></table><form name = "form1" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" onSubmit="return validateForm(form1)"> <p class="fontSubTitle">Sign to Guestbook</p> <p class="fontSubTitle"><span class="fontText">Name: </span> <input type="text" name="gname"> <br> <span class="fontText">Email:</span> <input name="mail" type="text" id="mail"> <br> <span class="fontText">Message:</span> <textarea cols="35" rows="6" name="gmsg"></textarea> </p> <p class="fontSubTitle"> <input type="submit" value="Send" name="action"> <input name="reset" type="reset" value="Clear"> <br> </p></form> <p> <?php $results = mysql_query("select * from tblguestbook order by guestid desc"); while($data = mysql_fetch_object($results)){ echo "<table width=\"500\" border=\"0\" cellpadding=\"5\" cellspacing=\"1\" class=\"borderThin\" >";echo " <tr>\n";echo "<td class=\"fontTextTwo\" align=\"left\" width=\"60%\">name: ";echo "<a href=\"mailto:".$data->guestemail."\" class=\"b\">".$data->guestname."</a>";echo "</td>\n"; echo "<td class=\"fontTextTwo\" align=\"right\" width=\"40%\">dated posted: ".$data->guestdate."</td>\n";echo " </tr>\n"; echo "<tr>\n"; echo " <td colspan=\"2\" class=\"fontText\" align=\"left\">".$data->guestmessage."</td>\n";echo " </tr>\n";echo "</table><br>"; } ?></p></body></html><?php mysql_close($dbh);?>any help would be appreciated
  7. how to make sure they did not leave any required fields blank? <?php include("config/config.inc.php"); include("config/dbcon.php"); include("checksession.php"); if(isset($_POST['action'])){ $gname = $_POST['gname']; $gemail = $_POST['mail']; $gmsg = $_POST['gmsg']; $date = date("m.d.y");$sql = "insert into tblguestbook ";$sql .= "(guestname, guestemail, guestmessage, guestdate)";$sql .=" values('$gname','$gemail','$gmsg','$date')"; mysql_query($sql); }?><html><head><title>My Guestbook</title><link href="styles/style.css" rel="stylesheet" /><script language="javascript" src="includes/validate.js"></script><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css"><!--body { background-color: #000000;}--></style></head><body><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="17%"> </td> <td width="83%" valign="bottom" > </td> </tr></table><form name = "form1" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" onSubmit="return validateForm(form1)"> <p class="fontSubTitle">Sign to Guestbook</p> <p class="fontSubTitle"><span class="fontText">Name: </span> <input type="text" name="gname"> <br> <span class="fontText">Email:</span> <input name="mail" type="text" id="mail"> <br> <span class="fontText">Message:</span> <textarea cols="35" rows="6" name="gmsg"></textarea> </p> <p class="fontSubTitle"> <input type="submit" value="Send" name="action"> <input name="reset" type="reset" value="Clear"> <br> </p></form> <p> <?php $results = mysql_query("select * from tblguestbook order by guestid desc"); while($data = mysql_fetch_object($results)){ echo "<table width=\"500\" border=\"0\" cellpadding=\"5\" cellspacing=\"1\" class=\"borderThin\" >";echo " <tr>\n";echo "<td class=\"fontTextTwo\" align=\"left\" width=\"60%\">name: ";echo "<a href=\"mailto:".$data->guestemail."\" class=\"b\">".$data->guestname."</a>";echo "</td>\n"; echo "<td class=\"fontTextTwo\" align=\"right\" width=\"40%\">dated posted: ".$data->guestdate."</td>\n";echo " </tr>\n"; echo "<tr>\n"; echo " <td colspan=\"2\" class=\"fontText\" align=\"left\">".$data->guestmessage."</td>\n";echo " </tr>\n";echo "</table><br>"; } ?></p></body></html><?php mysql_close($dbh);?>any help would be appreciated.
  8. how to display date and time (gmt+8)? any help would be appreciated.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.