Jump to content


Photo

POST problems


  • Please log in to reply
2 replies to this topic

#1 ile

ile
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 March 2006 - 07:18 PM

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)
{



#2 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 06 March 2006 - 07:29 PM

this
action="<?php echo $PHP_SELF; ?>"

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

Try that first

Ray

#3 ile

ile
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 06 March 2006 - 08:13 PM

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

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

Try that first

Ray
[/quote]

Tooo bad but that didn't work :(






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users