|
You dont necessarily have to have a seperate PHP page/script serve up the image, you could base64 encode the stream and embed it into your markup as you asked.
Assuming you have a variable, for example $imagestream that equals the image field from your table row access routine, you could do this:
<?php
echo '<a href="?"><img src="data:image/jpg;base64,' . base64_encode($imagestream) . '" alt="?" style="width: 50px; height: 50px;">';
?>
This works well for reasonably small to medium images, but be aware of two things:
The page load time is increased as the image data is encoded in the HTML (actually bloated).
Be sure your mime type is correct for the image.
|
|
|
|
|
hi please help me ;
i have html page and i need export doc with this
|
|
|
|
|
It sound like you want to use php to convert an html page to a microsoft word file (aka *.doc).
Never done that myself, but a *.doc is just a file type and so if you read up on how the file is structured you can write code to do this.
First though, you need to understand the file structure. You can google for this information as there are many people that have asked this same question. Here is one link that I found with a simple google search. http://blogs.technet.com/b/srd/archive/2008/07/18/how-to-parse-doc-file-format.aspx[^]
Good Hunting!
Chris J
www.redash.org
|
|
|
|
|
Adding with you:
The op will have to do two parsing:
1. Compound Document format. This is described well in OpenOffice.
2. how to read data from the stream read from compound file. Its also available in OpenOffice.org
Actually file like excel, doc are written in compound document format. The format specification is open.
I know I am coward since the day I know that fortune favors the brave
|
|
|
|
|
|
|
Hi I am wondering if there is a way to compile the php source code like java programming language, so that user can't see the source code.
Please help me
waiting to hear from you.
|
|
|
|
|
Most PHP platforms allow you to compile and build PHP source into an EXE file. Check the documentation of your PHP platform.
|
|
|
|
|
thanks for replying Luc,
have you got any source which I can use it to do this?
waiting to hear from you.
|
|
|
|
|
You can try "HipHop for PHP", which is a PHP Compiler developed by Facebook that is now open source:
http://en.wikipedia.org/wiki/HipHop_for_PHP[^]
There is also Phalanger which is a compiler developed by Charles University in Prague which is supported by Microsoft:
http://www.php-compiler.net/[^]
There are certainly others, but those are my two favorites.
Pete
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
m too interested on the subject matter.
Would be more helpful if you provided some links for us
|
|
|
|
|
i need export doc from html in php
|
|
|
|
|
I'm not sure how to do that, especially without the usage of some external library. If you have access to write a Perl CGI script, there might be a Word library you could include, but I'm not sure.
If I had to do that, I would probably go for trying to export it as a RTF document as the file format is plain text (sort of like an analog of what HTML is to web pages). If I'm not mistaken, DOC files are actually compressed ZIP files that contain all the images, text, and metadata that describe the document.
|
|
|
|
|
I've been looking around for learning to program in assembler on linux. I'm completely new to assembler. Amazon has several books, but I've been mistaken on what is a "good" book before. I've resolved to buy at least 2.
Anyone have any recommendations on a good one or two that I can look for specifically?
-- edit/update--
I found this: Assembly book
I'm still going to pick up a couple more, but this has been very helpful so far. It already gave me much of what I was missing in understanding.
-- end edit --
modified 12-Jan-12 22:02pm.
|
|
|
|
|
First hit on google:
Found this pretty useful for learning assembly in general.
http://asm.sourceforge.net/[^]
If you're looking for s good assembler try yasm or fasm. GAS has a funny syntax.
|
|
|
|
|
Thanks for the link. I've settled in to nasm as my first choice. I've written 2 full assembler programs so far, the most complicated being asking for 2 numbers and then outputting the sum. I have an understanding of what I have done so far, so I'm happy with it
I have to re-read the parts on the mathematical stuff with signed and unsigned so I can do the equivelant of if's/loops . It didn't sink in completely the first time.
I'm very much enjoying this !
-- edit --
The problem I was having with the first couple resources I tried was that they all assume you know more than I did. I had no degree of expertise/understanding for assembler. Yes, I could have learned it with enough time with the other resources, but the book I found is.... well, exactly what I was looking for. It is very much begginner.
I will be buying the other books as soon as I'm done with this one. At that time I think I will do better at understanding them. And what's learning to program without at least 2-3 books on the subject
-- end edit --
|
|
|
|
|
i honestly wouldnt invest a massivae amount of tie into learning ASM. the most you are ever going to use it is a few inline asm lines in between 1000's of lines of C / C++
|
|
|
|
|
It's more educational than anything else. I don't know how much (or if) I will use it later, but I want to learn and understand it.
|
|
|
|
|
I learned assembly in college (MIPS instruction set) and have yet to use it... it's good to know what's going on behind the scenes but it's awfully hard to write anything useful in assembly. With that said, knowledge is power!
|
|
|
|
|
Yeah, I went to the local college and took all the programming courses they offered. I was non-degree seeking. Without going to the university I missed out on some of the good stuff like compilers, assembler, writing an OS. I'm trying to spend some of my free time at home learning some of that stuff.
I completely agree about the length and difficulty with writing much in assembler.
|
|
|
|
|
Unless you're planning on writing a compiler/assembler/optimizer... probably not worth spending more than a semester's worth of time on it. Like I said though... knowledge is power. I hate seeing people on this site that only know really abstract languages like C#, Java, and scripting... since they seem to lose touch with what's going on with their code behind the scenes.
|
|
|
|
|
I don't mind abstract languages. I don't like doing things that I don't understand the workings of though (to a degree). I learned c and c++ first, so I usually want understand how I would do it there.
I know c (none of the really fancy stuff), c++ - probably just intermediate, javascript, jquery, c#,vb.net, wcf (basics..only written one service professionaly), vba, vb6, vbscript, classic asp, some very basic dos batch stuff, bash scripting, perl, php, Java, sql, er.. off the top of my head that is it. I know, compared to the people here I'm a noob
I am working on understanding assembler, doing some cool game programming tinkering, and a few other things right now at home. I want to do some more data structures, write a -very- simple virtual machine and implement scripting (I saw a project similar to what I want to do with that here on cp).
In the future I want to be able to do my own implementation of a unix clone as seen here:
http://www.jamesmolloy.co.uk/tutorial_html/[^]
and by then I hope to have found other things that I missed out on. I may not have missed out, but a friend of mine was at a university and did all these things. I did not have the opportunity to go. I hope to gain a better understanding of computers and programming by doing these.
Ultimately my only real personal goal is to make a 3d game I'm behind on mathematics though, and need to do some things while I'm catching up!
|
|
|
|
|
Good luck on your endeavors! ...nice to see ambitious people around
|
|
|
|
|
Hi to all ,
I don't have sufficient idea about socket programming but what clear is that i want to create a pro gramme that do the live streaming. Means i want to display live recording from mobile to website.
I don't have much more idea about how to do that, can any one please help me. I know something about the java client-server application with socket programming. Even i can create socket and start recording from the mobile device but i can understand how to read and display that data in php.
Please help me and give me some guidance asap.
Thank you.
Regards,
Avani
|
|
|
|
|
What you mean is you want to do the streaming of video/audio.
Here is some issues you need to know
1. php is a server site scripting not server itself.
2. php will not do anything unless it get request from the client
3. you can build a server using php(!!!!!???) but it wont run long cause PHP itself dont let a script run more than certain period.
4. You need to learn how to build server.
5. You need to learn how to implement Real Time Streaming Protocol
6. You will need to know about video/audio file formats so that you can stream them
Finally I am not saying you cannot. I am saying it wont be a easy task. Good luck
Anyway, If you search on Google about stream you might get some free source code
|
|
|
|