Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8072121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:54:56+00:00 2026-06-05T13:54:56+00:00

It is a self-submitting Form. I have 3 independent Select lists whose selected values

  • 0

It is a self-submitting Form. I have 3 independent Select lists whose selected values are passed as the WHERE parameters for the sql query.

When I click on the button, all data are displayed just fine, well LIMITed, and the link pages are below. But:

When I get to click on the page links, the result set and all the links disappear from sight (only the select lists remain in sight). I believe it is related to the isset condition that, if the values have not been set, display the form, if the values have been set, then process the form. So, the first result set displays correctly, but when you try to go to the second page my form interprets that the Select Lists are not set because they are reset and because i have not clicked on the button if i click on the links instead and therefore, it wipes out everything that it not an html Form.

There is no error in the paginating code. The error is in how I link this form with this paginating method. And I can’t get to know how I should.

        if (isset($_POST['submitted'])) { /***************IF IT IS SET, WE PROCESS THE VALUES*************************/
        $oldcountry = FALSE;
        $oldfrom = FALSE;
        $oldinto = FALSE;

 // Here just checking that all variables have been selected

       if (isset($_POST['country']))


        {
        $oldcountry = $_POST['country'];
        $country = filter_var($oldcountry, FILTER_SANITIZE_STRING);
        }
        else {
        echo 'Please, select a country';
        }
        if (isset($_POST['from_language']))
        {
        $oldfrom = $_POST['from_language'];
        $from_language = filter_var($oldfrom, FILTER_SANITIZE_STRING);
        }
        else {
        echo 'no has metido el from language';
        }
        if (isset($_POST['into_language']))
        {
        $oldinto = $_POST['into_language'];
        $into_language = filter_var($oldinto, FILTER_SANITIZE_STRING);
        }

    // so, once we have selected them and clicked the button, we go for the query

    // and paginate the results


        require_once('bdd1.php');
        $per_page = 6;
        $pages_query = mysql_query("SELECT COUNT(FName)
        FROM work_assignment, developer
        WHERE AES_DECRYPT(country, 'elperrodesanroquenotienerabo') = '".$country."'
        AND from_language = '".$from_language."'
        AND into_language = '".$into_language."'
        AND work_assignment.developer_id = developer.developer_id
        ORDER BY FName ASC ");
        $pages = ceil (mysql_result($pages_query, 0) /$per_page);
        $page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
        $start = ($page - 1) * $per_page;
        $query = mysql_query("SELECT FName
        FROM work_assignment, developer
        WHERE AES_DECRYPT(country, 'elperrodesanroquenotienerabo') = '".$country."'
        AND from_language = '".$from_language."'
        AND into_language = '".$into_language."'
        AND work_assignment.developer_id = developer.developer_id
        ORDER BY FName ASC LIMIT $start, $per_page");
        while ($query_row = mysql_fetch_assoc($query)){
        echo '<p>', $query_row['FName'], '</p>';
        }
        if ($pages >=1) {
        for($x = 1; $x <=$pages; $x++){
        echo '<a href="?page='.$x. '">'.$x.'</a> ';
        }
        }
        } /************* END OF IF ISSET TO PROCESS *******************************/

    ?>

UPDATE UPDATE

After all the help, I managed to write a URL string that makes the page links work. Yet, still I need to tweak it as I hardcoded the name of the country (basically Estonia) instead of embedding the variable that represents it, but I can’t make that URL properly be written:

This works:

echo '<a href="?country=Estonia&from_language=Russian&into_language=Latvian&submitted=true&
page='.$x. '">'.$x.'</a> ';

I would just need to replace Estonia by $country, and Russian by $from_language and Latvian by $into_language. But I have tried all possible combinations of single and double quotes and dots and I get syntax errors. Does anybody know how to write that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:54:58+00:00Added an answer on June 5, 2026 at 1:54 pm

    $_POST values are only set if information is sent with a POST request, for example your has most likely method=POST. When you submit your form with method POST (button=submit) the $_POST values are set. Whenever you klick another link, only a request for a new page will be sent to the server.

    If you need the information to be available after the first form submit, you should use a Session. (http://php.net/manual/de/features.sessions.php)
    Sessions are stored for each client (webbrowser) and are available until the session times out (please see manual). You would have to set the session variables the first time the form gets submitted. Afterwards you can use the values from the session.

    /Edit

    If you do not want to use a session, you could add the filter criteria as url parameters (index.php?groupby=country) to the normal links. They would then be accessed with $_GET.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible for me to have two self submitting forms on a single
I have a form that has disabled select box. I have this function in
Pretty self explanatory. I have a textbox in an updatepanel that will autopostback when
This is a simple form for submitting a listing into a database of real
I don't understand what's happening, I have in my form mylist = forms.MultipleChoiceField(required=False, widget=forms.SelectMultiple,
When submitting a form, I receive an IntegrityError (1048, Column 'paid_on' cannot be null)
I am trying to use a textarea form entry which I have some javascript
We have a form which has a few separate submit buttons which do different
This post extends the error while submitting data in the form django model.py from
I have this model: class People(models.Model): name = models.CharField(max_length=128, db_index=True) friends = models.ManyToManyField('self') So

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.