Jump to content

Recommended Posts

Hi Guys,

 

I have a table which i fill when the user puts in a username using this code:

 

<div id="leftcolumn">

<div class="innertube"><b>Search for: </b>

<br/><br/>

<form action="Main.php" method="post">

<textarea name="username" cols="20" rows="1">Enter user name here...</textarea><br/><br/>

    <input type="submit" value="Go SAM !!"/>

    </form>

</div>

</div>

 

this works fine, i am refreshing to the same page "Main.php", taking the $_POST["username"] and doing what i have to do with it.  This fills up a table. Now on the first table i only show the first 10 results.  Then i have two image buttons with net and previous which have the following code:

 

<form method="post" name="DATA" action="<?php

    if(isset($_POST["lastResults"]) && ($_POST["lastResults"] != false))

    {

    $_POST["lastResults"] = false;

    $page = $_SERVER['Main.php'];

    $sec = 1;

    echo $_SERVER['PHP_SELF'];

    //header("Refresh: $sec; url=$page");    

    }

    ?>">

<input type="image" src="images/buttonPrev.gif" title="Move to previous page of results"/>

</form>

 

<form method="post" name="Data" action="<?php

    if(isset($_POST["lastResults"]) && ($_POST["lastResults"] != true))

    {

    $_POST["lastResults"] = true;

    $_POST["singleUserDatagrid"] = $_POST["singleUserDatagrid"];

    $_POST["multipleUserDatagrid"] = $_POST["multipleUserDatagrid"];

    $_POST["username"] = "testing";

    $page = $_SERVER["Main.php"];

    $sec = 1;

    echo $_SERVER['PHP_SELF'];

    //header("Refresh: $sec; url=$page");

    }

    ?>">

    <input type="image" src="images/buttonNext.gif" title="Move to next page of results"/>

</form>

 

This is again going back to "Main.php".  But this time, when i access my $_POST array, i have nothing inside except for the image button position.  I have 3 variables i have put into $_POST while the data is being loaded to the table using code like so:

 

$_SESSION["custconfig"] = $custconfig;

$_SESSION["singleUserDatagrid"] = $singleuser;

$_SESSION["multipleUserDatagrid"] = $multipleuser;

 

Can anybody help please ?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/168531-solved-losing-my-_post-data/
Share on other sites

so will this work ?

 

<form method="post" name="Data" action="<?php

    if(isset($_POST["lastResults"]) && ($_POST["lastResults"] != true))

    {

    echo $_SERVER['PHP_SELF'];

    }

    ?>">

    <input type="image" src="images/buttonNext.gif" title="Move to next page of results"/>

    <input type='hidden' name='lastResults' value='true'>

    <input type='hidden' name='singleUserDatagrid' value='<?php echo($_POST["singleUserDatagrid"])?>'>

    <input type='hidden' name='multipleUserDatagrid' value='<?php echo($_POST["multipleUserDatagrid"])?>'>

    <input type='hidden' name='lastResults' value='true'>

</form>

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.