473,788 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I'm really confused

I haven't a clue with PHP so please spoon feed me.

In the middle of a script that I have been looking at there is this
code which I have extracted to run on it's own

<?php
include "flashthumb.php ";
?>

<script type="text/javascript" src="mootools.j s"></script>
<script type="text/javascript" src="slideshow. js"></script>

<div id="my_slidesho w" class="slidesho w">
<img src="images/vote.jpg" alt="A picture" width="400" height="300" /
>
</div>
....
<script type="text/javascript">
myShow = new Slideshow('my_s lideshow', {hu: 'images/', images:
['vote.jpg','thu mb_rar.jpg','th umb_wav.jpg']});
</script>
<?
?>

Now flashthumb.php generates a list of filenames in the variable
$url[1], $url[2], $url[3] etc

how would I use those in the myshow line instead of
'vote.jpg','thu mb_rar.jpg','th umb_wav.jpg'

or am I totally barking mad and getting it wrong?
Nov 18 '07 #1
3 1189
ph************* @googlemail.com wrote:
I haven't a clue with PHP so please spoon feed me.

In the middle of a script that I have been looking at there is this
code which I have extracted to run on it's own

<?php
include "flashthumb.php ";
>>

<script type="text/javascript" src="mootools.j s"></script>
<script type="text/javascript" src="slideshow. js"></script>

<div id="my_slidesho w" class="slidesho w">
<img src="images/vote.jpg" alt="A picture" width="400" height="300" /
>>
</div>
...
<script type="text/javascript">
myShow = new Slideshow('my_s lideshow', {hu: 'images/', images:
['vote.jpg','thu mb_rar.jpg','th umb_wav.jpg']});
</script>
<?
>>

Now flashthumb.php generates a list of filenames in the variable
$url[1], $url[2], $url[3] etc

how would I use those in the myshow line instead of
'vote.jpg','thu mb_rar.jpg','th umb_wav.jpg'

or am I totally barking mad and getting it wrong?
Suppose the value of $url[1] is the one that corresponds to 'my_slideshow'
and holds that value. Then you would use

<?php echo $url[1]; ?>

instead of 'my_Slideshow'.

It allows you, for example, to initialize fields in the middle of html text.

--
Shelly
Nov 18 '07 #2
On 18 Nov, 22:44, "Shelly" <sheldonlg.n... @asap-consult.comwrot e:
phill.luckhu... @googlemail.com wrote:
I haven't a clue with PHP so please spoon feed me.
In the middle of a script that I have been looking at there is this
code which I have extracted to run on it's own
<?php
include "flashthumb.php ";
<script type="text/javascript" src="mootools.j s"></script>
<script type="text/javascript" src="slideshow. js"></script>
<div id="my_slidesho w" class="slidesho w">
<img src="images/vote.jpg" alt="A picture" width="400" height="300" /
</div>
...
<script type="text/javascript">
myShow = new Slideshow('my_s lideshow', {hu: 'images/', images:
['vote.jpg','thu mb_rar.jpg','th umb_wav.jpg']});
</script>
<?
Now flashthumb.php generates a list of filenames in the variable
$url[1], $url[2], $url[3] etc
how would I use those in the myshow line instead of
'vote.jpg','thu mb_rar.jpg','th umb_wav.jpg'
or am I totally barking mad and getting it wrong?

Suppose the value of $url[1] is the one that corresponds to 'my_slideshow'
and holds that value. Then you would use

<?php echo $url[1]; ?>

instead of 'my_Slideshow'.

It allows you, for example, to initialize fields in the middle of html text.

--
Shelly- Hide quoted text -

- Show quoted text -
I don't think I explained myself properly or I don't quite understand
what you mean.

The code above generates a slideshow from the images listed.

$url is an exploded array generated by flashthumb.pbp of filenames
picked from a directory

so $url[1] would be vote.jpg
$url[2] would be rar.jpg
$url[3] would be wav.jpg

etc

except flashthumb selects random jpegs.

The line

myShow = new Slideshow('my_s lideshow', {hu: 'images/', images:
['vote.jpg','thu mb_rar.jpg','th umb_wav.jpg']});

inserts those images into a slideshow script

so what is needed is something along the lines of

myShow = new Slideshow('my_s lideshow', {hu: 'images/', images:
['$url[1]','$url[2]','$url[3]']});

but that obviously is not the correct syntax to insert those values

