LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-07-2005, 03:54 PM   #1
nkoplm
Member
 
Registered: May 2005
Distribution: Fedora
Posts: 92

Rep: Reputation: 15
server side include syntax help


so i made this "bash script" to fit into a webpage. it gets all the jpgs in a directory and adds them to the page as a thumbnail link to the file.
Code:
<!--#exec cmd="for i in *.jpg; do echo \<a href\=\"$i\"\>\<img src=\"$i\" width\=\"200\"\>\</a\>\<br\>$i\<br\>; done" -->
it works great. the only problem is that this quotes dont get written in. ex:
Code:
hope for:
<a href="614393-large.jpg"><img src="614393-large.jpg" width="200"></a><br>614393-large.jpg<br>
<a href="961075-large.jpg"><img src="961075-large.jpg" width="200"></a><br>961075-large.jpg<br>

but only getting:
<a href=614393-large.jpg><img src=614393-large.jpg width=200></a><br>614393-large.jpg<br>
<a href=961075-large.jpg><img src=961075-large.jpg width=200></a><br>961075-large.jpg<br>

anyone know how i can get the quote characters to show up?

thanks for the help

p.s. if the script is run in a bash terminal the quotes show up.

Last edited by nkoplm; 11-07-2005 at 03:59 PM.
 
Old 11-08-2005, 09:53 AM   #2
destuxor
Member
 
Registered: Oct 2005
Posts: 51

Rep: Reputation: 16
Whew, I'd be terrified to put a command that complicated into a web application...I've always been absolutely paranoid about my "system()" commands in what Perl webpages I write. But anyways, you can most likely escape the quotation marks like this:
Code:
<!--#exec cmd=\"for i in *.jpg; do echo \<a href\=\"$i\"\>\<img src=\"$i\" width\=\"200\"\>\</a\>\<br\>$i\<br\>; done\" -->
I guess this is in PHP? If what I mentioned didn't work you can grab an array of the files themselves and loop through them within the script (plus, it'd be portable).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
server side jhon Linux - Networking 1 09-01-2004 11:59 AM
help with client side NFS-firewall setup and server side NIS-firewall setup niverson Linux - Networking 3 02-02-2004 08:52 AM
Server Side Includes warlock33 Linux - Software 2 02-13-2003 12:58 AM
Server side stuff=php Rawhead Linux - General 3 09-07-2002 10:42 AM
Server Side Image Animation? Opcode Linux - General 2 06-07-2002 01:53 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration