the error i am getting in the html file
Message: Syntax error
Line: 1
Char: 1
Code: 0
URI: http://localhost/testhtml/test.php
The test.php code is
<?php
Header("content-type: application/x-javascript");
echo “document.write(‘Hello World I am php code called from HTML file:’);”;
CLOSE WINDOW;
?>
The test.html code is
“<script language="JavaScript" type="text/javascript" src="http://localhost/testhtml/test.php"></script>”
HELLO TESTING
i have enclosed external javascript call within single quote so that it gets displayed here
Can anyone help me in resolving this. I am new to php
pankaj87us@gmai 0 Newbie Poster
Recommended Answers
Jump to Postthat is an unneccessarily convoluted way to echo text, what do you actually want to achieve
Jump to Post<script language="JavaScript" type="text/javascript"> window.location="http://localhost/testhtml/test.php"; </script>
Jump to PostWhat you want to do with your test.php? Now is working your test.php just print what you have feed in your php file. Just change as below to display text.
<?php echo "Hello World I am php code called from HTML file"; ?>
CLOSE WINDOW; is not …
Jump to Post<?php echo "Hello World I am php code called from HTML file "; echo "<a href='html path'>click here to return</a>"; ?>
Use simply like above in ur php file. Have a link there to return back.
All 13 Replies
shubhamjain1 7 Junior Poster in Training
almostbob 866 Retired: passive income ROCKS
vaultdweller123 32 Posting Pro
pankaj87us@gmai 0 Newbie Poster
almostbob 866 Retired: passive income ROCKS

rajarajan2017
pankaj87us@gmai 0 Newbie Poster

rajarajan2017
pankaj87us@gmai 0 Newbie Poster

rajarajan2017
vaultdweller123 32 Posting Pro
almostbob 866 Retired: passive income ROCKS
pankaj87us@gmai 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.