473,785 Members | 2,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Function returns nothing (instead of flash)

Hi there,

I have a site with just a few pages. (e.g. home.php)
In every page there is another page included with things
like the header etc.

The included file is in a subdirectory called "include".
There are two functions written in this included file:

=============== =============== =============== =============== ===============
function doImage($image)
{
list($width, $height, $type, $attr) = getimagesize($i mage);
echo "<img src=$image width=\"$width\ " height=\"$heigh t\">";
};

function doFlash($Movie, $Height,$Width)
{
echo "<object classid=\"clsid :D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http ://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=6,0,29,0\"
height=\"$Heigh t\" width=\"$Width\ ">
<param name=\"movie\" value=\"$Movie\ ">
<param name=\"quality\ " value=\"high\">
<param name=\"allowsca le\" value=\"true\">
<param name=\"SCALE\" value=\"exactfi t\">
<param name=\"menu\" value=\"false\" >
<param name=\"wmode\" value=\"transpa rent\">
<embed src=\"$Movie\" width=\"$Width\ " height=\"$Heigh t\"
menu=\"false\" wmode=\"transpa rent\" allowscale=\"tr ue\"
scale=\"exactfi t\" quality=\"high\ "
pluginspage=\"h ttp://www.macromedia. com/go/getflashplayer\ "
type=\"applicat ion/x-shockwave-flash\"></embed>
</object>";
};
=============== =============== =============== =============== ===============

I call the functions from pages in the root directory, pages like
home.php...

When i call doImage("img/logo.gif"); it works well, but when i
call doFlash("swf/logo.swf","100p x","100px"); It returns everything
before
the <html> tag starts, so it isn't in the right place either. When i
change
the "echo"-statement of doFlash() to "return" nothing happens and it
disappears in the source (online)

What am i doing wrong?

Hope someone can help...

Greetings knoakske
Jul 17 '05 #1
7 2208
knoak wrote:
Hi there,

I have a site with just a few pages. (e.g. home.php)
In every page there is another page included with things
like the header etc.

The included file is in a subdirectory called "include".
There are two functions written in this included file:

=============== =============== =============== =============== ===============
function doImage($image)
{
list($width, $height, $type, $attr) = getimagesize($i mage);
echo "<img src=$image width=\"$width\ " height=\"$heigh t\">";
};

function doFlash($Movie, $Height,$Width)
{
echo "<object classid=\"clsid :D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http ://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=6,0,29,0\"
height=\"$Heigh t\" width=\"$Width\ ">
<param name=\"movie\" value=\"$Movie\ ">
<param name=\"quality\ " value=\"high\">
<param name=\"allowsca le\" value=\"true\">
<param name=\"SCALE\" value=\"exactfi t\">
<param name=\"menu\" value=\"false\" >
<param name=\"wmode\" value=\"transpa rent\">
<embed src=\"$Movie\" width=\"$Width\ " height=\"$Heigh t\"
menu=\"false\" wmode=\"transpa rent\" allowscale=\"tr ue\"
scale=\"exactfi t\" quality=\"high\ "
pluginspage=\"h ttp://www.macromedia. com/go/getflashplayer\ "
type=\"applicat ion/x-shockwave-flash\"></embed>
</object>";
};
=============== =============== =============== =============== ===============

I call the functions from pages in the root directory, pages like
home.php...

When i call doImage("img/logo.gif"); it works well, but when i
call doFlash("swf/logo.swf","100p x","100px"); It returns everything
before
the <html> tag starts, so it isn't in the right place either. When i
change
the "echo"-statement of doFlash() to "return" nothing happens and it
disappears in the source (online)
It will disappear .. by removing "echo", you're telling PHP *not* to
put the code into the end webpage. "return" just makes the function
return a value, so that it's available to be used in another part of
your code.. If you wish to echo that return value, you must specify
when calling the function that you want to echo it's return value.

(Think of the return value of a function in the same way you would think
of a constant variable)
What am i doing wrong?

Hope someone can help...

Greetings knoakske

--
Ben Cottrell AKA Bench

Disclaimer:
This post may contain explicit depictions of things which are "real".
These "real" things are commonly known as 'life'! So, if it sounds
sarcastic, don't take it seriously. If it sounds hazardous, Do not try
this at home or at all. And if it offends you, just don't read it.
Jul 17 '05 #2
I'm sorry, but this doesn't solve anything for me...
As you've probably noticed, i'm a newbie..

But anyway, what i can't figure, is why the doImage(); works
perfect, and the doFlash(); refuses to work..

What should i do then to fix it?

Thanks in advance..

Greetings knoak
Jul 17 '05 #3
knoak wrote:
Hi there,

I have a site with just a few pages. (e.g. home.php)
In every page there is another page included with things
like the header etc.

The included file is in a subdirectory called "include".
There are two functions written in this included file:

=============== =============== =============== =============== =============== function doImage($image)
{
list($width, $height, $type, $attr) = getimagesize($i mage);
echo "<img src=$image width=\"$width\ " height=\"$heigh t\">";
};

