Jump to content

POST problems


ile

Recommended Posts

I've made a page with an include.

THe include is a checkbox where the user can select only certain items in the list they want to see.

I have it as a <$php $PHP_SELF ?> for some reason when i come back to the page it ignores the fact that i've posted to it. Like the post has never happened.

Is there any settings in the PHP.ini that would change this. I use $_POST to get the information so Global_Variables set to off woudn't be what's wrong.

checkbox code

<form action="<?php echo $PHP_SELF; ?>" method="post"><br/>

<?php
$x=0;
while($x < sizeof($select))
{
if($select[$x] == "Identifier")
{
echo"CHECKED";
}//endif
$x++;
}//end while
?>
name="select[]" value="Identifier">CI Identifier
</td>
<td>
<input type="checkbox"
<?php
$x=0;
while($x < sizeof($select))
{
if($select[$x] == "CIName")
{
echo"CHECKED";
}//endif
$x++;
}//end while
?>



<td align="center" colspan="2"><input type="submit" name="submit" value="Submit" class="inputbtn" /></td>
<td align="center" colspan="2"><input type="submit" name="reset" value="Show All" class="inputbtn" /></td>
<td align="center" colspan="2"><a href="edit.php">Add</a></td>

</tr>
<tr>
<td align="center" colspan=6><a href="excel.php">Extract to Excel Spreadsheet</a></td>
</tr></table>
</form>


then here is the code for the index page.

<?php
session_start();
include("db.php");
$mtime = microtime();
$mtime = explode(' ', $mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;


if ($_GET["order"]!="")
{
$ordertype = ($_GET["order"]);
}
else
{
$ordertype = "CIName";
}
if ($_GET["order"]!="")
{
$results = mssql_query("SELECT * FROM newhardware ORDER BY ".$ordertype);
}
else
{
$results = mssql_query("SELECT * from newhardware ORDER BY CIName");
}
if (isset($_POST['submit']))
{
echo "SUBMIT WORKING";
}
else
{
echo "NOT SUBMITED";
}



//$results = mssql_query("select * from newhardware");
//this table will output all the information from the database (Ian Elliott Feb 2 2006)

$checkBoxSelect = "select ";
$orderBy = " order by ";
//$selectwhat = ""
include("header.php");
?>
<html>
<head>
<title>Asset Tracking</title>
<style type="text/css">
<!--

@import url("style.css");
-->
</style>

</head>
<body>
<?php
include('checkbox.php');
echo "check box";

<div class="info">
Some Helpful notes:
<br/>The Links at the Top of the Tables Sort in a 1-9 A-Z fashion, but NULL or Empty Fields will always come first.
<br/>The Checkbox above is set to sort by Order so if CI Identifier is check it will be the first thing to be ordered by and so on.
<br/>Any Questions please feel free to email.
</div>
[THIS IS WHERE THE CODE STOPS LOADING WHEN YOU DO A SUBMIT]
<?php

echo "start table";
?>
<?php
if(isset($_POST['submit']))
{
if(isset($_POST['select']))
{
$selectArray = $_POST['select'];
$results = count($selectArray);
$counter = 1;
$counterColor = 0;

foreach($selectArray as $return)
{

Link to comment
Share on other sites

[!--quoteo(post=352177:date=Mar 6 2006, 02:29 PM:name=craygo)--][div class=\'quotetop\']QUOTE(craygo @ Mar 6 2006, 02:29 PM) [snapback]352177[/snapback][/div][div class=\'quotemain\'][!--quotec--]
this
[code]action="<?php echo $PHP_SELF; ?>" [/code]

should be this
[code]action="<?=$_SERVER['PHP_SELF']?>"[/code]

Try that first

Ray
[/quote]

Tooo bad but that didn't work :(

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.