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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:44:19+00:00 2026-05-26T21:44:19+00:00

I have a include statement that returns an echo to the browser of a

  • 0

I have a include statement that returns an echo to the browser of a single columns contents in a single found record.

It is returning a newline at the beginning of the record. This is breaking into two lines the javascript statement the echo is a part of.

This is the javascript statement:

var listname = '<?php include("test.php");?>';

test.php version 1:

mysql_query("SET character_set_results=utf8", $con);

$listref = $_GET["list"];

if(isset($listref)){
    $result = mysql_query("SELECT `Description` FROM `lists_management_index` WHERE `LL_ID` = '$listref'");
    $row = mysql_fetch_array($result);
    echo "here we are";
    }

Generates:

var listname = ' 
here we are';

test.php version 2:

Generates:

var listname = 'here we are';

What is causing the line break and how do I get rid of it?

Thanks.

PS: Full test.php version 1:

<?php
session_start();
$_SESSION['views']=1;
?>

<?php
include('../cons.php');

$db='lists';
include('../condb.php');

mysql_query("SET character_set_results=utf8", $con);

$listref = $_GET["list"];

if(isset($listref)){
    $result = mysql_query("SELECT `Description` FROM `lists_management_index` WHERE `LL_ID` = '$listref'");
    $row = mysql_fetch_array($result);
    echo $row['Description'];
    }

include('../consc.php');
?>
  • 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-26T21:44:20+00:00Added an answer on May 26, 2026 at 9:44 pm

    Have a look at the beginning of your php script at <?php. Are these the very first characters of the file? Or is there any newline before that?

    Edit: Based on the info that your comment provided I assume that the contents of Description for that row contain a newline at the start.

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

Sidebar

Related Questions

I have found that in all examples (include rails documentation) that I have seen
I'm trying to write a statement that searches 2 db columns and returns results.
In my live site I have php include() and require() that have full path
I'm fairly new to C++, but my understanding is that a #include statement will
We have a stored procedure that has a select statement in it: select convert(int,
I have a stored procedure that returns a collection of my entity class objects.
I have a simple ATL Service in which I have included the following statement.
Is it wise to have include guards around template classes? Aren't template classes supposed
I have to include many header files, which are in different sub-directories. Is there
I have use include ('base.php') script in my other scripts ( more.php ). Now

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.