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 3605968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:11:23+00:00 2026-05-18T21:11:23+00:00

<?php $name=$_POST[‘name’]; ?> <form method=POST action=<?php echo $_SERVER[‘PHP_SELF’]; ?>> <input type=text name=name> <input type=submit

  • 0
<?php $name=$_POST['name']; ?>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="text" name="name">
<input type="submit" value="GO" name="submit">
</form>

<?php

    include ('db.php');

    if(isset($_POST['submit'])) 
    {
    mysql_query ("INSERT INTO example (name) VALUES('$name')") or die(mysql_error());
    }

    if (!isset($_GET['startrow']) or !is_numeric($_GET['startrow'])) {
    $startrow = 0;
    } 
    else {
    $startrow = (int)$_GET['startrow'];
    }

$query = "SELECT * FROM example ORDER BY id DESC LIMIT $startrow, 20"; 

$result = mysql_query($query) or die(mysql_error());
    while($row = mysql_fetch_array($result)){
    echo "<li>";
    echo $row['name'] ." "." <a href= 'like.php?quote=" . urlencode( $row['name'] ) . "'>Click Here</a>";
    echo "</li>";
}




    echo '<a href="'.$_SERVER['PHP_SELF'].'?startrow='.($startrow+10).'">Next</a>';
?>

I want to make my page links hidden , how can i make then hidden so that a user cant edit it.

2nd question,

currently i am showing total 10 records on each page and then a next page button , but the next button is keep showing even when there is no more records…! how to remove a next page button when records ended. ??

line number 28 is the link to pages which can be easyily editable by any user, i wnat to make them secure (using ID)

and line 35 is n’next’ page link , this link should not be appear when number of records ended

  • 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-05-18T21:11:24+00:00Added an answer on May 18, 2026 at 9:11 pm

    I can’t think of a reason why you really should hide the page numbers from the user in the link. Keeping them in the query string as $_GET variables is probably the most common practice i know of in this specific case of paging.

    I would do validation on the numebrs being recieved in the $_GET variables, since this could often lead to SQL Injection and other problems… Make sure it’s a number, possibly divisible by 10 (if that’s how you like the site to be), perhaps not bigger than a certain defined number, etc…

    If you REALLY still don’t agree, and you want to hide it, then you could always do that by saving cookie on the user’s computer (this is still exposed to user in some way) or save the page number in the session (although this seems like a big waste of server resources to me!).

    About your second question – There are so many possibilities to this…
    Here’s one way :
    Create an sql query that queries how many rows are there to your table.
    Let’s say the number is 55. You put that into a hidden value.
    If you’re displaying 10 items on a page then you know the last page is number 6 (showing items 50-55, if you start counting at page number 1).
    Simple php check when page loads: if ($_GET['page'] == 5) then you don’t display the next button.

    something like this (skipping out validation checks and the sql query) :

    <input type="hidden" value="<?php echo $itemCount;?>">
    <?php
    if ($_GET['page'] < ($itemCount \ 10))
    {
        echo "<a href=\"items.php?page=".($_GET['page']+1)."\">";
    }
    ?>
    

    Using this, I would add a check to make sure the user doesn’t enter a number bigger than this number as well, and if they do, just redirect them to the last number they can.

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

Sidebar

Related Questions

<form action = settings.php method = post> Student ID*: <input type = text name
Consider the following Mechanize form object #<Mechanize::Form {name f1} {method POST} {action f.php} {fields
I have file with name contact.php, inside I have form: <form method=post name=kontakt action=send_mail.php>
can anyone convert this code into the yii framework? file name: text.php <form method='POST'
<p>First Name <input type=text name=first_name> Last Name <input type=text name=last_name></p> <input type=hidden name=screen_name value=first_name
Is this method sufficient? <?php // User pressed Register if (!empty($_POST['name']) && $_POST['email']) {
I've got this jQuery function: function phpmail(){ $.post('mail.php',{name:$(#name).val()}, function(out){ alert(out); }); } and this
<?php $system = $_POST['system']; // The FreshBooks system $name = $_POST['name']; // The name
I have the following mail.php file : <?php $name = $_POST['name']; $to = $_POST['to'];
I have this code that works well: {livre:empty_name} $.ajax({ url: sent.php, type: post, dataType:

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.