Using Php Generated Pictures With HTML?
I am able to create images with the use of the GDLIB. but I am not able to use these images together with HTML. I always get the message "headers are already sent.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Storing Pictures Generated Witn GD
I'm trying to make php store a picture (on the server) that have been resized by GD. The picture is downloaded from a browser. But I would like to store this file in different sizes. To save downloadtime and cpu-power I wish to do this only once while downloading the file to the server.I can resize files, but I'm unable to store them.
Embed Php Generated Html In Another Html Page
I am trying to include some php generated html in a page that is just a standard html file, NOT a php file. I have seen other html pages do this by including an src to the cgi script in script tags, like this: <script src="http://someurl.com/somescript.cgi"></script> the html page loads and the script is executed and the returned html is displayed in the calling page. So, I tried this: <script src="http://someurl.com/somescript.php"></script> It doesnt work!!
Php File As String Generated To Html
I have a page going on a local server but the pages are going to be hosted on another server, which doesn't support php and MySQL. So basicly have to generate the php files into html files. The pages on the localserver are all based on a template page Main.php?Cat=Home So this is what I'm trying to do. either...open the php template pages in another file then write them as html or...export the php template as html when viewed.So far all I got to see is resource id # 1 Just a little push on the file handling as a string would be much appriciated.
Displaying Html Code On PHP Generated Page
I am trying to create a link page in my php application. this is a page that will display a block of html code that a visitor can copy and paste into their web site to create a link back to mine. My PHP page has a line in it like this: define('TEXT_INFORMATION', '<html page code is here>'); I have added the html code to create the page as noted above. the page contains a same of the banner image file and the html code that goes alon with it. My problem is that I haven't been able to "quote" the html code so that ir will not be executed. every time I try to run the application from my web server my page will display two copies of the banner iimage not on banner image and text block like it should. Any suggestions?
PHP System To Allow User-generated HTML Profile Pages...
Has anyone created or modified an existing codebase to allow users the option to create personal pages as part of their login profile? I'd love to offers users the potential to upload single HTML pages ++ images for their profile... I suppose this would require: 1. A form to accept the HTML page + images and other content 2. A php script to parse the HTML and remove any headers, and to add site headers 3. The same script to parse out any malicious php or java code 4. ... and to store everything in a database. Has anyone done this, or have suggestions about how to do it? Are there any codebases out there I should check out?
Pictures In A DB
I am working on a website where people register to model for photogrpahers. As they register, I want them added to a list of other models, which will be stored in a DB, and retrieved with PHP. I would like to create a <table> setting, and have PHP list out their names in alphabetical order. My question is this. Do I put the pictures into the DB (MySQL), or keep them in a separate directory? I would then use a foreach statement to build the <table> sequence and the rest of the page.
MB/KB Of Pictures
I have an image gallery and want to have a php script that shows how much MB/KB of pictures have been served that day. I am guessing that you just read how much a certain directory has been accessed and count that.
Downloading Pictures
I'm trying to download a gif image from the web and save to my servers hard drive. But I can't seem to fetch it correctly. I'm trying with.
Uploading 2MB+ Pictures
I have a site that has a picture album. It is hosted and I believe the php.ini file is set at the default of 2MB limit per file. With 5MP+ cameras out there many people have pictures that are over 2MB straight off the camera. As a convenience to the user, I would like to let them upload the pictures immediately after they pull them from the camera. I have the pictures resized to around 50k once they are on the server to conserve space and bandwidth. Unfortunately, I can't even get the files over 2MB onto the server. As you know, many people are clueless about resizing their pictures and won't go to the trouble. I want them to be able to use my site. Does anyone have any good tricks to move 2MB+ files?
Including Pictures Via PHP
Is there any way of including a jpg or gif file through php without using the code below? <?php include("/images/$id.jpg"); ?>
Pictures From XML File.
I've been able to parse the XML files used to update my database. Now, I receive image in XML files, like this: <PICTURES COUNT="3" CDATA="1"> <PIC NR="1"><![CDATA[/9j/4AAQSkZJ.....=]]></PIC> <PIC NR="2"><![CDATA[/9j/4AAQSk.............></PIC> <PIC NR="3"><![CDATA[/9j/4AAQSk.............></PIC> </PICTURES> How to save those 3 images in 3 jpg files ?
Pictures In MySQL
I am creating a code out of bits and pieces I found in somebody else's code, so I am not entirely sure how it behaves. <IMG SRC="picture.php?ID=1029&THUMB=yes"> picture.php: <? Header( "Content-type: image/jpg"); $linkID = mysql_connect("host", "user", "password"); mysql_select_db("database", $linkID); if(isset($_GET['ID'])){$ID=$_GET['ID'];}else{$ID=0;} $result=mysql_query("SELECT * FROM picture_base WHERE ID=$ID") or die("Can't perform Query"); $row=mysql_fetch_object($result); if(isset( $_GET['THUMB']){echo $row->THUMB}else{echo $row->IMG;} ?> The script works and displays pictures properly so I am happy with it. Its small and simple enough, my question is if not every site is saving their pictures in databases there must be a reason why, yes? And if I load picture.php?ID=1029&THUMB=yes as opposed to picture.php? ID=1029, will the script still load through the full sized image (in the IMG collum) and will that effect my traffic?
Random Pictures
i want to display random pictures every time a page is loaded, but i dont want the same ones shown again. so I setup a database and a 20 year unique id cookie and i log the id's of the pics shown in the db. now the problem is, that i use mt_rand to generate an id and show that picture. if the id has already been shown, by querying the db, what is the best way to get another random number that isn't in the db? do i have to do some kind of loop and getting generating random numbers until one isn't in the db yet? this might take a while if the user has almost seen all of them, it might take a while to get a random number that isn't one of the others.
Uploading Pictures
I want to create a web site where the user uploads photos. What is the proper way (I'm using php) to do this? I want to make sure the user doesn't upload viruses instead of pictures. Also want to be able to shape the pictures so that they are all the same size, no matter what size they are when the user uploads them.
Uploading Pictures
im trying to upload pictures but it does not record it in the database that a file has been attached for a particular bulletin. Dont want to view it, just record that its been attached. Code:
Pictures In A News-site
I'm going to start a news-system. I planned the database, but I'm not sure how to place the images into a generated form. The database (partial) is: article_id int author_id int date date title varchar (50) body varchar --> here comes the html source links, etc... It is a good way to place the image path into the html (img src...) and store the images in a specified directory, or easier to place the binary file into the database (pgsql)?? what is better for the body, the article in a html file, and in the database only the link or the html source in the database.
Issue With Cache And Pictures
I have a problem with cached images... The script first creates some pictures out of avariable source (every time the script runs the pics are different): $im = imagecreatefromjpeg($file); imagejpeg($im2,"temp100.jpg",100); imagejpeg($im2,"temp75.jpg",75); imagejpeg($im2,"temp50.jpg",50); imagejpeg($im2,"temp25.jpg",25); then I show them using normal html img tags <img src="temp100.jpg"> The problem is that the pictures are cached and the script/IE shows a fautlhy version of the pictures. I tried messing with the header as described in the php manual. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); But this doesn't work... wrong pic-fileversion Does anybody has a sollution?
Uploading Pictures In PHP/MySQL
Does anyone know of a good tutorial that works or some sample code that works for this function? 1. Load photo to a file folder on the server 2. Load photo name to the mysql database 3. Resize photo on upload to a specific size I have found tutorials and sample code, but they don't work.
How To Thumbnail 1000s Of Pictures
I have a directory on my box with over 1000 pictures on. Now i wanna make a thumbnail of every picture,I started out just programming away, got all the names of the ".jpg" into an array and then looped throug while using the "ImageCopyResized" function first i got a timeout from the server saying ot took more than 30 secs to execute my script, then i used the "set_time_limit" function! But it still stops after having made about 50 thumbnails, i can't figure out whats wrong!! does anybody have any experience with this kind of operations??
User Uploading Pictures
I have a web site I am developing, and have a question. I would like members to be able to upload pictures. Do you think they should be saved as individual files or should they be put in an MySQL database? Which would you recommend, and do you have any sample code for accomplishing this?
Access Pictures From MySQL.
I'm planning on letting my users add pictures to their pages using the browser upload method. My question is, which is better? adding the picture to the database? or storing them on a separte directory and add a link to the page? I also will be letting each user have quota on the disk space.
Clicking Pictures To Appear In The Textarea.
I am trying to do a function where you click on the images and these are entered into the textarea. Exactly as if i was clicking on this above and it enters the code for the picture into this textarea.
Upload And Resize 2 Pictures
how can I upload and resize 2 or more pict in same time: if($_FILES["picture"]["name"][1]) { $dest = "../photo_dir/".$document_id."_photo[1].jpg"; copy($_FILES["picture"]["tmp_name"][1], $dest); } if($_FILES["picture"]["name"][2]) { $dest = "../photo_dir/".$document_id."_photo[2].jpg"; copy($_FILES["picture"]["tmp_name"][2], $dest); } ... but I want to these pictures been resized from original size (no matter what size) on upload to x= 100px y=100px - or other dimension.
Reading Pictures In A Folder
I'm trying to make a simple way to make a dynamic photo gallery function. This is my idea: First have a folder called Pics, in pics is a folder for images of different type (the criteria fun,events,nature) then in there I dump the images sorted by types in there with a basic numbering scheme of 01.jpg,02.jpg,03.jpg,04.jpg. Anyone got any ideas on a way I can read all the pictures in the subfolders and view them without having to give a count of images?
How Does Uploading Pictures Work?
Like myspace how does it "upload" the images I got a form to give it a try but was wondering as I am using local host I want to test it by uploading to my own hard drive as such... but unfamiliar on 2 things... 1) where should it be stored in the htdocs directory precisely? 2) how do sites like myspace etc with hundreds of pictures on their server's know which image is related to which profile ? Is it possible to test on local host? Or will i have to buy a real server firstly?
Load Multiple Pictures Into MySQL?
I'm trying to create a picture database for a site that I'm working on and I would like to do the following: - (main goal) Have a php script load an entire directory of photos into my mysql database in one swoop. - Display thumbnails on a general viewing page. - allow for viewing individual pictures by clicking on the thumbnails. <?php error_reporting(E_ALL); $id = $_REQUEST["iid"]; $link = mysql_connect("localhost", "root", "") or die("Could not connect: " . mysql_error()); mysql_select_db("mysql") or die(mysql_error()); $sql = "SELECT b1 FROM t1 where id in (1,2,3)"; $result = mysql_query("$sql") or die("Invalid query: " . mysql_error()); header("Content-type: image/jpeg"); while ($row = mysql_fetch_array($result)) { $fileContent = $row['b1']; $im = imagecreatefromstring($fileContent); $width = imagesx($im); $height = imagesy($im); $imgw = 50; $imgh = $height / $width * $imgw; $thumb = ImageCreate($imgw,$imgh); ImageCopyResized($thumb,$im,0,0,0,0,$imgw,$imgh,Im ageSX($im),ImageSY($im)); ImagejpeG($thumb); imagedestroy ($im); imagedestroy ($thumb); mysql_close ($link); } ?> It is only displaying one image.
Read A Directory With 17'000 Pictures
I have the following problem with the simplified script bellow! When I start this script the first time files (~17000) are read in the /camera25 directory in less then 5 sec. When I click again on the same camera button ( second from the left), or reload button on the browser, I get a timeout from provider....
Select Pictures And Show Selected
I need to make a webpage (php) where users can select some excercises(with picture) out of 40, and then display a page with only the selected excercises (with their picture) that you can print.
Showing Pictures From A Mysql Database
I am trying to get pictures out of my database, they are not actually pictures in the database, but I think just a reference to them. I will show in my code. This is my PHP page I using to display them. Code:
Add 2-3 Pictures With Just 1 Article? (news- Publishing System)
Have a little problem here. I are about ot create an easy publishing system where the administrator can write down a happening, add some pictures and save it in a mysql db. I have created the article table, but my real problem is how to "connect" the pictures with the article? what should i use to get them connected to just one article? As a beginning i have this db: id (unique and primary key i guess i should set this to) when (the date event will happen) added (date of when the news where added) shortversion (a brief summary to use on the first page) maintext (the article and rest of the text.) then the problem: how to include images with this? 1. little thumbnail to use on the first page (about 50*50xp) and then some pictures to use inside the article, larger around 150. From 0 to a 2-3 should be possible. guess i should use a own table for the images, but how to link them with each other my head and I can just not understand så any help are appriciated !
Changing Pictures On Index-page When Reloading
I am a beginner but quite curious anyway. My problem: I have seen websites that show different pictures whenever you enter the site. By doing this, the sites look always fresh and attractive and I like the idea a lot. Now I like to have the same function on my site but I do not know how that works... Is there anybody who can give a good "explanation for dummies" on how to do that?
Upload And Resize Pictures With Path In Database
First I've must say Im completly new in php scripting What I need to do is upload, resize pictures with path in database Here is theory of it, and plan of doing it Hope somebody can help me here are 4 sizes of images: - newimagename1_1 with size W=100 and H=67 - newimagename2_2, newimagename3_3, newimagename4_4, newimagename5_5, newimagename6_6 with size W=308, H=208 - newimagename1 size W=308, H=208 - newimagename2, newimagename3, newimagename4, newimagename5, newimagename6 size W=500 and H=375 Code should go in this order: - check if folder with name "ID_of_user" exists - if it exists than upload images to it, if it doesn't then create it and upload images - array (image1, image2, image3, image4, image5, image6) - foreach(array) - if size of images are biger than W=500 and H=375 than resize them to W=500 and H=375m, if are not leave them as they are - copy (resized) images to same users folder with name "newimagename.jpg" - array (newimagename2, newimagename3, newimagename4, newimagename5, newimagename6) - for (newimagename1) - resize newimagename1 to W=308, H=208 - copy newimagename1 to same users folder with new name "newimagename1_1.jpg" - resize "newimagename1_1.jpg" to W=100 and H=67 - foreach(array) - resize array to W=150 and H=100 and copy them resized to same user folder with name "newimagename2_2, newimagename3_3, newimagename4_4, newimagename5_5, newimagename6_6" - conect to database - insert into database path of images (image1, image2, image3, image4, image5, image6, image7) values (newimagename1_1, newimagename2_2, newimagename3_3, newimagename4_4, newimagename5_5, newimagename6_6) - Delete (image1, image2, image3, image4, image5, image6) - Display images (newimagename1, newimagename2_2, newimagename3_3, newimagename4_4, newimagename5_5, newimagename6_6) with link to biger images (newimagename1, newimagename2, newimagename3, newimagename4, newimagename5, newimagename6) - Display image newimagename1_1
Using The Same Page To Display A Hundred Pictures One Picture At A Time
I have over a hundred pictures I would like to present. Is it practical to create and parse an array of pictures, picture paths, et al using server-side scripting to accomplish this? I created an array already, and whereby, the HTML and Javascript currently used amount to about 14KB for each of four different pages, the PHP page I started working on is already over 35KB in size (most of it is server side processing creating the array of pictures). What I'd like to do, is load the array only one time, and keep that loaded so the page doesn't recreate the array each time, thus minimizing the server side array creation. Also, I think I'm running into some problems whereby the javascript is messing up Google's parsing of the page. I don't see creating 100 different html pages as an answer, in the respect if something ever changes, that's one big mess to update and major portion of the content and alot of files. Am I wrong in trying to avoid doing it via strictly HTML pages? The pages exist at, and they represent swimming pools designed by the owner of Aquatic Creations (North Carolina In-Ground Swimming Pool Designers): Custom Swimming Pool Water Features http://aquaticcreationsnc.com/lib/php/viewing0.php Custom Designed Swimming Pools http://aquaticcreationsnc.com/lib/php/viewing1.php Custom Designed Spas http://aquaticcreationsnc.com/lib/php/viewing2.php Custom Swimming Pool Features http://aquaticcreationsnc.com/lib/php/viewing3.php Stone And Tile Around Swimming Pools http://aquaticcreationsnc.com/lib/php/viewing4.php Does anyone have any suggestions on how to accomplish such or directions to pursue? If you could take a look as well and provide comments on the pages, I appreciate constructive criticism as well.
Php Script Generated By Php
I am trying generate a new PHP file from an existing page using PHP. Currently I'm using the output buffer to capture content destined for the page, and then am capturing that output and writing to a file. The problem I am having is that all PHP scripts within the new page content are executed and the results are written to the new file, when I would like the PHP code itself to be written to the new file, unprocessed. So now I am trying to just store the new page as a string and bypass the use of the output buffer, but do not know how to store php code within a string without having it execute...
How To Farmat Php-generated Table
the font size declaration seems to be ignored. Is it possible to set format for tables generated with php? <?php echo "<table border=1 font size=8>"; echo '<tr><th font size=8>Date</th> <th>IP Address</th> <th>Operating System</th> <th>Browser</th> <th>Referring Page</th> <tr>' ?>
Getting MySQL Generated Keys
I am a Java/JSP developer by trade but am currently developing a MySQL/PHP solution. In JSP when I run an INSERT statement on the db I am able to automatically get back a list of any generated keys (without having to do some sort of subsequent query to get the information). Is there a PHP equivilent of this?
Php-generated Png Transparency Issue In IE
I've been trying to get my page, which works perfectly in Firefox, to work in IE as well. one problem was getting the .png images to display properly, which was fixed by doing this: filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='imagename.png') but what of php-generated .png files? putting the php file as the src doesn't work. the php-generated images don't work at all in IE (but work fine in firefox). (the php-generated image uses a transparent color made with imagecolorallocatealpha. when I just use imagecolorallocate it shows up, but is not transparent as I want it.)
Generated PHP Web Database Forms
I'm still gaining experiance in developing PHP applications, and have completed a couple of projects already. This has prompted me to look for ways to reduce the development time for web enabled database applications. Every web database has basic operations such as add,delete,update and search. I have been creating HTML forms and processing the results with php code. I have managed to reduce the number of forms required by using the smarty template engine. I want to go a stage further and be able to produce the forms and the processing code purely by looking at some sort of schema file , or using "mysql_list_fields()" and "mysql_list_dbs()". Before I start my quest of many late nights of coding. Can any of you guys give me a head start by pointing me at a solution/hint.
Generated Images Not Printing?
I have a problem with IE and generated images (jpgraph). It displays them fine but it's not printing them. They appear as little red crosses in print preview. I've fiddled with the cache control headers as I thought that was it. Certainly IE refuses to cache pdf files sent using fpassthru and cannot open them in acrobat.
Server Generated PDF Files?
Heres what I need to happen now, I know how to do most of it, except the generated PDF form. - The server puts that information into a PDF file with a background of my chosing and emails it to a specified adress. (Its already set up to send the email) My issue is I dont know how to have the server generate the PHP form. How does it work? How do I position the text over the PDF automatically? I'm already donating $10 to the site, thanks to the help I received from UTAlan, Lytheum, and Waldir. Ill make it a total of $20 after this.
Image Src Generated Through Php File
I've built a custom image gallery, integrated with a database. all of the images are kept above the document root in a "media" directory (for security purposes); therefore, i am using a php script in the src attribute of the image tags to display the image in the browser. to accomplish this, i chose to use the PEAR package "HTTP_Download", which worked great and performed fantastically on my staging server. I chose to use content-disposition inline, and set caching options on. the problem, the images don't cache on a users machine. therefore, everytime the page is changed to display a new image, all of the thumbnails are downloaded once again...very annoying. let me re-iterate, these files are not being generated on the fly, simply sent to the user via php. Code:
Mail A Php Generated Page
I ask if it's possible to sent to email a php generated page as an html attachment or text file !? I have searched on google, but I find only how to send mail from php not hot to send a page. Any link, or doc is helpfull ! The story: I have a long products list, from where I select some items what I want to send as a price list to some people.
PHP-generated RSS Feeds And .xml Files
I want to make an RSS feed for my site. Obviously, it should be dynamic, so the only way that comes to mind is to use PHP to create the RSS. But then the filename will be .php. Most of the sites I see with feeds (digg, shoutwire, cnn, etc) have .xml files. How do they do this? I would like to have a .xml that is dynamic/always up-to-date.
|