Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #4765 > unrolled thread
| Started by | "Pettt[CZ]" <simunekp@hotmail.com> |
|---|---|
| First post | 2012-02-08 13:40 -0800 |
| Last post | 2012-02-10 02:20 -0800 |
| Articles | 5 — 5 participants |
Back to article view | Back to comp.lang.php
6 line php 2 asp "Pettt[CZ]" <simunekp@hotmail.com> - 2012-02-08 13:40 -0800
Re: 6 line php 2 asp Jerry Stuckle <jstucklex@attglobal.net> - 2012-02-08 17:02 -0500
Re: 6 line php 2 asp Denis McMahon <denismfmcmahon@gmail.com> - 2012-02-09 03:06 +0000
Re: 6 line php 2 asp "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-02-09 18:11 +0100
Re: 6 line php 2 asp Captain Paralytic <paul_lautman@yahoo.com> - 2012-02-10 02:20 -0800
| From | "Pettt[CZ]" <simunekp@hotmail.com> |
|---|---|
| Date | 2012-02-08 13:40 -0800 |
| Subject | 6 line php 2 asp |
| Message-ID | <7a0ec03f-b51f-4d2f-91c7-667b91c5a7b3@l14g2000vbe.googlegroups.com> |
Guys, this is your humble ASP colleague asking for help.
I have no experience with PHP and I need this 6 line page translated
to ASP
$location = 'albums';
$album_name = $_GET['album_name'];
$files = glob($location . '/' . $album_name . '/*.{jpg,gif,png}',
GLOB_BRACE);
$encoded = json_encode($files);
echo $encoded;
unset($encoded);
it comes from here:
http://tympanus.net/codrops/2010/06/27/beautiful-photo-stack-gallery-with-jquery-and-css3/
but I honestly would not know where to start
No cross-subject violation meant, just shopping where the knowledge
is...
Sorry, and thanx again
Petr
[toc] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2012-02-08 17:02 -0500 |
| Message-ID | <jgure4$3oj$1@dont-email.me> |
| In reply to | #4765 |
On 2/8/2012 4:40 PM, Pettt[CZ] wrote:
> Guys, this is your humble ASP colleague asking for help.
> I have no experience with PHP and I need this 6 line page translated
> to ASP
>
> $location = 'albums';
> $album_name = $_GET['album_name'];
> $files = glob($location . '/' . $album_name . '/*.{jpg,gif,png}',
> GLOB_BRACE);
> $encoded = json_encode($files);
> echo $encoded;
> unset($encoded);
>
> it comes from here:
> http://tympanus.net/codrops/2010/06/27/beautiful-photo-stack-gallery-with-jquery-and-css3/
> but I honestly would not know where to start
>
> No cross-subject violation meant, just shopping where the knowledge
> is...
> Sorry, and thanx again
>
> Petr
You'll do better asking in an asp newsgroup, since that's your target.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2012-02-09 03:06 +0000 |
| Message-ID | <4f33384e$0$18458$a8266bb1@newsreader.readnews.com> |
| In reply to | #4765 |
On Wed, 08 Feb 2012 13:40:42 -0800, Pettt[CZ] wrote:
> Guys, this is your humble ASP colleague asking for help. I have no
> experience with PHP and I need this 6 line page translated to ASP
>
> $location = 'albums';
> $album_name = $_GET['album_name'];
> $files = glob($location . '/' . $album_name . '/*.{jpg,gif,png}',
> GLOB_BRACE);
> $encoded = json_encode($files);
> echo $encoded;
> unset($encoded);
>
> it comes from here:
> http://tympanus.net/codrops/2010/06/27/beautiful-photo-stack-gallery-
with-jquery-and-css3/
> but I honestly would not know where to start
>
> No cross-subject violation meant, just shopping where the knowledge
> is...
> Sorry, and thanx again
See Jerry's comments - I can try and explain what I think the code does,
but (a) I might be wrong and (b) I know nada about ASP.
It seems to be generating a json encoded list of pathnames of all files
matching 3 popular image types in a subdirectory of "albums" that was
passed as a parameter in a get request.
The following pages should help you work your way through understanding
the php:
1) $_GET[] http://uk.php.net/manual/en/reserved.variables.get.php
2) glob() http://uk.php.net/manual/en/function.glob.php
3) string concatenation http://uk.php.net/manual/en/
language.operators.string.php
4) json_encode() http://uk.php.net/manual/en/function.json-encode.php
5) echo http://uk.php.net/manual/en/function.echo.php
6) unset http://uk.php.net/manual/en/function.unset.php
Basically, the file expects a get request that looks something like:
http://server/path/page?album_name=dirname
then given files in: "albums/dirname" with the names:
file1.gif
file2.gif
file3.jpg
file4.png
file5.png
file6.jpg
I believe that the response will look something like:
{0:"albums/dirname/file1.gif",1:"albums/dirname/file2.gif",2:"albums/
dirname/file3.jpg",3:"albums/dirname/file4.png",4:"albums/dirname/
file5.png",5:"albums/dirname/file6.jpg"}
But that's the best I can offer you.
This might give you enough of an understanding to write the equivalent
ASP code, or it might not.
Rgds
Denis McMahon
[toc] | [prev] | [next] | [standalone]
| From | "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> |
|---|---|
| Date | 2012-02-09 18:11 +0100 |
| Message-ID | <jh0uoo$dpn$1@dont-email.me> |
| In reply to | #4765 |
El 08/02/2012 22:40, Pettt[CZ] escribió/wrote:
> Guys, this is your humble ASP colleague asking for help.
> I have no experience with PHP and I need this 6 line page translated
> to ASP
>
> $location = 'albums';
> $album_name = $_GET['album_name'];
> $files = glob($location . '/' . $album_name . '/*.{jpg,gif,png}',
> GLOB_BRACE);
> $encoded = json_encode($files);
> echo $encoded;
> unset($encoded);
If I recall correctly, ASP was already abandoned when JSON was invented
so you'll have to write your own JSON routines.
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
[toc] | [prev] | [next] | [standalone]
| From | Captain Paralytic <paul_lautman@yahoo.com> |
|---|---|
| Date | 2012-02-10 02:20 -0800 |
| Message-ID | <a3da8e48-5307-479d-9a79-e910e32a996d@l14g2000vbe.googlegroups.com> |
| In reply to | #4772 |
On Feb 9, 5:11 pm, "Álvaro G. Vicario"
<alvaro.NOSPAMTH...@demogracia.com.invalid> wrote:
> El 08/02/2012 22:40, Pettt[CZ] escribió/wrote:
>
> > Guys, this is your humble ASP colleague asking for help.
> > I have no experience with PHP and I need this 6 line page translated
> > to ASP
>
> > $location = 'albums';
> > $album_name = $_GET['album_name'];
> > $files = glob($location . '/' . $album_name . '/*.{jpg,gif,png}',
> > GLOB_BRACE);
> > $encoded = json_encode($files);
> > echo $encoded;
> > unset($encoded);
>
> If I recall correctly, ASP was already abandoned when JSON was invented
> so you'll have to write your own JSON routines.
There are a couple of libraries listed on http://www.json.org/ for it.
I can't recall which one of them I used when I last did an asp project
but whichever one it was, worked well (and is still working).
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web