External Random Flash(.swf) Display Script
I want to write an external php script that would randomise flash files in a particular folder on my site and display one in a given space. I've already composed the script.
<?php
$location = "http://www.mysite.com/images/";
$files = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10");
$file = array_rand($files, 1)[0];
$ending = ".jpg";
$img = $location . $file . $ending;
echo "<img src="" . $img . "">";
?>
The problem is how to inset this into the flash movie tags. something like <embed src="flashmovie.swf"> where flashmovie.swf is the flashfile generated from the script above.
View Complete Forum Thread with Replies
Related Forum Messages:
External Random Flash Script
I want to write an external php script that would randomise flash files in a particular folder on my site and display one in a given space. I've already composed the script. <?php $location = "http://www.mysite.com/images/"; $files = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10"); $file = array_rand($files, 1)[0]; $ending = ".jpg"; $img = $location . $file . $ending; echo "<img src="" . $img . "">"; ?> The problem is how to inset this into the flash movie tags. something like <embed src="flashmovie.swf"> where flashmovie.swf is the flashfile generated from the script above.
View Replies !
How To Open Random Flash Page Using Hyperlink?
I'm new to using PHP so please bear with me. I'm trying to create a hyperlink that will open a random Flash page so that users will see a different flash module each time. Here is some of the code that I wrote but I'm not sure if it'll work since I'm not very good at coding. Oh yeah, I'm not using a database either. // random_menu.html <head> <?php $i = rand(0,3); ?> </head> <body> <a href = "www.x.com/random.php?i=$i">x</a> </body> --------------------------- // random.php <head> <?php $i = $_post["i"]; if ($i = = 0){ $value = "a"; } else if ($i = = 1){ $value = "b"; } ...etc. </head> <body> <object> <param name="movie" value="$value"> <embed src="$value"></embed> </object> </body> Please help if you know how to do this.
View Replies !
How To Display Pdf Into Flash?
My colegue is trying to make a Multimedia presentation using flash. But when anybody clicks on a pdf document, the acrobat reader executable is executed from clients to open the pdf file. What he wants is that rather than opening the document using acroread.exe, the contents will be shown in a context area kept in the navigator. Can anybody suggest anything here. Is there any softsare to grab pdf content and convert into flash?
View Replies !
Display External Page
I have a domain e.g. www.example.com and i want to display an external file on that page e.g. http://111.111.111.111/index.php How can i do that? I tried using fopen... <?php //file: www.example.com/getexternalpage.php $fp = fopen("http://111.111.111.111/index.php", 'r'); echo $fp; ?> ... but i get an error message... Code: Resource id #7 Is my code correct? or it doesn't work with echo?
View Replies !
Random Display
i jsut setup a simple image gallery, and the thumbnail have a PREFIX of "tn_" (without quotes), and i want to display ONLY the thumbnails, which are the tn_ extension, randomly, and the thumbnail which i being displayed should link to its approprialte original image, for example if the tn_image1.jpg thumbnail is being displayed, when people click on tn_image1.jpg it should go to image1.jpg. I also have the images in MANY different folder, like inside a main GALLERY folder, there are many categorised folder, i want the tn_ from all of those folders to be displayed.
View Replies !
Display 3 Random Templates
Alright, so I have a bunch of files called link1.html, link2.html, etc. I want to call 3 random templates into one file...except I want it to make sure it isn't calling the same file more than once at a time.
View Replies !
To Display Random Images
If you want to display random images when you refresh everytime? For example. I have a picture name like (pic1.jpg, pic2.jpg, pic3.jpg, pic4.jpg, pic5.jpg). I want all the pictures to be displayed randomly. Solution: <img src=<?print "pic".rand(1,5);?> border="0" alt=""> that's it.
View Replies !
Display Random Image
i have code to display an image in 1 directory, does anyone have something that will search all sub dirs within the root tree say main humor weird etc but it will scan them all, i have about 80 sub dirs, i dont wanna put in an array.
View Replies !
Display Random Results
PHP Code: $query = "SELECT images ".                                  "FROM home_images";              $result = mysql_query($query) or die(mysql_error);                          // Display flowers              while($row = mysql_fetch_array($result))              {              if($row['images'] != "")              {              // filepath              $uploaddir = 'cms/uploads/home/'              $uploadfile = $uploaddir . basename($row['images']);             echo '<a class="p1" href="#"> '. '<img src="'.$uploadfile.'" alt="img1" width="90" height="90" /> '. '</a>' } // end if } // end while
View Replies !
Choose Random Image From Dir And Display It
I have a directory of images, called "random". In it are the following files: 1.gif 2.gif 3.gif 4.gif I use this script to choose a random image and display it: $i = -2; // $i = -2 so that the directory files ("." and "..") won't be counted. if ( $dh = opendir( "images/random" ) ) { while ( false !== ( $file = readdir( $dh ) ) ) { $i++; } closedir( $dh ); $rand = rand( 1, $i ); $randimg = '<img src="images/random/' . $rand . '.gif" />' } print $randimg; This works just dandy. However, I figure there must be a more efficient way to count the number of files in a directory. Is there a directory's equivalent of a function like file()? Or is my script the only way to count the files?
View Replies !
Display Random Article And Images…
I have two tables Article and Images and I want to Display the title of the article from the article table and one image that is related to the article from the image table on my index page. I want to display them from the 9 recent posts, that means each time some hits the index page the Article and the related images changes randomly from the 9 recent posts. One article and its image per hits. The idea is to display the summery of the article with one image (Image1) of that article and when you click on the article (Title) or on the image it takes you to a detail page where it displays the Content and its 9 images in thumbnail. That means one article is related to one row of the image table containing 9 images. Code:
View Replies !
How To Display Random Data Table Row
I would like to be able to display a random database row in an ad system I am thinking about developing. Here is MySQL code that I create: <?php mysql_connect("localhost","username","password"); mysql_select_db("databaseName"); mysql_query("SELECT * FROM dateTableName ORDER BY RAND() LIMIT 1");?> Is this correct and what would be my next step to make a single random row display. I am sure I would use echo or print the database variables in some fashion. I the past I have been using the mysql_fetch_array method, but I am not quit sure how to do this now.
View Replies !
CAN I DISPLAY CONTENT ONLY 10 Random MIN Of Each HOUR?
I am very new at PHP, barely learning, but am looking to have a script in which I can display a word only 10 minutes out of hour for a web contest. Is that possible? I would need the 10 minutes to be random though, it can't be always the first 10 minutes.... Or maybe it would be easier to show content after 75 minutes, that way its controlled... you know what I mean?
View Replies !
Script To Display 1 Of 4 Include Files At Random
I'm working on a small script to display 1 of 4 include files at random (per refresh). Here's the code i've got thus far; <?php $testimfiles = array ( 'testimonials/testim_1.inc', 'testimonials/testim_2.inc', 'testimonials/testim_3.inc', 'testimonials/testim_4.inc' ) include ($testimfiles[rand(0,3)]LIMIT 1) ; ?>
View Replies !
Sessions? External Program / External Program
I am trying ac ouple of days now to learn some things on SESSIONS,but I think I am not getting it very clearly. I have a PHP page tha contains a form. Users enter data in the form, which are then written in a file (the file is created at the time a user enters some data) The file is then given as an input to an external program The external program runs and gives some results which are then stored in another file (that is created when the external program finishes) What I want to do is to somehow create these files and, when the user exits from the browser, then both files that refer to this user, will be deleted. Code:
View Replies !
Image Display Doesnt Display The Entire Pic Just The $xhead Value.
i have this issue: showpic.php ================================================ $ch = curl_init(); $timeout = 0; curl_setopt ($ch, CURLOPT_URL, $xmyurl); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // Getting binary data curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $image = curl_exec($ch); curl_close($ch); header('Content-type: image/png'); $xim=@imagecreatefromstring($image); $xbase = @imagecreatetruecolor(130,168); $xback=imagecolorallocate($xbase, 255,255,255); //green imagefill($xbase,0,0,$xback); $xhead=@imagecreatefrompng('xhead.png'); imagecopy($xbase,$xhead,10,0,0,0,108,28); imagecopy($xbase,$xim,0, 28, 0, 0, 130,140); imagepng($xbase); ================================================ then i have this code to display the pic: echo' <font color="#FF0000" size="4">Congratulations!!!</font><br> <span style="font-weight: 400"><font size="2"> <font color="#000000">Here is your pic ;-)</font><br> </font></span> <img src="showpic.php?xurl='.$newurl.'"> ' the issue is, on my machine both on ie and ff the image display perfectly. however on some machines it doesnt display the entire pic just the $xhead value.
View Replies !
External Url
I have tried to make a script, that checks the external url from a popup, but i just get permission denied in javascript. But can this be done in php?
View Replies !
External RSS
I am using PHP to parse some RSS feeds that appear on my home page. The problem is, if one of these feeds hosts is slow, it slows down my page load time. Is there a way to set a time out, so if that RSS feed isn't loaded within a certain it can be skipped.
View Replies !
Loading External Dll
I extract the php-4.0.4pl1-Win32 into my local PC C:php directory. I follow all the instruction in install file and find that the php script work. Then i go to uncomment the entension for external dll that needed in win.ini and also change the path extension_dir=C:phpextensions. the problem is each time i load the php script, it will prompt out the error message "unable to load dynamic library "c:extensionsphp_oracle.dll". can some one help me to resolve this problem?
View Replies !
External DOMEntity's
I have a question about PHP5's DOM, but I found the docs on this section are either incomplete or incorrect (e.g. wrong return types for several functions). How can external entities, or entities in general, be added to a DOMDocument? (I'm not asking about adding entity references because DOMDocument->createEntityReference works like a charm.) I should probably state the details around the problem: I am working on a templating engine that utilizes PHP5's DOM interface (http://xire.forizon.com for details) so for caching purposes if I can make the output document include cached versions of other templates via external entities (XInclude is already used, but not it isn't supported very well on the client side), then any client-side caching can also be utilized.
View Replies !
External PDF File
Is there a way for me to be able to fetch a PDF from another site and display it on my website without having to open up Adobe Reader? In other words, I would like to have this PDF document: http://flightaware.com/resources/airport/ASE/APD/AIRPORT+DIAGRAM/pdf to be displayed on a page when a user opens a page on my website.
View Replies !
Url In An External Php File
Situation: I have an external php file with a function in it that returns a value with document.write like this: <?php Header("content-type: application/x-javascript"); function myfunction() { return $something; } $some_variable=$something; echo "document.write("Some_Text: " . $some_variable . "")"; ?> When called remotely by javaScript, the php function behaves perfectly returning the desired variable: <script> type="text/javascript" src="http://www.mydomain.com/remote.php"></script> The Problem: I would like to display the "Some_text:" part with an active link as in <a href="http://www.yourdomain.com/">Some_text</a> So that when executed, the JavaScript displays the link with an anchor text. How can I write this code into the echo document.write function?
View Replies !
External JavaScript
I am using phpBB and wanted to display latest poll in phpBB to my home page. My home page is html extention and want to use java to call it and display it. I am stuck with these codes; php codes; <? php SOME, SOME.... { echo "document.write('$poll['options'][$i]['vote_option_text']');"; } ?> if ['options'] then will not print anything, if I remove ' ' then print something. However if I put all 4 items ('$poll['options'][$i]['vote_option_text']');"; without ' ' inside of [ ] it will print like; Array[0][vote_option_text]Array[1][vote_option_text]Array[2][vote_option_text]Array[3][vote_option_text]Array[4][vote_option_text]Array[5][vote_option_text] What is correct syntax?
View Replies !
Getting External Data
I am logged in to Yahoo with my Yahoo ID, and I visit: http://baseball.fantasysports.yahoo.com with my browser, it will tell me which Fantasy Baseball leagues I am in, and allow me to click on one to enter the league page. I figured therefore, that if I were already logged in, that the following code, would display the same page (i.e. I would be able to see which leagues I am in): $remotefile=fopen('http://baseball.fantasysports.yahoo.com/','r'); while (!feof ($remotefile)) { $line = fgets($remotefile); echo($line); } Unfortunately, the resulting page asks me to sign in, and doesn't display the desired leagues. But I AM still logged in to Yahoo. If I were to try to visit: http://baseball.fantasysports.yahoo.com again in my broswer, it knows I'm still logged in and displays my leagues.
View Replies !
External Program Via PHP
I need to execute a command-line program through PHP. I have a form which includes a textarea, where the user writes his data. These data will be used as input for the commend-line program. Will I go something like: $data = $_GET['info']; Which function shall I use? System, exec, shell_exec, passthru? I can't choose which one is the correct. By the way, the command which I use when I write the script in the command line is : program_name [argument1 -> A database file] [argument2 -> info supplied by user] So, in the function that will be used, the data supplied by the user will be passed as my second argument (the 1st argument is a file in my hard disk). And, lastly, do I need to change any global settings for PHP in order to perform such actions, ie running scripts via PHP programs?
View Replies !
External Banner
we are building a large agency website and are looking for a php code that a agency can copy to their website to display our banner so they get their free account, in our admin panel we want it to automatically check our code is on their site and as soon as it is removed it changes status. Maybe in admin it shows green button when it is on and when it is removed changes to red, as we have far to many to manually check daily.
View Replies !
External Programs
I have just installed my first Linux distribution (SUSE 10.0). Everything is compiled as far as Apache, Mysql & PHP is concerned. But, I have this problem: I call system commands through PHP using system, shell_exec etc The thing is that PHP responds OK when it comes to 'ls' or 'grep' or 'wget', but, in another program, not UNIX-native, there is no response. I am sure that the program is set up in the PATH, because, if I open a terminal, I can call it from everywhere and it works fine.
View Replies !
External Variables
It's probably not called an external variable... but this is what i need. I have a new design that uses a template... so it works like this: call up index.php (containing variables like content), this includes the template.php (includes the "backbone"). Now the template also calls up a few other pages (like the header, sides and bottom) but I need it to call up something else.. Code:
View Replies !
How To Run External Program
i would like to use php to run external program in window environment like open a macro program to let it run at window background. I try to use exec to run the window command, it works, but when i try to use exec to run other program, like this.. exec("run xxxx.ttl") // xxx.ttl is a macro the php will hang... anyone has sample on how to use php to run external program in window environment??
View Replies !
External Script
I have a script which reads a data file, reads the characters one by one and if a certain character is meet it does something else, at the moment it echos the fact that it meet a certain character. I need it to take the characters it has read up to that point and present them to a database field thats forms part of a set of fields that will be updated at once. Then it will continue to read the remainder of the file and repeat the process until it reaches eof. Is there something similar to goto or gosub, I did some checking and was laughed at, as you can probably tell I'm a newbie. Maybe I should be calling an external script.
View Replies !
Output As External XML
the following code runs a query on a database and outputs the results as XML within its self. I have attempted to get the php page to create a file called rss.xml but have failled. I have tried using $file= fopen("rss.xml" , "w"); but my knowlege of PHP wouldn't be the best or anyway near to the level of being able to modify the below page to do as i wish, would someone be able to take a peep at the page Code:
View Replies !
Flash, PHP & XML
Is anyone out there doing anything in terms of parsing in XML into Flash using PHP as a go between so to speak? I have done some stuff parsing XML directly into Flash but I ntoiced a huge speed hit. Anyways, I was wondering if anyone has done anything or has seen a way to parse XML into Flash via PHP.
View Replies !
Php/flash
I have a text field (multiline) in Flash. When I click "submit" it hits a PHP script. The PHP file sends the message in the text field to an email address. My problem is that when i receive the email, the message is joined together, not recognizing the line breaks that were made on the Flash end. Does the variable of the text field need to be manipulated before it gets posted to the php file?
View Replies !
PHP Flash
I am connecting PHP & Flash.. $var = $this->_nm->getVar(); <-- Get data from database $var1 = gettype($var); if (is_string($var1)) { echo "s=".$var1; } If i print in the browser, it will return s=string, however if i LoadVars in flash it will return s=NULL
View Replies !
Flash And PHP 4.3.1
I've been developing a project in Flash 5 that utilises both PHP and MySQL. The development and testing was done on a PHP server running version 4.1.2 (pretty old I know) and everything was working perfectly. However, upon upgrading to the latest version of PHP 4.3.1, it appears that my Flash application no longer communicates with the PHP files. Is there some new security measures that were introduced in PHP 4.3.1 that could be clashing with how the Flash file operates? Has anyone else experienced similar problems?
View Replies !
|