Jump to content

ma5ect

Members
  • Posts

    57
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ma5ect's Achievements

Member

Member (2/5)

0

Reputation

  1. I want the two fields data to be displayed with one check box...
  2. HI all, I have assigned a value to a check box but is it possible to have 2 values for one check box and then later display both values.. <input name="modulename[]" type="checkbox" value="<?php echo $row_Recordset2['Module name']; ?>" /> <input type="checkbox" value="<?php echo $row_Recordset2['Scheduled']; ?>" name="modulename[]6" />
  3. Hi all, I have a form and few check boxes, when the user selects the choices i want the result to be displayed in a table..i have the follwing code but the text just appears in a list.. <table width="200" border="5" cellspacing="2" cellpadding="5"> <tr> <th scope="row"><div align="center"><strong>Days</strong></div></th> <td><div align="center"><strong>Time</strong></div></td> </tr> <tr> <th scope="row"><? } else { foreach($modulename as $f) { echo $f."<br />"; } }echo $schedule."<br />"; ?></th> <td> </td> </tr> </table>
  4. ah yes just realised.. genius.. much appreciated
  5. i prefer not to use sessions...the alter of the of statement still outputs the same result.. <?php if (isset($_POST['submit'])) { // Define your username and password $post_username = $_POST['txtUsername']; $post_password = $_POST['txtPassword']; $username = "test"; $password = "admin"; if ($post_username == $username && $post_password == $password) { header("Location: welcome.php"); } else { header("Location: error.php"); } } //If the user hasn't pressed the submit button then display the form ?> <h1>Login</h1> <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <p><label for="txtUsername">Username:</label> <br /><input type="text" title="Enter your Username" name="txtUsername" /></p> <p><label for="txtpassword">Password:</label> <br /><input type="password" title="Enter your password" name="txtPassword" /></p> <p><input type="submit" name="Submit" value="Login" /></p> </form>
  6. sorry folks, the code enters the username and password but does not send the user to the output pages...keeps displaying the login page <?php if (isset($_POST['submit'])) { // Define your username and password $post_username = $_POST['txtUsername']; $post_password = $_POST['txtPassword']; $username = "test"; $password = "test"; if ($post_username == $username || $post_password == $password) { header("Location: mainlogin.php"); } else { header("Location: mainlogin.php"); } } //If the user hasn't pressed the submit button then display the form ?> <h1>Login</h1> <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <p><label for="txtUsername">Username:</label> <br /><input type="text" title="Enter your Username" name="txtUsername" /></p> <p><label for="txtpassword">Password:</label> <br /><input type="password" title="Enter your password" name="txtPassword" /></p> <p><input type="submit" name="Submit" value="Login" /></p> </form>
  7. Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\test.php on line 4
  8. i get the follwoing error messge: Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\test.php:12) in C:\xampp\htdocs\test.php on line 33 code: <?php // Define your username and password $username = "someuser"; $password = "somepassword"; if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) { ?> <h1>Login</h1> <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <p><label for="txtUsername">Username:</label> <br /><input type="text" title="Enter your Username" name="txtUsername" /></p> <p><label for="txtpassword">Password:</label> <br /><input type="password" title="Enter your password" name="txtPassword" /></p> <p><input type="submit" name="Submit" value="Login" /></p> </form> <?php } else { ?> <?php }header('Location: test.php'); ?>
  9. Hi all, I have the following code..the username and password works fine but i want the script to go to another webpage if the username and password is enetered correctly. how do i code the if statement?? <?php $username = "someuser"; $password = "somepassword"; if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) { ?> <h1>Login</h1> <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <p><label for="txtUsername">Username:</label> <br /><input type="text" title="Enter your Username" name="txtUsername" /></p> <p><label for="txtpassword">Password:</label> <br /><input type="password" title="Enter your password" name="txtPassword" /></p> <p><input type="submit" name="Submit" value="Login" /></p> </form> <?php } else { ?> <p>This is the protected page. Your private content goes here.</p> <?php } ?>
  10. created with repeat region <form name="orderform" action="confirm-order.php" method="post"> <table width="757" border="3" align="center"> <tr> <td width="133"><div align="center" class="style12"> <div align="center">Module Name</div> </div></td> <td width="106"><div align="center" class="style12"> <div align="center">Module ID</div> </div></td> <td width="104"><div align="center" class="style12"> <div align="center">Credits</div> </div></td> <td width="117"><div align="center" class="style12"> <div align="center">Completed</div> </div></td> <td width="110"><div align="center" class="style12"> <div align="center">Attempts</div> </div></td> <td width="100"><div align="center" class="style12"> <div align="center">Level</div> </div></td> <td width="37"><div align="center">Select</div></td> </tr> <?php do { ?> <tr> <td height="22"><span class="style13"><?php echo $row_Recordset2['Module name']; ?></span></td> <td><div align="center" class="style14"><?php echo $row_Recordset2['Module ID']; ?></div></td> <td><div align="center" class="style14"><?php echo $row_Recordset2['credits']; ?></div></td> <td><div align="center" class="style14"><?php echo $row_Recordset2['Completed']; ?></div></td> <td><div align="center" class="style14"><?php echo $row_Recordset2['Attempts']; ?></div></td> <td><div align="center" class="style14"><?php echo $row_Recordset2['Level']; ?></div></td> <td><div align="center"> <input name="module" type="checkbox" id="module" value="<?php echo $row_Recordset2['Module name']; ?>" /> </div></td> </tr> <?php } while ($row_Recordset2 = mysql_fetch_assoc($Recordset2)); ?> </table> <p align="center"> <input type=submit value="Submit" /> </form>
  11. the table is created with repeat so i cannot define individual checkboxes. when i run the webpage in the table i get the list of data from database and next to it a check box for each so the user can select
  12. the display page just appears blank, i am using <?php $module = $_POST['module']; ?> on this page
  13. the data field does not display onto the output page..its not hidden fields, just the check box value i want displaying
  14. hi all. I have a table on my webpage, i want the user to select a check box which is assigned to a field on the table and once the user submits the form, i want that check box data to be displayed on another page... i have got the form with the check box and data field assigned but dont know how i can get it to display onto the next page.. form page code: <form name=orderform action="confirm-order.php"> <table width="648" border="3" align="center"> <tr> <td width="209"><div align="center" class="style12"> <div align="center">Module name</div> </div></td> <td width="120"><div align="center" class="style12"> <div align="center">Module ID</div> </div></td> <td width="158"><div align="center" class="style12"> <div align="center">Credits</div> </div></td> <td width="117"><div align="center" class="style12"> <div align="center">Completed</div> </div></td> <td width="61"><div align="center"></div></td> </tr> <?php do { ?> <tr> <td height="22"><span class="style9"><?php echo $row_Recordset2['Module name']; ?></span></td> <td><div align="center"><?php echo $row_Recordset2['Module ID']; ?></div></td> <td><div align="center"><?php echo $row_Recordset2['credits']; ?></div></td> <td><div align="center"><?php echo $row_Recordset2['Completed']; ?></div></td> <td><input name="module" type="checkbox" id="module" value="<?php echo $row_Recordset2['Module name']; ?>" /></td> </tr> <?php } while ($row_Recordset2 = mysql_fetch_assoc($Recordset2)); ?> </table> <p align="center"> <input type=submit value="Order" /> </form>
  15. HI all. Is it possible to connect sql database to infopath 2007.. i have created the database using xaamp. anybody know any tutorials if it's possible regards
×
×
  • Create New...

Important Information

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.