Lusty
01-04-2008, 03:16 AM
hi i have a few problems which i need help with urgently
I'm creating a web page for the user to select from a list of items using checkboxes and after clicking the submit button the web will search the database and display in a table format.
1. i need help with checking if the check box is selected after the submit button is clicked
2. should i create a seprate php file for every single check box select statement to do the selection of data?(ex. calling the php by using form action)
3.any one knows how i can host a page and be able to access it from another computer in the same network using apache?
this is my code so far for the check boxes if you i'd loved to hear from you your views or any errors i'm having in the code
<fieldset id="selection">
<legend>Select the information for viewing</legend>
<div>
<p>
<input type="checkbox" name="selection[]" value="COMPUTER" id = "COMPUTER"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('COMPUTER',
$_POST['selection']))
?>
<label for="COMPUTER"><B>COMPUTER</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="UTMP" id = "UTMP"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('UTMP',
$_POST['selection']))
?>
<label for="UTMP"><B>UTMP</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="PASSWD_WRITE" id = "PASSWD_WRITE"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('PASSWD_WRITE',
$_POST['selection']))
?>
<label for="PASSWD_WRITE"><B>PASSWD_WRITE</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="DEFAULT_PATH" id = "DEFAULT_PATH"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('DEFAULT_PATH',
$_POST['selection']))
?>
<label for="DEFAULT_PATH"><B>DEFAULT_PATH</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="REVIEW_ACCESS" id = "REVIEW_ACCESS"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('REVIEW_ACCESS',
$_POST['selection']))
?>
<label for="REVIEW_ACCESS"><B>REVIEW_ACCESS</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="FILE_PERMISSION" id = "FILE_PERMISSION"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('FILE_PERMISSION',
$_POST['selection']))
?>
<label for="FILE_PERMISSION"><B>FILE_PERMISSION</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="PASSWD_CTRL" id = "PASSWD_CTRL"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('PASSWD_CTRL',
$_POST['selection']))
?>
<label for="PASSWD_CTRL"><B>PASSWD_CTRL</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="OPEN_DIR" id = "OPEN_DIR"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('OPEN_DIR',
$_POST['selection']))
?>
<label for="OPEN_DIR"><B>OPEN_DIR</B></label>
</p>
</form>
<form name="form8" method="post" action="">
<input type="submit" name="Submit" value="Submit">
</form>
</div>
</fieldset>
I'm creating a web page for the user to select from a list of items using checkboxes and after clicking the submit button the web will search the database and display in a table format.
1. i need help with checking if the check box is selected after the submit button is clicked
2. should i create a seprate php file for every single check box select statement to do the selection of data?(ex. calling the php by using form action)
3.any one knows how i can host a page and be able to access it from another computer in the same network using apache?
this is my code so far for the check boxes if you i'd loved to hear from you your views or any errors i'm having in the code
<fieldset id="selection">
<legend>Select the information for viewing</legend>
<div>
<p>
<input type="checkbox" name="selection[]" value="COMPUTER" id = "COMPUTER"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('COMPUTER',
$_POST['selection']))
?>
<label for="COMPUTER"><B>COMPUTER</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="UTMP" id = "UTMP"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('UTMP',
$_POST['selection']))
?>
<label for="UTMP"><B>UTMP</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="PASSWD_WRITE" id = "PASSWD_WRITE"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('PASSWD_WRITE',
$_POST['selection']))
?>
<label for="PASSWD_WRITE"><B>PASSWD_WRITE</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="DEFAULT_PATH" id = "DEFAULT_PATH"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('DEFAULT_PATH',
$_POST['selection']))
?>
<label for="DEFAULT_PATH"><B>DEFAULT_PATH</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="REVIEW_ACCESS" id = "REVIEW_ACCESS"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('REVIEW_ACCESS',
$_POST['selection']))
?>
<label for="REVIEW_ACCESS"><B>REVIEW_ACCESS</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="FILE_PERMISSION" id = "FILE_PERMISSION"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('FILE_PERMISSION',
$_POST['selection']))
?>
<label for="FILE_PERMISSION"><B>FILE_PERMISSION</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="PASSWD_CTRL" id = "PASSWD_CTRL"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('PASSWD_CTRL',
$_POST['selection']))
?>
<label for="PASSWD_CTRL"><B>PASSWD_CTRL</B></label>
</p>
<p>
<input type="checkbox" name="selection[]" value="OPEN_DIR" id = "OPEN_DIR"
<?php
$OK = isset($_POST['selection']) ? true : false;
if ($OK && isset(missing) && in_array('OPEN_DIR',
$_POST['selection']))
?>
<label for="OPEN_DIR"><B>OPEN_DIR</B></label>
</p>
</form>
<form name="form8" method="post" action="">
<input type="submit" name="Submit" value="Submit">
</form>
</div>
</fieldset>