PHP and Javascript


Posted on 16th Feb 2014 07:03 pm by admin

Hi Guys,

Im trying to load the contents of an html file into a text area for editing, this is the code I have so far but it doesnt seem to be working. I think it's because some of the $line have "" etc in them which is messing it up, any help/advice is greatly appreciated. I've also commented out some things i've tried and didnt work!
$handle = fopen("".$tmpfile, 'r');
$lines = file($tmpfile);
echo '<form method="post" name="box" action="">';
echo '<textarea name="codebox"></textarea>';
echo '</form>';
foreach ($lines as $line_num => $line)
{
//$line = htmlentities($line,ENT_QUOTES);
//echo $line;
print("<script language = 'javascript'>alert(".''.$line.");</script>");

//Typical Line <html xmlns="http://www.w3.org/1999/xhtml">
// echo "<script language = 'javascript'>var newtext = "."'".$line."'"."; document.box.codebox.value += 'newtext'; </script>";
// echo "". htmlspecialchars($line) . "<br />n";
}
fclose($handle);

No comments posted yet

Your Answer:

Login to answer
312 Like 51 Dislike
Previous forums Next forums
Other forums

Seperate team from score
I am writing a site that does a NFL Pick 'em type application and I have a feed that gives me the sc

need help in php variable
i have a php variable on one page
Code: [Select]$lastId = mysql_insert_id($db);
echo $lastId;<

First root of a number
Hi,

I can't find any function in php to give me the first root of a number.
Is there any

PHP arrays into arrays need help
Hello
I am trying to highlight the days on my calendar based on the dates that i have in my datab

breaking a text file into paragraphs based on strings
I have a text file of email addresses that is all squished together. It looks like this:

abc

Embedding flash object in Else statement
This is my first major project in PHP and I'm having some trouble embedding a flash object in an Els

Storing the referrer in session... problems with tabs
Hello All

I am currently working on an ERP project based on the MVC methodology, when a user

mysql UPDATE request not working and driving me crazy!!!
Hi,

I have been stuck on this for ages.

Quite simply I am trying to update my database

want a code for uploading and downloading
i m trying to upload and download to my site..i need upload and download code ...i use a code for up

How to Detect it is public_html or httpdocs?
How to check whether it is cPanel or Plesk?

If it found public_html perform <?php incl

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash