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

  • Home
  • SEARCH
  • 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 9229913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:41:27+00:00 2026-06-18T05:41:27+00:00

I am redirecting from here <a href=update_post.php?updid=<?php echo $_SESSION[‘id’]; ?>>Update</a> and code which shows

  • 0

I am redirecting from here

<a href="update_post.php?updid=<?php echo $_SESSION['id']; ?>">Update</a>

and code which shows error is

<?php include('../includes/connections.php'); ?>
<?php
try{
if(isset($_POST['submit'])){
$title = $_POST['title'];
$post = $_POST['post'];
$dates = $_POST['date'];
$sql = 'UPDATE `blog`.`contents` SET `titles` = :title, `posts` = :post, `dates` = :date    WHERE `contents`.`id` = :idendity';
$result = $pdo->prepare($sql);
$result->bindValue(':title',$title);
$result->bindValue(':post',$post);
$result->bindValue(':date',$dates);
$result->bindValue(':idendity',$_GET['updid']);
$result->execute();
$count = $result->rowCount();
    if($count == 1){
        header('location: index.php');
    }else{
        echo 'Problem Occoured';
    }
}
}
catch(PDOException $e){
echo "Problem: " .$e->getMessage();
}
?>

error which is shown:-Notice: Undefined index: updid in C:\xampp\htdocs\myblog\admin\update_post.php on line 13
Problem Occoured

<form action="update_post.php" method="post">
    Title:<br/>
    <input style="height:40px;" size="110" type="text" name="title" /><br />
    Post:<br />
    <textarea rows="30" cols="85"  name="post" ></textarea><br />
    Date:<br />
    <input type="text" name="date" /><br/ >
    <input type="submit" name="submit" />
</form>
  • 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-18T05:41:29+00:00Added an answer on June 18, 2026 at 5:41 am

    yes by form submission and that is the reason i am checking for if submit isset or not.

    You should include $_SESSION['id'] in a hidden field in the form:

    <input type="hidden" name="updid" value="<?php echo $_SESSION['id']; ?>" />
    

    … and change:

    $result->bindValue(':idendity',$_GET['updid']);
    

    … into:

    $result->bindValue(':idendity',$_POST['updid']);
    

    Edit

    First of all, your question above has error. As mentioned in the comment, it’s not possible that isset($_POST['submit']) will return true if you click on a link.

    $_POST will have values when you access the page by submitting a form that has post in the method part.

    As for $_GET, its values are taken from the query string of a URL:

    http://yourpage.php?foo=bar&bar=foo
    

    bar is the value of $_GET['foo']

    foo is the value of $_GET['bar']

    I’ve searched for basic $_POST/$_GET explanation but unable to find one 😀

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

Sidebar

Related Questions

Here is a snippet from a script which I generally execute from cron: if
How to redirecting from win forms to web forms ?
I have some strange behavior redirecting stdout and stderr from s3cmd. For example: $
I have a JSP in which i am redirecting to another jsp like ,i
Here is a problem I have encountered. I have jsp page which has a
So, from here ... In ASP.NET, you have a choice about how to respond
I am redirecting the view from [HttpPost] method to [HttpGet] method. I have gotten
Here is the code in the email_list admin controller page: $idOfCourse = $this->request->data('courseId'); /*
I have a QR code image that's embedded from the Google Charts API. Recently
Here is a code similar to one I have. What I need to do

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.