function doFlash($Movie, $Height,$Width)
{
echo "<object classid=\"clsid :D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http ://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.c
ab#version=6,0, 29,0\" height=\"$Heigh t\" width=\"$Width\ ">
<param name=\"movie\" value=\"$Movie\ ">
<param name=\"quality\ " value=\"high\">
<param name=\"allowsca le\" value=\"true\">
<param name=\"SCALE\" value=\"exactfi t\">
<param name=\"menu\" value=\"false\" >
<param name=\"wmode\" value=\"transpa rent\">
<embed src=\"$Movie\" width=\"$Width\ " height=\"$Heigh t\"
menu=\"false\" wmode=\"transpa rent\" allowscale=\"tr ue\"
scale=\"exactfi t\" quality=\"high\ "
pluginspage=\"h ttp://www.macromedia. com/go/getflashplayer\ "
type=\"applicat ion/x-shockwave-flash\"></embed>
</object>";
};
=============== =============== =============== =============== ===============
I call the functions from pages in the root directory, pages like
home.php...

When i call doImage("img/logo.gif"); it works well, but when i
call doFlash("swf/logo.swf","100p x","100px"); It returns everything
before
the <html> tag starts, so it isn't in the right place either. When i
change
the "echo"-statement of doFlash() to "return" nothing happens and it
disappears in the source (online)

What am i doing wrong?

Hope someone can help...

Greetings knoakske


I really am surprised it doesn't work, I copy-pasted the function in my php
editor, and called the function with a local swf and it runs as expected. So
this leads me to believe the code itself is correct. Even if the .swf is
missing the page loads, allbeit it keeps looking for the missing
movieclip... Anything else you can think of that might be involved ? The way
the includes are handled ? The way PHP handles escaped chars or something ?
My PHP is a default setup, as it comes preinstalled with apache on my suse
9.0 linux machine.
(Apache 2.048 and PHP 4.3.3)

Sorry i can't be of more help.
Pjotr
Jul 17 '05 #4
Hi there, i'm running
PHP 4.3.3 on Linux, that's all i can figure out.

I'll re-explain the structure, maybe that's where it goes wrong..
_root -> home.php*, contact.php*, etc.*

folder "inc"-> standards.php, which also has the functions in it.
*in all the first line = include_once('i nc/standards.php') ;)

I call the function in standards.php from home.php by the following
command: <?php doFlash("swf/logo.swf","100" ,"100"); ?>

What i don't get is that the doImage() works fine in home.php.
The only difference is that doImage() has
"list($widt h, $height, $type, $attr) = getimagesize($i mage);"
before echoing something, could the flaw be somewhere in this part then?

Thanks in advance,

Greetings knoak
Jul 17 '05 #5
anyone?
Jul 17 '05 #6
knoak wrote:
anyone?

I'm sorry knoak, I can't reproduce it. I simply have no clue.
Pjotr
Jul 17 '05 #7
Crap!

Thanks anyway, i'll try something else then..

Greetings
Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
12564
by: Alessandro Crugnola *sephiroth* | last post by:
hi, i have already problems using py2exe.. i'm using python 2.2, wxPython and audiere for a little mp3 player.. once I've build the exe with py2exe, when launching the application: Traceback (most recent call last): File "<string>", line 9, in ? File "imputil.pyc", line 103, in _import_hook File "<string>", line 52, in _import_top_module
35
4552
by: wired | last post by:
Hi, I've just taught myself C++, so I haven't learnt much about style or the like from any single source, and I'm quite styleless as a result. But at the same time, I really want nice code and I go to great lengths to restructure my code just to look concise and make it more manageable. When I say this, I'm also referring to the way I write my functions. It seems to me sometimes that I shouldn't have many void functions accepting...
7
2247
by: Felix Kater | last post by:
Hi, when I need to execute a general clean-up procedure (inside of a function) just before the function returns -- how do I do that when there are several returns spread over the whole function? My first approach: Use "while(1)" and "break", however this doesn't work if there is another loop inside (since I can't break two loops at the same time):
9
2987
by: Christian Christmann | last post by:
Hi, I was just going through this exercise http://www.cas.mcmaster.ca/~franek/books/membook-answers/ch4/answers-ch4-3.html and I'am confused about the answer. It says: "... the compiler actually does not "know" the signature of malloc(), hence it assumes by default, that it returns int..." How can the function call of 'malloc' work at all if it is unknown?
6
1847
by: ais523 | last post by:
I'm trying to write a function that does some realloc-style modification of a pointer. The function itself works, but I'm having some problems with the prototype. This is a simple example of the sort of thing I want to do (not the complete code, that works but is technically UB). #include <stdlib.h> void indirectmalloc(void** ptr, size_t s) {
18
3136
by: ben.carbery | last post by:
Hi, I have just written a simple program to get me started in C that calculates the number of days since your birthdate. One thing that confuses me about the program (even though it works) is how global variables and function returns work... For example, I have a global array "char datestring;" which is defined in the function speakdate. speakdate just converts a set of integers (date variables) to a string.
16
2454
by: mdh | last post by:
May I ask the group the following: (Again, alas , from K&R) This is part of a function: while ( ( array1 = array2 ) != '\0' ); /* etc etc */ Is this the order that this is evaluated? -> array2 is assigned to array1 ....???? the reason being it is
2
2195
by: sonaliagr | last post by:
I am trying to update a msg array in function by passing the address but it is showing an error. and also, i want the value of msg array to be accessible to the full code that is inside the main function...I hope i am making sense...Please look at the code and help me in pointing out the error.. #include<stdio.h> #include<stdlib.h> #include<time.h>
8
1536
by: Viktor | last post by:
Can somebody give me an explanation what happened here (or point me to some docs)? Code: HMMM = None def w(fn): print 'fn:', id(fn) HMMM = fn
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10327
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10151
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8973
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.