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');
Did you know?Explore Trending and Topic pages for more stories like this.
$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

HTML form problem
Ive made a form to that i want to send to my email via PHP. but when it send only the name's etc sen

download directory onto C drive
I am attempting (if this is possible) to write a routine to automatically dump the contents of a dir

getting rid of quotes in strings
sick of trying to deal with them in multiple ways (entering in and taking from database, echoing, ec

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

What are the two different files you download to update kernel?
What are the two different files you download to update kernel?

getting weird error..
okay, I'm getting an error on this particular function, something about the syntax in the mysql LIMI

Secure pages Sessions vs. Cookies & session_destroy() help
Im new here and new to PHP, I hope you can help me with some questions.

Im writing my web ap

Running External Scripts
I am very new to PHP and am not even sure what I'm asking is possible. I have just installed mediaW

Vertical Alligning - Not working in 1 cell?
<?php

echo "<table id="valign" width="60%" style=

WS-Security PL/SQL Forms
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod
PL/SQL Release 10.2.0.2.0 - P

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