Jump to content
xisto Community
snlildude87

Executing Scripts Without Include() Function php function to execute a script w/o showing html markup

Recommended Posts

Hi guys. I have another newbish PHP question. :o

 

Today, I decided to make a new navigation bar for my site. It doesn't look good because I just started learning Flash today, so I was basically feeling my way around the application. Anyways, if you use Flash and you try to validate your site at /legacy, you get a lot of errors for some weird reason. So I was thinking about separating the markup for embed Flash from the rest of the site's source code.

 

The problem with that is that I don't know a PHP function that will include, or execute a file, without showing the HTML of the included file. The only function I can think of is the include() function, but that shows the markup.

 

Another alternative would be to make a JavaScript include. The problem with this is that some users have their JavaScript turned off because JS can do some pretty annoying stuff. If JS is turned off, there would be no navigation, and my precious users will be left in the dark (kind of like I was today with Flash). :D

 

Any suggestions?

 

Thanks :D

Share this post


Link to post
Share on other sites

Unless I've misunderstood what you're asking, it's impossible. From what I gather, you want to actually execute a file from within PHP - now whilst that in itself is possible, it will only occur on the server, so the visitor won't even know it's happened (unless an error or other output is returned).

 

If you want to use Flash within a web page, then yes, you do have to have the markup to inform the browswer you want it displayed and where.

 

Anyway, although the validator is certainly a useful resource, your HTML (or XHTML or whatever you're using) doesn't have to be strict. The average web browser is much, much more forgiving than W3 is.

Share this post


Link to post
Share on other sites

Hi guys. I have another newbish PHP question. :o

 

Today, I decided to make a new navigation bar for my site. It doesn't look good because I just started learning Flash today, so I was basically feeling my way around the application. Anyways, if you use Flash and you try to validate your site at /legacy, you get a lot of errors for some weird reason. So I was thinking about separating the markup for embed Flash from the rest of the site's source code.

 

The problem with that is that I don't know a PHP function that will include, or execute a file, without showing the HTML of the included file. The only function I can think of is the include() function, but that shows the markup.

 

Another alternative would be to make a JavaScript include. The problem with this is that some users have their JavaScript turned off because JS can do some pretty annoying stuff. If JS is turned off, there would be no navigation, and my precious users will be left in the dark (kind of like I was today with Flash). :D

 

Any suggestions?

 

Thanks :D

131330[/snapback]

please be more specific about your question in php. and also, don't use the font tag.

Share this post


Link to post
Share on other sites
please be more specific about your question in php. and also, don't use the font tag.

131401[/snapback]

The only reason I used the font tag is because the Code tag breaks the line, so using it only for a small line of code is not efficient at all. I'll give you an example:

 

Okay, recently, I tried the
<a>
tag with HTML, but I don't know all the attributes. I know there is the
href
attribute, but are there more? Will the
title
attribute work at all? Can you use the
<embed
tags nested in the
<a>
tag as well?[/code]

 

See what I mean?

 

And Spectre, thanks for your input. :o

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.