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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:41:42+00:00 2026-05-31T21:41:42+00:00

I have a text area page which is launched from the previous page: $message

  • 0

I have a text area page which is launched from the previous page:

$message = $_POST['editPost'];
header("location:editPost.php?msg=$message");

The editPost.php retrieves this and fills the text area like so:

echo "<form action='index.php' method='post'>
Your Post:<br/>
<textarea name='comments' cols='100' rows='100'>".$_GET["msg"]."</textarea>
<br/>
<input type=submit value='submit'>
</FORM>";

The problem I’m getting is not all the data of ‘msg’ seems to get passed across, or the message gets cut of at the point where it reaches a quotation mark e.g. ‘

The text I want it to fill the textarea with this text:

So this is my second blog post for this assignment, I’ve progressed a bit since my previous post

however it only add this to the text area this:

So this is my second blog post for this assignment, I

As I say it seems to not contain any more of the string after the quotation mark is reached. Is there anyway around this so I can pass the whole message across?

EDIT

I might add, I’m aware a more simple solution would be to retrieve the message again from the MySQL database as that’s what I’m using, but I’m just intrigued as to how this works.

if(isset($_POST['edit'])) {
//$_SESSION['postToEdit'] = $_POST['editPost'];
$message = htmlentities($_POST['editPost'], ENT_QUOTES);
header("location:editPost.php?msg=$message");

That is what I do with the data once it is posted from this form:

foreach($posts as $postid=>$post)
            {
                echo '<div class="blogPosts">'.$post;
                if(isset($_SESSION['username'])) {
                    if($_SESSION['isAdmin'] == "true") {

                        echo "<br/><br/><form name='adminTools' action='index.php' method='post'>
                        <input type='hidden' name='editPost' value='$post'>
                        <input type='submit' value='Edit' name='edit'/>
                        <input type='hidden' name='deletePost' value='$postid'>
                        <input type='submit' value='Delete' name='delete' /></form>
                        </div>";
  • 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-31T21:41:43+00:00Added an answer on May 31, 2026 at 9:41 pm

    I think I get it.

    header("location:editPost.php?msg=$message"); doesn’t smells good.

    If you simply want to fix the problem use http://php.net/manual/en/function.urlencode.php and when getting the value http://www.php.net/manual/en/function.urldecode.php

    You’re getting a post request and then forwarding it using header location. That’s definitely a poor way to do it. The problem probably is taking place when you pass the parameter as a query string on ?msg=$message

    Since MVC and alike applications (n-layered apps) is the standard now. You should not do that spaghetti code, mixing html and php and using header as your FrontController dispatcher.

    I’d suggest you to use for example, the SLIM framework. If you do not want to learn this. You should at least follow the standards described here.

    E.g.:

    <?php
    // index.php
    
    // load and initialize any global libraries
    require_once 'model.php';
    require_once 'controllers.php';
    
    // route the request internally
    $uri = $_SERVER['REQUEST_URI'];
    if ($uri == '/index.php') {
        list_action();
    } elseif ($uri == '/index.php/show' && isset($_GET['id'])) {
        show_action($_GET['id']);
    } else {
        header('Status: 404 Not Found');
        echo '<html><body><h1>Page Not Found</h1></body></html>';
    }
    

    In short, create a FrontController file that will map to the desired actions (controllers) according to the request without using header() to execute specific actions (the exception is only if actually the headers are needed, in fact).

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

Sidebar

Related Questions

I have a page which has a rectangular area with text and icons in
I have a text area which on page load has default text of List.
i have one text area <textarea name=message id=message class=text_field style=height:200px; width:500px></textarea> if i type
Possible Duplicate: Capture newline from a textarea input I have a text area where
I have a text area on my site which shows the user a certain
I have set up a workspace area which represents a blank PDF page where
I have a textarea within an HTML page into which my users paste content.
I have a text area and a function to do syntax highlighting on it.
I have a text-area where text and an image url is entered. Text is
I have some text area field in my grails application. I got the following

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.