Jump to content

Recommended Posts

Ok so i asked a quesstion about a select all button using javascript in this topic. I got the select all bit solved but for some reason I am having problems with the php executing. So before I changed it to a textarea box the line break came across fine but now they don't. The old version which works fine can be found here. But then when I pu use the new version with the select all it ends up like this:

 

[village]490|601[/village]<br>[village]495|600[/village]

 

 

I don't see what the problem is. I would say it's something to do with textarea but I was sent here. What could be the problem?

 

Extra info:

 

That page has this include:

?php if ($pc=='')
      include "barbs_include_nopc.php";
      else if ($pc=='on')
      include "barbs_include_pc.php" ?>

 

which in the end leads to a code like this:

 

<?php $yLow = floor($k1 / 10) * 100;
$yHigh = $yLow + 99;

$xLow = ($k1 % 10) * 100;
$xHigh = $xLow + 99;
$BetweenClause = "x BETWEEN $xLow AND $xHigh AND y BETWEEN $yLow AND $yHigh";

$con = mysql_connect("********","*******","********");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  mysql_select_db("******", $con);
  $result = mysql_query("SELECT * FROM village$world WHERE player = '0' AND $BetweenClause AND points <= '$pointsmax'");
  while($row = mysql_fetch_array($result))
  {
   echo "[village]".$row['x']."|".$row['y']."[/village]".[b]"<br>";[/b]
  }
mysql_close($con);
?>

Thw bolded bit is where the line break should be but with the textarea one it doesn't recognise that as a line break

Link to comment
https://forums.phpfreaks.com/topic/177866-html-not-executing-with-in-php/
Share on other sites

Ok, I'll try again. this website out puts something like this:

 

[village]490|601[/village]

[village]495|600[/village]

 

then I asked n the forum how to do a select all button. Got that working using this as the code:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="style.css"/>
<title>Create Barb list</title>
<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
<?php $k1 = $_GET["k1"];?>
<?php $world = $_GET["world"];?>
<?php $pointsmin = $_GET["pointsmin"];?>
<?php $pointsmax = $_GET["pointsmax"];?>
<?php $p1 = $_GET["p1"];?>
<?php $p2 = $_GET["p2"];?>
<?php $pc = $_GET["pc"];?>
<script type="text/javascript">
         window.onload=function()
         {
            var target = document.getElementById("target");
            target.onfocus = function()
            {
               this.select();
            }
         }
</script>
</head>
<body>
<div id="wrapper">
        <div id="header">
<a href="bbcodebarbs.php"><img src="images/bbcode_title.png" alt="Fake Script Maker" border="0"></a>
	</div>
         <div id="navigation">

<div class="container">
                        <ul id="navPyra">
<li><a href="index.php">Home</a></li>
<li><a href="fake_script.php">Fake Script Maker</a></li>
<li><a class="active"href="bbcodebarbs.php">BBCoded Barbs</a></li>
<li><a href="thanks_central.php">Thanks Central</a></li>
<li><a href="support.php">Support</a></li>
<li><a href="contact.php">Contact</a></li>

                        </ul>
                </div>
		   
	 </div>
	 		 </div>
<div id="content">
<textarea id="target" style="margin: 0px;
	padding: 6px;
	border: 1px inset;
	width: 250px;
	height: 200px;
	text-align: left;
	background-color: #FAFAD2 ;
	overflow: auto"><?php if ($pc=='')
      include "barbs_include_nopc.php";
      else if ($pc=='on')
      include "barbs_include_pc.php" ?></textarea>
  <!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 42981 -->
<center><script type="text/javascript">
<!--
var pw_d=document;
pw_d.projectwonderful_adbox_id = "42981";
pw_d.projectwonderful_adbox_type = "1";
pw_d.projectwonderful_foreground_color = "";
pw_d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<noscript><map name="admap42981" id="admap42981"><area href="http://www.projectwonderful.com/out_nojs.php?r=0&c=0&id=42981&type=1" shape="rect" coords="0,0,468,60" title="" alt="" target="_blank" /></map>
<table cellpadding="0" border="0" cellspacing="0" width="468" bgcolor="#ffffff"><tr><td><img src="http://www.projectwonderful.com/nojs.php?id=42981&type=1" width="468" height="60" usemap="#admap42981" border="0" alt="" /></td></tr><tr><td bgcolor="#ffffff" colspan="1"><center><a style="font-size:10px;color:#0000ff;text-decoration:none;line-height:1.2;font-weight:bold;font-family:Tahoma, verdana,arial,helvetica,sans-serif;text-transform: none;letter-spacing:normal;text-shadow:none;white-space:normal;word-spacing:normal;" href="http://www.projectwonderful.com/advertisehere.php?id=42981&type=1" target="_blank">Your ad could be here, right now.</a></center></td></tr></table>
</noscript></center>
<!-- End of Project Wonderful ad code. -->
</div>
<!-- Start of StatCounter Code -->
<script type="text/javascript">
var sc_project=5190901; 
var sc_invisible=1; 
var sc_partition=49; 
var sc_click_stat=1; 
var sc_security="2612f13c"; 
</script>

<script type="text/javascript"
src="http://www.statcounter.com/counter/counter.js"></script><noscript><div
class="statcounter"><a title="wordpress stats "
href="http://www.statcounter.com/wordpress.com/"
target="_blank"><img class="statcounter"
src="http://c.statcounter.com/5190901/0/2612f13c/1/"
alt="wordpress stats " ></a></div></noscript>
<!-- End of StatCounter Code -->	
</body>
</html>

 

But the problem was that instead of it having the result as:

 

[village]490|601[/village]

[village]495|600[/village]

 

it ended up like this:

 

[village]490|601[/village]<br>[village]495|600[/village]

 

How can I fix this?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.