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

How to display objects in a row
I have 7 codes that i want to display in a row one next to another.
The first is {$ads->ad

Images in email problem
I found this script for sending emails, it works but if the email has <img src="image.jp

code help - pagination
Hi all, I have this code, basically a user logs into my site and they get this page.

The pro

question about header() security
is is safe to just use the header() function to redirect someone if they are, say, not logged in? or

This is driving me nuts!
This insert query looks to be alright, however I get this error:

QuoteYou have an error in yo

Menu restriction
How can I restrict the individual menu that would appear when a user logs in so that all users are c

how to validate date using javascript
I need to validate date in textbox using javascript..
The date is must be not greater than TODAY

IS this code correct
The reason i ask is everything underneath it appears to be alink as well, tis blimmin annoying

Echo Tweaking help!
HI. I would like to have the output of the entered variables repeat forever, but it's stopping at th

apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?

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