Jump to content

Embedded php?


Donovan

Recommended Posts

Why is this causing me so much trouble.

 

This is from a side menu and I placed a snippet of php code for a link.

 

</ul>
			   <br />
			  <strong>Files & Links</strong>:<br />
			  <ul class="bluebullets">
				<li>Megamix Case Review</li>
			 <li>         
                 
                <?php
                    
                    $course_id = 12;
				echo "<a href='../../xxxx/index.php?op=questions&course_id=$course_id'>Questions</a>";
                    
				?>
                    
                    </li>
		      </p>
			</div>
	           
	          </ul> 

 

All that shows up is

 

  Questions"; ?> 

 

..not linked at all.

 

Why would this be ignored by the browser?

 

In the browser it is displaying "; from my echo and the closing php tags.

 

I'm using Firefox.

Link to comment
https://forums.phpfreaks.com/topic/86532-embedded-php/
Share on other sites

It is a .html page.

 

I copy/paste your code here:

http://www.inet411.com/testing/fdsfds.php

 

Show up just fine, let me know if you see it correctly.

If not, then it is your browser.

If it is showing correctly then it is your server.

You say it is a .html file.  Is your server set to read .html as .php?

Either rename the file to whatever.php or put the following line in your .htaccess file:

 

AddType application/x-httpd-php .php .html .htm

 

That will tell your server to read .html as .php if anything is between the <? and ?> tags in your .html file.

 

Link to comment
https://forums.phpfreaks.com/topic/86532-embedded-php/#findComment-442151
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.