I really must learn how to code.
Nov 18 '07 #3
ph************* @googlemail.com wrote:
so what is needed is something along the lines of

myShow = new Slideshow('my_s lideshow', {hu: 'images/', images:
['$url[1]','$url[2]','$url[3]']});
So you need to quote the array values, then concatenate them all with
commas...
<?php

foreach($url as $u)
{
$quotedurl[] = "'" . $u . "'";
}

$concatenatedst uff = implode(',',$qu otedurl);

echo "myShow = new Slideshow('my_s lideshow', {hu: 'images/', images:
[$concatenatedst uff]});";

?>
I really must learn how to code.
Yep...

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Proudly running Debian Linux with 2.6.22-3-amd64 kernel, KDE 3.5.8, and PHP
5.2.4-2 generating this signature.
Uptime: 00:32:43 up 7:33, 2 users, load average: 0.31, 0.47, 0.45

Nov 18 '07 #4

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

Similar topics

6
1543
by: rahul8143 | last post by:
hello, I am really confused over following for code snippets. No problem that they are working codes but how? how they are evaluated by compiler? It will be my pleasure if you explain me all following snippets. 1) { int i=3; for (i--; i<7; i=7) printf("%d",i++);
3
2675
by: Studio P.M. | last post by:
Dear colleagues, I kindly ask the C# developers community to help me to REALLY understand the Page_Load event, so to REALLY have it under control. Reason for this question is that I cannot anymore accept passively the behavior of the “Web Form Designer” automatically generated code because of the fact that, in some circumstances (that I can reproduce at will), my code is victim of a Page_Load multiple “firing”. In other words the...
5
2249
by: Lauren Wilson | last post by:
The more I look at the issue of digital certification for our Access app, the more confused I get. The SelfCert feature that allegedly installed with Office 2003 does not work. The entry is on my menu but is marked "invalid". I've tried re-installing it several times to no avail. In any case, Self Certification won't cut it for us. I MUST get the security warnings to go away -- permanently! My understanding is that full blown PAID...
6
1002
by: Sam Malone | last post by:
Am I just totally missing something here? I'm just new to VS.NET 2005 (using VB.NET) and ADO.NET. I get the impression that ADO.NET can't do what I'm used to doing with ADO (previous ADO withVB6). I used to bind (let's say a text box) to a field (column) in a recordset and if I typed a value in that textbox and tabbed out of it, the value in the database got updated without me having to do anything else. Now what I see is a terribly...
10
1559
by: Stan R. | last post by:
Hi. I'm an old programmer whose been finally reading up on xml the past week. The concepts of xml, dtd, and xsl seem pretty straight forward to me. I understand that xsl (as xslt for transformations) can be used to transform xml data from an xml document into another document, as specified in the templates. One of the best examples I've seen by far is transforming a given xml doc into html. But where I seem to be getting stuck in the...
1
3195
lolixpop
by: lolixpop | last post by:
Hi everybody thanks for reading! i have a few actionscript questions that i really need help on...any help would be greatly appreciated! Okay so i came upon this tutorial: http://www.kirupa.com/developer/mx/fadegrid2.htm It looks awesome! I absolutly love it but i'm not quite sure how to apply it to my banner. My banner consists of 3 movie clips that moves...like instead of a still image like the one shown on the tutorial there are several text...
4
1523
by: Viator | last post by:
Hi folks, I have a basic question. When I do object-oriented programming using C++ or Java, all my objects reside in RAM. I do not have to think about storing and retrieving them, because they are in RAM and that space has been allocated for them and the program is continually running, so neither program nor objects are going to disappear. It seems to me, having never done OOP in PHP, that this
2
6832
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the form every thing works fine: checking items by code
1
2228
by: beary | last post by:
Hello everyone, I'm not sure if this is the correct forum for this, and apologies for the length of this question, but I'm desperate for some good advice... I'm in way over my head with file permissions. The directory and files are sitting on a linux server. I know almost nothing about linux. The background: I was given a web share by my IT admin. Initially, the web share had 3 users, myself (as the owner) ,root (the group) and...
9
10404
by: inxanu | last post by:
Hi all, I have several threads running (basically they are copying files from one place to another). I am using log4net for logging...However, sometimes i get a log4net error due to log file being used by other process. I thought about creating a method which will take care of the logging...all threads will used a delegate to call the method that does the logging static readonly object lockerLog = new object(); public delegate void...
0
10373
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...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
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
8995
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...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
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();...
0
5403
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
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.