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
Related Forum Messages:
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.
View Replies !
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!!
View Replies !
Dynamically Generated HTML
I am trying to fit dynamically generated HTML into a variable so I can mail it out to a recepient. Now - the catch is that the dynamic generated HTML contains nexted regions which mace some heavy duty use of "if" and "while" statements. Here is a code snippet example: $msgbody = "<a id="top"></a> <table width="100%" align="center"> <tr><td><span class="style3">$mailinga[analysis]</span></td></tr></table> <br />" ----> this is where the error occurs - it says unexpected T_IF <---- if I set a semicolon after the quotes above it will not include the stuff below, and I tried other combinations of symbols and googled the issue but no go - please help. ---->:( if($asnc > 0) ................
View Replies !
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.
View Replies !
Special Characters Generated Html
$input3->setAttribute("value","<?php print $_SERVER['REQUEST_URI']; ?>"); <input ... value="<?php print $_SERVER['REQUEST_URI']; ?>"> I just don't want that $lt and $gt appear on the generated html, I want my <?php and ?> back
View Replies !
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?
View Replies !
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?
View Replies !
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.
View Replies !
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.
View Replies !
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.
View Replies !
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?
View Replies !
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 ?
View Replies !
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?
View Replies !
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.
View Replies !
Pictures From MySql
im using PHPRunner and it has built a search page and etc for me and displays data from my database perfectly but i want to display pics! ive added the image name IE: picture.jpg to the picture field in my database but im not sure where to go from there because the code that PHPRunner creates is unlike anything ive seen before. Code:
View Replies !
Moving Pictures
I am using this code to move one picture to my server. Part of the code: if ($pic_size > 0) { mkdir("$dir/$date", 0777); $upload_file = system("/bin/cp $pic $dir/$date/big$fname", $retval); $convert = system("convert -scale 320x240 $pic $dir/$date/small$fname", $ret); $convert = system("convert -scale 160x120 $pic $dir/$date/thumbnail$fname", $ret); if ($retval==0) { " The $pic I take from the form. How can I move whole folder instead of one file?
View Replies !
Uploading Pictures
Does any have a fully working example of a form that let's you upload ANY picture, or the most commons formats like jpeg, gif, tif to a webserver, the pictures should be saved into a directory and the pic should be associated to a certain user so later the user can review what pictures did he upload. Then this picture review should be in thumnails so it doesn't take too much to preview the images saved.
View Replies !
Dynamic Pictures
One question that I cannot figure out - I am using PHP and mysql. I created my database design. When a customer enters in a phone number, I want to return a table. I can do this. But column number #1 is a .gif, or a picture of the person. Do I embed the URL for the .gif in the table as a value I select? Hope this was not too 'foggy'. After 3 days of studying, I have gone from a 1 beginnner in PHP to a 2. =).
View Replies !
Resize Pictures
I got this code from some where and dont remember where but I cant get it to work. I get a Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING on line 8. Also to save another thread can this be made to resize any picture insted of just jpgs. also insted of setting the size to 600 x 442 can that be 600 x what ever is Proportion. I know this is a lot of questions, but Im new and trying to save some threading here. PHP Code: <?php // Max height and width $max_width = 600; $max_height = 442; // Path to your jpeg $upfile '/myhome/yappys/public_html/uploads/' Header("Content-type: image/jpg"); $size = GetImageSize($upfile); // Read the size ....................
View Replies !
Pictures In Tables In Php
I was wondering how you can insert a picture in the background of a table. I am doing a project for school. It is a pos system and i wanted to put a watermark in the background of one of the tables. Can you tell me how that could be done.
View Replies !
Pictures Won't Display
I've created the entire site with no pictures, only focusing on the text functionality and code. once i finished the draft project i start inserting images into the html code and started designing the site (using dreamweaver mx on windows xp, with mysql, phptriad). when i test the site none of the picutres show up what's wrong? is there something in the php.ini that must be configured.
View Replies !
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.
View Replies !
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?
View Replies !
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.
View Replies !
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??
View Replies !
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?
View Replies !
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.
View Replies !
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.
View Replies !
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?
View Replies !
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?
View Replies !
Showing Array Of Pictures
I'm working on this project(game), I did all the code, but I can't tell if it is what required or not, because I failed to show the images that are stored in the array Code:
View Replies !
Unzippinmg A File Containing Pictures
I have a set of files that is are .tar they contain jpg files. I need to be able to uncompress the file , get the picture file names so I can store the names in a data base and also save the file on the server. I am doing this with a text file. FTP unzip read parse and save the fields to a database. All files are on a ftp server and that part I can do. The tar files with text I have no problem with. I can get them save them unzip and parse and save the data to a mysql database, but the ones that contain pictures I am at a loss. I have tried the same methods as with the text but I don't get file names I get the binary data of the pictures. I am using $fp = gzopen($local_file, "r"); the text is contained in a .gz file. the pictures are in a tar file. I have tried a variety of things, but no luck. I need to get the picture names store them in a database and save each picture to the server so that I can call them up later.
View Replies !
Optimize Pictures On Unix
I currently have to deal with all the uploading of product pictures myself. I would like to add to my back end PHP program the functions to allow my employees to do it. So I will need to be able to have a program that does several processes that I currently do manually. I need a program that will run on my unix server that I can call by command line and it will Resize the picture. I need to 2 copies. One that is max 350 x 350 and a thumbnail that is 100 x 100. Keeping tha aspect ratio correct and Optimize the graphic for fast loading. Does anyone know of a program like this?
View Replies !
Difficulties Creating PNG Pictures
I have a web page in which I create a simple PNG picture using PHP. It was correctly displayed until I upgrade my PC (Linux/Mandrake 9.1). Now my little picture is a black square. Anyone knows the reason?
View Replies !
Tables - Display 10 Pictures
I m doing pagination, I was wondering if someone could help me? i'm kind of stuck. how do i display 10 pictures, but have 5 picture in the first row, and 5 the row right below it? but still work with pagination? here is code i got so far: Quoteecho "<div align='center'>"; echo "<table border='1' width='400'>"; echo "<tr>"; echo "<td>dask</td>"; while($row = mysql_fetch_array($sql)){ echo "<td width='10%'align='center'><font color='#FFFFFF'>"; echo "<table border='1' width='100%'>"; echo "<tr><td><font color='#FFFFFF'><center>"; echo "<img src='{$row['pix1']}' border='0' width='115' height='140' [/url]"; echo "</center></td></tr>"; echo "</table>"; echo "</td>"; }
View Replies !
Uploading Pictures Using A Form
I am attemptng to up load pictures from the web site using move_uploaded_file It is a standard script taken from a PHP book, however, It keeps coming up with the following Warning. : failed to open stream: Permission denied in.
View Replies !
Drop Down Menu Of Pictures
I will be here for a long time to help others. You have to share your knowledge. Anyhoo, I would like to know if this is possible: Drop Down Menu of Pictures. Choose your host: (drop down menu of host faces). Keep in mind I'm totally new to PHP so if my question is really stupid, please don't hurt my feelings.
View Replies !
Random Pictures From MYSQL
I'm trying to develop some code that will display a table 4x5 with a diffrent random picture in each table cell. The code below selects 20 random rows from my pictures table and creates a record set. I then use 2 loops one that repeats 4 times and one that repeats 5 times (to create the rows and coloums respetivly). This gives me 20 cells. The record set then contains 20 paths to images, i would like to put a diffrent path in each cell. PHP Code: <?php $picquery = "SELECT * FROM pic ORDER BY RAND() LIMIT 20";Â Â $picresult = mysql_query($picquery);Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â $row = mysql_fetch_assoc($picresult)Â Â ?> <table width="800" border="1" align="center" cellpadding="0" cellspacing="0">Â Â Â Â Â <tr align="left" bgcolor="#FFFFFF"> <td height="253" valign="top" bgcolor="#FFFFFF"><p></p>Â Â <table width="510" height="300" border="1" cellspacing="0" cellpadding="2" bgcolor="#FFFFFF"> ........
View Replies !
Display Pictures Located In The Folder
I am trying to display pictures located in the folder...i create a link <a href="ViewPictures.php?ImagePath=<?= $row["imagepath"];?>">View</a> which stores the path of the image in the database and retreive it in another php page.the problem is i am new and i don't know how to display the picture.
View Replies !
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.
View Replies !
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....
View Replies !
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.
View Replies !
|