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 PostThe error is probably becuase the functions are case sensitive and you have capitalized "H".
Jump to Postthat is an unneccessarily convoluted way to echo text, what do you actually want to achieve
Jump to Posti never tried including a php file using javascript external, if you really want to include a php file user php include() or require() instead
Jump to Postsomething like
<form action='submit_me.php' method='post' onsubmit='validate_javascript();'> bla bla bla <input type='submit'></form>
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.