script display

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Lynxx
Forum Newbie
Posts: 3
Joined: Thu Sep 02, 2004 12:49 am

script display

Post by Lynxx »

I found something i liked and tried to get the guy to explain it to me but i dont understand the explination so i am asking if someone can help me get it to work here as he speaks german and i do not.

It is a cool code can be found in action here:
http://sourceshock.com/details_snippet.php?id=27

he tried to explain it here:
http://www.sourceshock.com/forum/topic. ... id=1&hid=1

thanks in advance! :P
i know its simple im just new and not sure which var should contain the code i am trying to display
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

  1. lines:
  2. start php
  3. set the filename and path to use
  4. get the filesize of the file
  5. blank
  6. tell the browser the datastream is an octet-stream (8-bit data)
  7. tell the browser how many bytes it is
  8. tell the browser it's for saving as a file, and the filename to use by default
  9. tell the browser it's a binary transfer
  10. open the file
  11. toss the file at the browser
  12. I don't see any code after this..
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

[php_man]highlight-string[/php_man]

I thought this forum had also those cute

Code: Select all

tags, so i wanted those in my phpBB based cms too... As i used [url]http://pear.php.net[/url] HTML_BBCodeParser, i wrote a little plugin for it: [url]http://home.mysth.be/~timvw/programming/php/PHPsource.txt[/url]
Lynxx
Forum Newbie
Posts: 3
Joined: Thu Sep 02, 2004 12:49 am

Post by Lynxx »

feyd wrote:
  1. lines:
  2. start php
  3. set the filename and path to use
  4. get the filesize of the file
  5. blank
  6. tell the browser the datastream is an octet-stream (8-bit data)
  7. tell the browser how many bytes it is
  8. tell the browser it's for saving as a file, and the filename to use by default
  9. tell the browser it's a binary transfer
  10. open the file
  11. toss the file at the browser
  12. I don't see any code after this..
if you got that from the first link thats just an example of the script in action the code its displaying is a force downloader he shows the code for it in the second link
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yeah.. the second link is just a highlight_string tool. Much like our

Code: Select all

tags.

Hopefully, I can get around to updating it soon and post the code snippets.. maybe a tutorial.. I dunno on that front.
Lynxx
Forum Newbie
Posts: 3
Joined: Thu Sep 02, 2004 12:49 am

Post by Lynxx »

yea thats all i am really looking for to display some c scripts on a webpage

i generally understand what the scripts are doing i just dont understand where in any of the highlight codes does it let you input the code you want it to display
Post Reply