ma5ect
Members-
Posts
57 -
Joined
-
Last visited
Never
Everything posted by ma5ect
-
I want the two fields data to be displayed with one check box...
-
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" />
-
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>
-
[SOLVED] go to other page if password is correct
ma5ect replied to ma5ect's topic in PHP Coding Help
ah yes just realised.. genius.. much appreciated -
[SOLVED] go to other page if password is correct
ma5ect replied to ma5ect's topic in PHP Coding Help
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> -
[SOLVED] go to other page if password is correct
ma5ect replied to ma5ect's topic in PHP Coding Help
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> -
[SOLVED] go to other page if password is correct
ma5ect replied to ma5ect's topic in PHP Coding Help
Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\test.php on line 4 -
[SOLVED] go to other page if password is correct
ma5ect replied to ma5ect's topic in PHP Coding Help
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'); ?> -
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 } ?>
-
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>
-
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
-
the display page just appears blank, i am using <?php $module = $_POST['module']; ?> on this page
-
the data field does not display onto the output page..its not hidden fields, just the check box value i want displaying
-
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>
-
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
-
students table... student ID surname forename course year module table(subject)... module ID module name results table.. student ID (FK) module ID (FK) completed attempts in the results table i want to store data of many student who has taken many modules and store there results...
-
Hi all, i am setting up a database using sql to store details for students modules results, i have 3 tables students modules results the issue is i cant understand how to store data in the results table, as students have completed many modules, how would i store this?
-
[SOLVED] display chosen option onto another webpage
ma5ect replied to ma5ect's topic in PHP Coding Help
this is the 1st page..this works <form method="post" action="nextPage.php"> <p align="center"> <input type="text" name="txtInput" size="20" /> <input type="submit" name="btnSubmit" value="Submit Data" /> </p> <p align="center"> </p> <div align="center"> <table width="200"> <tr> <td><label> <div align="center"> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_0" /> Radio</div> </label></td> </tr> <tr> <td><label> <div align="center"> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_1" /> Radio</div> </label></td> </tr> <tr> <td><label> <div align="center"> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_2" /> Radio</div> </label></td> </tr> <tr> <td><label> <div align="center"> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_3" /> Radio</div> </label></td> </tr> </table> </div> <p align="center"><br /> </p> </form> 2nd page...cant get the options to display <?php if ( isset($_POST['btnSubmit']) ){ if ( !empty($_POST['txtInput']) ){ $strInfo = $_POST['txtInput']; }else{ $strInfo = "You didn't submit any data in the form field."; $_POST['RadioGroup1_0']; $_POST['RadioGroup2_1']; $_POST['RadioGroup3_2']; $_POST['RadioGroup4_3']; } echo htmlentities($strInfo, ENT_QUOTES); } ?> -
[SOLVED] display chosen option onto another webpage
ma5ect replied to ma5ect's topic in PHP Coding Help
what code goes onto the second page...to display the chosen option -
[SOLVED] display chosen option onto another webpage
ma5ect replied to ma5ect's topic in PHP Coding Help
<form id="form1" name="form1" method="post" action=""> <div align="center"><img src="mm_spacer.gif" alt="" width="35" height="1" border="0" /> <table width="200"> <tr> <td><label> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_0" /> Enterprise System</label></td> </tr> <tr> <td><label> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_1" /> Unix </label></td> </tr> <tr> <td><label> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_2" /> Service management </label></td> </tr> <tr> <td><label> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_3" /> Network admin </label></td> </tr> </table> </div> </form> -
hi all, i have a form with few options. what i am trying to do is display the option chosen from the user onto another page..i have the form setup up but what do i code to display the chosen option on the second page??
-
what i want to achieve is, i want the user to enter their number and then the database to display the records for only that number they entered...am using dreamweaver cs3
-
Hi all, I have a recordset to display records from database, but i dont want all the records to be displayed, i would only like the record for which the user has requested for..eg student number.. any ideas? code: mysql_select_db($database_mysql_connect, $mysql_connect); $query_Recordset1 = "SELECT * FROM robs_enterprise"; $Recordset1 = mysql_query($query_Recordset1, $mysql_connect) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1);
-
just states query failed...the second query