Question:

Why isnt PHP and Javascript and HTML all working together??

by  |  earlier

0 LIKES UnLike

This is what I have...

<html>

.

.

<javascript>

.

.

.

</javascript>

</head>

<body>

.

.

,

<?

some php code

?>

more html code....

But it is not working, I end up getting this..

"; //echo " "; echo ""; echo "" . $question; echo ""; $ctr ; } } echo ""; echo " "; echo "

"; ?>

On my page...am i doing it wrong?

 Tags:

   Report

4 ANSWERS


  1. Are you escaping quotes properly and making sure you have matching quotes (open and closing) for any strings you are echoing out in PHP?


  2. There is a small mistake:

    It should be:

    &lt;?php

    some php code

    ?&gt;

    Refer to the source to see how php work with html.

  3. It looks like:

    1. Your HTML is invalid (use http://validator.w3.org/ after processing the PHP to generate the final document).

    2. You are using &lt;? instead of &lt;?php which will cause the PHP to fail is short tags are turned off

    and possibly

    3. You aren&#039;t accessing the page through a webserver that both supports PHP and is configured to run the page you are viewing through it.

  4. &lt;?php is the correct open tag for php and make usre it has  .php at the end

Question Stats

Latest activity: earlier.
This question has 4 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.