Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.