Nov 8, 2009

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

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > PHP Programming

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

snlildude87
Hi guys. I have another newbish PHP question. laugh.gif

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 http://w3.validator.org, 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). laugh.gif

Any suggestions?

Thanks smile.gif

 

 

 


Comment/Reply (w/o sign-up)

Spectre
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.

Comment/Reply (w/o sign-up)

karlo
QUOTE(snlildude87 @ Apr 19 2005, 12:39 PM)
Hi guys. I have another newbish PHP question. laugh.gif

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 http://w3.validator.org, 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). laugh.gif

Any suggestions?

Thanks smile.gif
*


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

 

 

 


Comment/Reply (w/o sign-up)

snlildude87
QUOTE(karlo @ Apr 19 2005, 05:45 AM)
please be more specific about your question in php. and also, don't use the font tag.
*


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:

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

See what I mean?

And Spectre, thanks for your input. smile.gif

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Executing Scripts Function Php Function Execute Script Wo Showing Html Markup

  1. Weird Formatting: Embedding Php Into Html - (10)
    I have a funny problem when I embed PHP in a HTML page whenever I write some PHP code with the
    'print' or 'echo' command, the output shows the end bits of the PHP code, eg. when I
    write: CODE print "This is PHP"; ?> the output I get is: This is PHP";?> So, the final
    quote mark, the semicolon and the ending PHP tags are displayed. Has anyone else come across this
    problem before, and does anyone know a solution for it? By the way, the full code would be: CODE
    Some HTML print "This is PHP"; ?> The funny thing is, this does not ...
  2. Php News Script - how to make news script that uses MySQL writen in PHP (20)
    How to make a News script with PHP + MySQL So..in this tutorial i will explain how to create PHP
    news script. first we have to create the table in My SQL.. with the code below you will do this (
    you have to enter it into SQL field ..in PHPmyADMIN) CODE CREATE TABLE news ( id int(10)
    unsigned NOT NULL auto_increment, postdate timestamp(14) NOT NULL, title varchar(50) NOT NULL
    default '', content text NOT NULL, PRIMARY KEY (id), KEY postdate (postdate), FULLTEXT KEY
    content (content) ) >>>> script files 1 file will show the news ,1 file will...
  3. Transfer Variables To Another Php Script - (11)
    Hello, I've one registration page where the users fills in their information, is it possible to
    trasnfer the things the fill in on the registration page to another script that does someting and
    returnes something to the first page like true/false and then the registration gives an error
    messange if the other php script returned false? Something like the script "activates" another
    script that does something and returnes the result back to the original script. Best Regards ...
  4. Error When Using file_put_contents() - failed to call to undefined function (5)
    Hey all, I decided to write a script which writes some text to a file, but I have a problem when I
    execute the script, I get a fatal error: QUOTE(homepage) Fatal error : Call to undefined
    function: file_put_contents() in /home/cmatcme/public_html/afile.php on line 55 This is the
    code I'm using to write the file: $ipfnsdoc = "/home/cmatcme/public_html/afolder/afile.txt";
    if (!is_readable($ipfnsdoc)) { echo "File cannot be read"; $stopload = 1; } if
    (!is_writable($ipfnsdoc)) { echo " \nFile cannot be written to"; $stoploa...
  5. How To Use A Link To Call Function In Php? - (9)
    The title says it all, really. How do you call a function using in PHP? I'm doing a project
    and I stumbled upon this problem. I don't want to use query string in the href part like
    since that would mess up the other part of my code. Can anyone pleae help me? I've pasted the
    code below. /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> Thanksh.
    CODE   function display($x){ //coding goes here.   } ?> Display itmes ...
  6. Many Php Script Sites - (18)
    Hi I find many sites has PHP scripts :: QUOTE http://www.proxy2.de/scripts.php
    http://www.free-php.net http://knubbe.t35.com/ http://www.ngcoders.com/
    http://www.oxyscripts.com/ http://www.phparena.net/ http://www.1phpstreet.com/
    http://px.sklar.com/ http://www.scoznet.com/ http://php.resourceindex.com/ /blink.gif"
    style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" />...
  7. How To Check If Fsockopen Function Is Enabled? - (3)
    Hi, I have VPS (virtual private server) and I have access to php.ini file. Is there any script that
    will show that fsockopen function is enabled or where do I have to enable it? Searched google and
    here and couldn't find anything. Thanks! ...
  8. Watermark Your Image With Simple Php Script - found it on the net (39)
    This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips &
    Scripts site. Just in case the site may not show, I will include the code here: List of things
    needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3.
    script below with name (i.e. watermark.php) CODE // this script creates a watermarked image
    from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly transparent
    gif image with the watermark - goes in the same directory as this script // where this...
  9. Free Auction Script - Any Suggestions? (7)
    Any free auction script suggested? I want it to be as many practical functions as possible, yet
    easy to manage. And more importantly, it is free! Appreciate your kind suggestions!...
  10. Php And Disabling Html Tags - how can i do this? (11)
    Hello everyone Im TRYING to make a forum and obviously for security i need to disable HTML tags
    being used in posts. i know how to use the str_replace() function but to be honest i think id have
    to do that for every single tag. I also trued using the html CODE stuff tag but i need to
    be able to use the new line tag to make a new line as all the posts are stored as HTML. if this isnt
    clear let me give an example: QUOTE NEW POST PAGE > user makes new post and posts it > PHP
    PROCCESSOR PAGE MAKES HTML FILE > NEW HTML FILE CONTAINING THE POST > user veiws ...
  11. Search Engine/ Function - (0)
  12. Script: Php Jukebox - A one file script! (6)
    This scripts is so simple, you dont need to edit ANY of it! All you have to do is make a folder
    called 'songs' and put some audio files in it. Here is the whole page, I named it index.php
    and put it in a folder called 'music': CODE PHP jukebox ©2005 Craig lloyd.
    All rights reserved. Visit cragllo.com for more scripts --> /** * ©2005 Craig lloyd. All rights
    reserved. * * Mod Title:           Simple PHP Jukebox * Author:              Craig Lloyd * Author
    Email:        cragllo@cragllo.com * Author Homepage:     http://www.cragllo.com/ * Des...
  13. PHP Function To Add Previous and Next Page Feature - useful php function (5)
    CODE function navigationbar($start_number = 0, $items_per_page = 50, $count) {    // Creates a
    navigation bar    $current_page = $_SERVER ;     if (($start_number         $start_number = 0;
        }     $navbar = "";     $prev_navbar = "";     $next_navbar = "";     if ($count >
    $items_per_page) {         $nav_count = 0;         $page_count  = 1;         $nav_passed = false;
            while ($nav_count             // Are we at the current page position?             if
    (($start_number                 $navbar .= " ";                 $nav_passed = true;       ...
  14. Very Simple Online Now Script - This is a very simple online now script. (4)
    Hi all, Its Aldo. anyways, I wont be using the method of pagination, i will just tell you how to
    make a basic online now script. When someone logs in, now take into consideration that the name of
    the username input is username ( First ,create a table in your database saying online now and add 2
    fields to it. id and username CODE id type=integer(INT) , auto increment, length =255 and
    username = VARCHAR length=the limit a username should be in your site now from there we take off
    : CODE //logged.php //authentication script //connection script //if connectio...
  15. Guessing Php Script - (2)
    I am looking for: freeware php quess the person in the photo game script...
  16. Php Downloads Script - (4)
    I've been looking all over the net for a PHP script which can provide an interface to browse a
    downloads database. The database could be powered by MySQL. If you know a script like this, please
    post it here. Thanks in advance, Ironchicken....
  17. Php Guest Online Script - (3)
    make an index.php copy and paste this code CODE $db_host = "localhost"; $db_user = "root";
    $db_pass = ""; $db_name = "test"; $dbc = mysql_connect($db_host, $db_user, $db_pass); $dbs =
    mysql_select_db($db_name); $tm = time(); $timeout = $tm - (30*60); if($_SERVER ){$ip=$_SERVER ;}
    else{$ip=$_SERVER ;} $brws = explode("(",$_SERVER ); $browser = $brws ; mysql_query("DELETE FROM
    guest WHERE actvtime mysql_query("INSERT INTO guest SET  time='".$tm."',
    ip='".$ip."', browser='".$browser."'"); $count =
    mysql_fetch_array(mysql_query("SELECT COUNT(*)...
  18. How To Make Php Newsletter Script - (3)
    I have seen a post on here somewhere which shows how to make a simple newsletter php script. I
    cvant find it anywhere and I wanted to ask some questions of the author. Does anyone know the one I
    mean? Cheers ...
  19. How To Make A View New Post Script? - (5)
    Ok so i'm still working on the forum software i posted about a while back, but I have no idea
    how to do this. I want to make a view new post script, as this is one of the main things that my
    forum software dose not have that all other forums have. so does any body have an idea on how i
    would do this? Thanks....
  20. Html Form! - Using MySQL?! (4)
    Hey, I need your help again! I need some good working tutorial how I can update my SQL through HTML
    form. I did use some tutorials online found with the help of google; but they do not work properly;
    I mean there are still small mistakes. I need to have a good tutorial to follow. It should be
    based on security and more things. It has to be done in proper way......
  21. Html Code Tester. Online Script - (15)
    Yes, yes. I have another script that I have written and I am distributing. I am not entirely sure if
    this works. I have not tested it yet, but I will later and post back with a demo and fix it up.
    Current script: CODE //Save this as something like htmltest.php function CheckForm() {
    $html_unsafe=$_POST ; //Gives us our user input $html_safe=str_replace(" //Starts security measures
    $html_safe=str_replace("?>"," ",$html_safe); //User input now secure server side //Still security
    issues client side echo $html_safe; //echos our statement } //End function //Main script...
  22. Need Help Installing Dolphin Community Script! - (5)
    I'm not sure if this is the right place to post this but I really need help in installing the
    dolphin community script. I have absolutely no previous experience of scripts or programming. I
    would really appreciate if someone could walk me through it step-by-step, or even do it for me by
    logging into my cpanel. I have tried to install it my self but I'm a little confused. I'm
    sure it won't take very long at all for someone who has done this before....
  23. Getting List Of Directories And Files Using Php - PHP Function for Directory and File List (6)
    is there a php function that lists the content of some folder.... example: /New folder new.txt
    left.gif download.zip dc.exe ....so is there..? /rolleyes.gif' border='0'
    style='vertical-align:middle' alt='rolleyes.gif' /> ...
  24. Parse: Error Unexpected T_lnumber - php parse error when running script (4)
    Hi. I've just created a php script. The main object of the script is to delete some old files
    and replace it with a new file with some new content, effectively moving the contents from one file
    to another. These are the first 50 lines of the file: /* Calculate For The "A" Group - The
    Latest Games ID */ $a_B = 002; while(file_exists("a_" . $a_B . ".dat")) { $a_B++; }
    $new_page_contents = " " . $_POST . " " . $_POST . " include
    \"/home/cmatcme/public_html/footer.php\"; ?> "; $a_stream = fopen($a_B . ".cmat", "w+");
    fwri...
  25. Include File.php?id=something - using the include() function (13)
    Well, I am making a full CMS system for my site, and want to make the index.php file to include the
    view.php?id=1 file. I tried with this code, but it didn't work: CODE This is the error
    I get: CODE Warning: main(view.php?id=1) : failed to open stream: Invalid argument in
    C:\server\xampp\htdocs\test\index.php on line 1 Warning: main() : Failed opening
    'view.php?id=1' for inclusion (include_path='.;C:\server\xampp\php\pear\') in
    C:\server\xampp\htdocs\test\index.php on line 1 So what can I do?...
  26. How Good Is This Data Cleaning Function? - (2)
    Hi all, this is my first function and as part of a script and i just want to know a couple of
    things. here is the code for the function: CODE function clean($dirty_string) {
    $muddy_string = stripslashes($dirty_string); $murky_string = strip_tags($muddy_string);
    $clean_string = htmlentities($murky_string);      }; ?> So the first thing is how secure is it?
    the script this will be used in connects to a database and sends an email so it needs to stop SQL
    injections and any email abuse it might cause, also the data stored in the database will be usaed as
    par...
  27. Releasing Wap/php Scripts? - (3)
    I have created two great scripts one a wap download/ftp-upload script, the other a wapCHAT. How can
    i stop them removing my copyright?...
  28. What Kind Of Script Do You Need ? - post here and get free script (15)
    Hi everybody sorry if i posting here , i know I want design free PHP script and i dont know
    webmasters what kind of scripts want i think its better to aks here becuase trap17 is very nice
    webmasters forum So , Plz post here what kind of script with details you need ! sorry may en is
    not very well for example you need "upload center" : write "upload center" with upload center
    options ( like Ajax , Fast , multi lan and ... ) with this post we can give script details and
    webmasters idea /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif"...
  29. Adapting Html Code Embed To Work On Phpnuke - Help With This Html Code Pls (7)
    QUOTE how can get this html code to work on my phpnuke site? what tags would i
    have to enable in the $Allowable HTML part of my config.php file?? Edited topic title. Moved to
    Programming. ...
  30. Script Help Required: Undefined Variable - A fault I cannot spot in PHP (3)
    Hi, when running a PHP script I keep getting the error: QUOTE Notice: Undefined variable: bret
    in c:\program files\easyphp1-8\home\poll.php on line 294 Notice: Undefined variable: bret in
    c:\program files\easyphp1-8\home\poll.php on line 294 (And, yes, I get it twice). The code
    related to the variable is as follows: CODE function LogString($string,$type)     {
            $t_log = "\n";         $t_log .= $this->globaldata->server_vars ."|";         
            $t_log .= date("Y-m-d h:i:s A|");         $t_log .= "$type| ";         $string =
    str_replace("\n","\\n",$s...



Looking for executing, scripts, include, function, php, function, execute, script, w, o, showing, html, markup

Searching Video's for executing, scripts, include, function, php, function, execute, script, w, o, showing, html, markup
See Also,
advertisement


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

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com