Are Multiple GD Generated Images Possible On One Page?
I've been experimenting with generating PNG files via PHP and GD. All was going fine, until I tried to put more than one image on a single page.
<img src="draw.php?text=Picture1"><br>
<img src="draw.php?text=Picture2"><br>
<img src="draw.php?text=Picture3"><br>
The example above produced 3 images, but they all have 'Picture3' on them. Seems like theres only 1 temp storage area for the images?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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.
Generated Images Vs Image File...which Is Better?
Shall we say you want to creae a banner, a button, and other images for your site. some create images on the fly through php using gd library. is this more advisable or more efficient compared to creating an image file (.jpg) shall we say using photoshop?
Script-generated Images And Internet Explorer
I wrote a small script that is supposed to get an image from a database and return it to the user. The relevant part looks like this: <?php [...] header('Content-type: image/jpeg'); header('Content-Disposition: inline; filename=".$image_name".); print $image; ?> This works fine in mozilla (and I guess netscape as well), but IE displays the image as bitmap, regardless which instructions I send out to it. It actually seems to decompress the jpeg back to bitmap before displaying, because even if I try to save the file as jpeg it writes it in bitmap. I though that these headers were pretty standard, and I am really puzzled as to why IE doesn't take them into consideration.
Multiple Submit Buttons In Dynamically Generated Form
I have one big form on a page, within which is a list of text fields pulled from a mysql db. Each text field has an 'update' button, which submits the main form, and should UPDATE the textfield it relates to. The problem is, all the buttons have value="Update" and I can't think of an efficient way of passing the unique id of each record to be submitted with it. Obviously, having a hidden field for each textfield won't work because the form will use the last one displayed.
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.
Writing A PHP And Javascript Generated Page To A PHP Variable...
I have a form that posts data to a PHP mailer page I have created. When it goes to the PHP mailer page it reads some of the data and modifies the page accordingly using Javascript (hiding certain divs, etc...). My goal, is to take all this data after it has been processed by Javascript and send it through my PHP mailer as it is currently formatted. If it helps any, the track I am on right now involves encapsulating the Javascript processed block in a div. I am then trying to take the ..innerHTML data from that div and store it in the PHP $message variable for my mailer. This won't work because PHP is server side. So, I moved on to generate some Javascript code (with PHP) that sends all that messy HTML data that its processed through a URL variable to then be read by PHP. This doesn't really accomplish what I want as it cuts off about a quarter of the way through my data...... Any ideas? One thing I thought of but don't know how to do or whether it's even possible is using PHP to view the source of the current page and store that as the HTML to be e-mailed. Or, is it possible to do something similar to .innerHTML with PHP?
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?
Multiple Images
I was wondering if there was a way in php to show an image like this: Code: <ing src="showimg.php?img=header.gif"> Is it possible to have the image located at www.mysite.com/images/header.gif show, even thoug it doesn't give that url?
Problems With Multiple Images Created From Gd2
Here's what i originally set out to do: i created a function called autoThumb: function autoThumb($imgPath, $thumbWidth) { $im = ImageCreateFromJpeg($imgPath); //get source dimensions $sourceWidth = ImagesX($im); $sourceHeight = ImagesY($im); $proportion = $thumbWidth/$sourceWidth; $thumbHeight = round($sourceHeight*$proportion); $thumbImg = ImageCreateTrueColor($thumbWidth, $thumbHeight); ImageCopyResized($thumbImg, $im, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $sourceWidth, $sourceHeight); echo('<img src="'.ImageJpeg($thumbImg).'">'); ImageDestroy($thumbImg); ImageDestroy($im); }//end autoThumb obviously, it's purpose is to create a thumbnail of a pic given the path to the pic and the desired thumbnail width. the first time i call the function, everything seems to go fine. autoThumb("../imgs/guitar.jpg", 160); but if i call it a second time autoThumb("../imgs/guitar.jpg", 160); the second image doesn't display. furthermore, if i put any text before the autoThumb call, the image doesn't display - only the code of the jpg.
Creating An Image Out Of Multiple Images
I'm designing an application where I want to create a dynamic image out of a matrix of small images, selected by some complex mysql-queries. The small images, each are 30x30 pixels, and the size of the big image will be approx. 300x270 pixels. (so there will be 10 rows, and 9 cols of images) My question: How do I import the small images en embed them into a new, big image?
Creating An Image Out Of Multiple Images
I have some questions regarding image manipulation: - Is it possible add an alpha channel to an image via PHP? - Can I multiply an image with another image creating a new image? I want to create border with transparency around images uploaded to an photalbum.
Uploading Multiple Images In An Array
I'm putting a gallery script together and I'd like to upload multiple images at once. The form goes through a while loop and prints out the html form like this: PHP Code:
PHP To Resize Multiple Images, After Upload
Some guys with a website have asked me to present their uploaded images on their site as resized thumbnails with correct aspect ratio. So they upload their images as 680x400, and then a php page calls a mySQL table which has the names, paths and details of the images stored. The images (6 per page) are then presented on the page using simple html . <img src=whereever width="160" height="120" /> But the images are very "blocky" or "pixelated" on the page I've seen some solutions that use the php header function, which works fine with 1 image, but if there are multiple images, i get errors.
Problem Resizing Multiple Images
I'm using the code below to loop through some images and resize each image twice, once to create a thumbnail and once to create a small image. The page stops loading around the 38th image out of 40+. Not always the same place but it's either 38th or 39th image, which I find strange as it's not consistent. At first I thought it was a timeout problem so I added - set_time_limit(0); and ignore_user_abort (true); to prevent it timing out, there was no 'connection timeout' error or similar, there have been no printed errors. I've tried running the same loop but commenting out one of the resize functions, when I do this the page completes and all the images are resized correctly, then I comment out the other resize function and again that worked, so I don't believe that there is a problem with the images. Which leaves a memory problem. In the function that resizes the image (included below) I have used ImageDestroy to get rid of the two images from memory. while ($row = mysql_fetch_row($imagestoprocess)) { $counter++; echo $counter."<br>"; // sleep(3); $imagename = $row[33]; //get name of main image $imagelocation = $salessourceimagedir[$_GET['office']]."/".$imagename; //work out image name and path //echo "im:-".$imagelocation."-"; $imagedestination = $salesimagedir."/".$imagename; //work out image name and path if (file_exists($imagelocation)) { //see if file exists $thumbdestination = $salesimagedir."/thumb".$imagename; //work out image name and path echo "<br>resizing ".$imagelocation." to ".$imagedestination; resizejpeg ($imagelocation,$imagedestination,$proplargeimageh ,$proplargeimagew,ྂ',Ɔ'); echo " done<br>resizing ".$imagedestination." to ".$thumbdestination; resizejpeg ($imagedestination,$thumbdestination,$propthumbima geh,$propthumbimagew,ྂ',Ɔ'); echo " done<br>"; } function resizejpeg($image,$newimage,$max_height,$max_width ,$image_quality){ /* $image = "/home/web/images/original.jpg"; $newimage = "/home/web/images/new.jpg"; $image_quality = 80; $addborder = 1; $max_height = 200; $max_width = 300; */ // Main code echo "aa"; $src_img = ImageCreateFromJpeg($image); $orig_x = ImageSX($src_img); $orig_y = ImageSY($src_img); echo "a"; $new_y = $max_height; $new_x = $orig_x/($orig_y/$max_height); echo "b"; if ($new_x > $max_width) { $new_x = $max_width; $new_y = $orig_y/($orig_x/$max_width); } echo "c"; $dst_img = ImageCreateTrueColor($new_x,$new_y); ImageCopyResampled($dst_img, $src_img, 0, 0, 0, 0, $new_x, $new_y, $orig_x, $orig_y); /* if ($addborder == 1) { // Add border $black = ImageColorAllocate($dst_img, 0, 0, 0); ImageSetThickness($dst_img, 1); ImageLine($dst_img, 0, 0, $new_x, 0, $black); ImageLine($dst_img, 0, 0, 0, $new_y, $black); ImageLine($dst_img, $new_x-1, 0, $new_x-1, $new_y, $black); ImageLine($dst_img, 0, $new_y-1, $new_x, $new_y-1, $black); } */ echo "d"; ImageJpeg($dst_img, $newimage, $image_quality); ImageDestroy($src_img); ImageDestroy($dst_img); echo "e"; }
Merging Multiple Images With Imagecopy
I've been working on some code for a bit and just can't figure out my problem. My code runs through a series of variables and creates a seperate image for each, then merges them together. Code:
Multiple Random Images From Same Array
I want to display 4 images (but with possibility of more in future) on a page which are randomly selected from a number of possible images. at the moment I have each possible image as a list in an array, and have found it simple enough to generate the 4 images randomly. The problem I am having is that I don't want the same image to appear more than once, and am having trouble doing this. As I said, I am new to PHP so I have a lot to learn, but I have built a (fairly basic, admitedly) application in AppleScript on a mac, so I am familiar with many of the basic concepts behind programming, and I could do what I want in AppleScript, but am having trouble translating it to PHP, plus it's been a while since I did that anyway. Code:
Uploading And Displaying Multiple Images
I am building a website where people can post jobs that need to be done and have laborers bid on them.... Im done with pretty much everything on the site but im having a hard time figuring out how to upload and display multiple images for each job.... I am able to upload and display one image but i can upload multiple images.... Everytime I try to do so, It only displays multiple copies of the first image that i upload. Code:
Newbie With Multiple Images Upload Question
i have this code foreach ($_FILES["images"]["error"] as $key =$error) { if ($error == UPLOAD_ERR_OK) { $tmp_name = $_FILES["images"]["tmp_name"][$key]; $name = $_FILES["images"]["name"][$key]; move_uploaded_file($tmp_name, "images/$name"); } } and i wish to add it a uniqid to every file uploaded leaving intact it's original name as well. and i would also need to get the file name and add it to my database.
How To Upload Multiple Images To A Mysql Database?
ive been looking for a tutorial or a snippet of code that would allow me to go to a browse button, navigate to a directory, and either upload everything in that directory or let me select what ones to upload, all i have been able to find are multiple inputs and each image needs to be uploaded individually.. Anyone seen anything like this before?
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!!
Reg Exp: Want To Remove All Images From Page
I looked at a couple tutorials on reg exp. But have not found a way to remove all images from a page. HOw can i do it? It seems easy enough $text = ereg_replace("<img src [then everything until] (gif|jpeg|jpg)">[anything here]</a>); I just can't get it, after so many tries. Have searched google too. Any ideas?
Howto Images From A DB To A Web Page
I am in a hurry to learn this so I am looking for a tutorial that shows how to upload the info in the database and then use php to load the images into cells of a table on a web page. Sort of like a gallery but for displaying products. I am studying how to make thumbnails for the main page and allowing a user to click on it or a link and open a new window with the larger view of the product. I am sure this has been done a hundred times on the net but it is new to me. Anyone know of some good tutorial on doing what I am talking about.
Grab Images Off A Web Page
Can someone help with a script to grab all images from a page then save them to a directory on your server. For example I'd put yahoo's url and it would grab all the images on the front page and save them to my directory.
Imagecopyresampled - Can One Use Images On The Fly, Even If The Page Headers Have Already Been Sent?
I'm looking at this page: http://us2.php.net/manual/en/functi...pyresampled.php I took the code from Example 2, almost exactly, and tried to use them on this page: http://www.monkeyclaus.org/media/au...eId=PT_tertiary I get gibberish on the page, and then I get a warning in the error logs about "headers already sent" To serve an image in the middle of the page like that, do I have to turn it into a physical file and serve it in an IMG tag?
How To Save(convert) A Web Page With Images In A XML, Or RTF/DOC File ?
I would like to save a web pages to a file readable by Microsoft Word (it may be named with the extension .DOC even if it is not so... MSWord is able to understand XML, RTF, HTML ...) - notice that the images must be included (JPEG or GIF) my ideas : - write a RTF file (cannot write .DOC because the Unix has not DOM) - save a page with the dump of the images (like the web archive from Internet Explorer ".mht") cons : - must be in Linux/Unix (so DOM cannot be used) - price may be as low as ... :) - not a PDF because it must be writable
Pulling Jpeg Name Images Out Of MySQL Onto PHP Page
What I would like to do is have my PHP page pull the name of an image (jpeg, bmp, etc.) out of MySQL and display image from another directory. I don't want the actual image saved in the DB, just the name. I have the connection established from the Web Page to MySql, all I want is how to display the image part. Does anyone have any straightforward code to show me how to do this?
Developing A Page That Displays Latest 5 Images In A Database
I am currently changing my web site so that it is PHP and mySQL powered. On the front page I have an area that will display the latest images in my portfolio and the latest text description. Therefore, what I need is an admin page which allows me to upload images to a database which has a timestamp/date field, a thumbnail field, an image field, a text field for the title and a text field for the description. I also need a HTML form with inputs for the thumbnail upload, image upload, title and text description (in a textarea). It would also be useful to have the page display the database contents and allow me to edit the details and also, delete rows. I then need code for that will display the most recent 5 thumbnails and the title on my index.php page.
Multiple Forms In 1 Page
im having a bit of trouble with my form, its for an invoice system I have 2 tables: Invoices - invoice_id*, cust_id and date invoice_items - invoice_item_id*, invoices_invoice_id(links to invoice_id in invoices table) item_item_id(links to item_id in item table) description, weight, price I am trying to create the form for the page so that all the information can be entered at once, but i dont think its possible, because an invoice must be created first then invoice_items added using that invoice id. how can i get my form to do this? i need it to insert the invoice into the database then take that invoice_id and add it to the item details on the page? this is what ive written so far but now im stuck on the invoice_id bit Code:
Error Using Header("", FALSE) To Show Multiple Images From MySQL Db
Many people seems to have problems when displaying multiple images from their database (mySQL db). Often you can read error statements like "Header already sent out ...". To solve this, people often propose to use include files. To keep the scipt it would be nice not having this problem, being able to sent out multiple headers to a browser without getting these error messages. In the PHP4 manual, we can read an option that can be added to the header statement, Header("xxx",FALSE). It would enable multiple headers to be sent out. For instance the following statement: while ($product = db_fetch_object($result)) { header("Content-type: pv($product->filetype)",false); echo pv($product->image)" } However, it doesn't work. Anybody has any idea why? Does anybody use this option FALSE with success?
Create Web Page In Multiple Language
i want to craete site which shows the contents as per the langauge i choose. so can anyone give me idea that how this is possible. i know tha problem but i don't have any idea about soultion. so pls reply me if u know
Update Multiple Records From One Page
Recently, I had a request to create a page in our database web interface where we can update multiple customer records from one page. Here's the flow of what we want to do: 1. Search for a customer by name. 2. Bring up a list of the matching customers and the data that is to be changed in text boxes in a table - one customer per row with 6 fields for each that can be modified (6 text boxes). 3. People can update the appropriate fields and click submit button. (** this is done to this point **) We may be returning as many as 250 records per search, so efficiency would be pretty important. I am not sure where to go from here. I would guess I should build and array of keys and values from the HTTP_POST_VARS that are submitted and then loop through them to UPDATE the database to the new values. I don't know how to do this, though.
Multiple Page Gallery Without Database
I have 20 images and 20 thumbs. same filenames but in different folders. I have 20 thumbs per page, but if i want to have more, there has to be a link to 2nd page, which shows thumbs from 021.jpg till xxx.jpg. If possible also third and fourth pages. I dont want to use a database. The questions is how to achieve this?
Generating Multiple Output On One Page
I'm building a website in PHP and Javascript. The registration portion is divided into 2 sections: 1. In one, I get info about the visitor. This is sent via POST to a php script which is section 2. 2. In the second section, I get some specific information about their pets and make suggestions. I'm having problems with section 2, and I hope y'all can help. The core of the PHP script in Section 2 consists of the following: <?php for ($n=1; $n <= $num; $n++) { print "Please enter age of pet #$n:" ; print "<INPUT type='text' name='petage'     " ; $div = $n . "ajaxDiv" . ";"; $_ENV['div'] = $div; print "DIV IS: $div<br><br>"; print "<INPUT TYPE='button' onClick='ajaxFunction()' NAME='$age' VALUE='Done!'>" ; print "<INPUT TYPE='reset' NAME='Clear' VALUE='Reset form'> <br><br>" ; print "<div id='$div'></div><br><br>" ; } ajaxfunction() looks like: if(ajaxRequest.readyState == 4){ var div = "<?php echo $_ENV['div']; ?>"; if (div = "") { div = "1ajaxDiv"; } var ajaxDisplay = document.getElementById('div'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } } // Get pet stores based on zipcode var zipcode = "<?php echo $zip; ?>" var querystring = "?zipcode=" + zipcode; ajaxRequest.open("GET", "getstores.php" + querystring, true); ajaxRequest.send(null); The idea is that the user fills in the age of their pet, I look in my DB and spew out the names and addresses of vets and pet stores in the area. Thanks to ajaxfunction(), I can do this through: print "<INPUT TYPE='button' onClick='ajaxFunction()' NAME='$age' VALUE='Done!'>" ; The function calls another PHP script and outputs the data in the same HTML file. So here is my issue. This code works fine when there is only one pet. If there are more than one, then clicking on the second button results in no output at all. I was thinking of enclosing it in a form like so: <form method="post" action="/cgi-bin/samescript.php"> loop to output buttons </form> Meaning call the same script after clicking the first button, second button and so on. But I would then need to change: print "<INPUT TYPE='button' onClick='ajaxFunction()' NAME='$age' VALUE='Done!'>" ;
Multiple Submit Buttons On One Page
i have a table created through echo's which display data from the database. The database has multiple items in the thing, so i have lots of rows. Each row has a submit button on it with a different hidden ID, which is $row[0], which is the ID of the items that are being displayed. Displaying all the data and having the submit buttons isnt the problem. The problem is clicking the button. I'm not sure how to manage the data at the end. At the moment I have: Code:
Multiple Forms, Different PHP Documents, Same Page?
In a PHP file 'main.php' I have <?php include 'header.php'; include 'login.php'; include 'body.php'; include 'footer.php';?> Login.php has a form on it to allow the user to log in to the site. Body.php has a form on it to allow a user to post a message. What I'm finding is that the 'submit' button on 'body.php' actually calls the form from 'login.php'. Does PHP have issues when there are 2 separate forms doing 2 saperate things displayed on the same page - is there anything I need to look out for?
Multiple Tables Print To One Page
Is it possible to print information from multiple databases on one page/form. For example, I want to print information that is in three databases, and I want to be able to print a few related fields on one page. Is that possible?
Multiple Page Link Exchange
I am in need of a PHP Link Exchange script (preferably free) that is not for single pages. The use of this script will be for having 4 pages on the website - the home page with paid links for $1, and then 3 other pages for free link exchange (Free Links Page 1, ...2... and so on) If you know of a script out there then please post a link to it here. It would be a huge help to me and I greatly appreciate it. I saw one almost a year ago on the HotScripts Most Poplar page, but cannot remmeber it nor find it in HotScripts now.
Generating Multiple PHP Pages W/ Different Quries On Each Page
I'm writing a guestbook. So far, so good, except now I need multiple pages. How would I write my scrpt to automatically generate multiple pages (or the same page, just changing query variables on it)? For example, if I limit a page to 10 posts and the page exceeds 10 posts, and I press "Next page", I want it to display the next 10 posts.
Refreshing Page Making Multiple Entries
I have a form which accepts input from the user and then inserts data into mysql. The problem is, after user inputs data and a new page is loaded; if the user again presses "refresh" button, the same entries are re-entered into database.
Updating Multiple Rows With One .html Page
I am trying to create a form to update multiple entries in a mysql databse. This code below is rough, but it is working to the point wher it pulls the data, displays it in the text areas (but it does not go past the first white space in displaying, that needs to be fixed), and then I can alter the text fields, check a box, and hit submit, and it will update the fields, but the new value is size=20. I also can't update more than one record at a time, which defeats the purpose. Code:
Multiple Page Generation Based On Post-length
Ok, first I'd like to apologize if this has been covered before, but I couldn't find it via the search options and it's been a long time since I've been here. I'll give you a summary of what I'm trying to do, and you all can point me in the best direction on how to go about it! I'm trying to design an online article posting section, where the members can post articles about things. The problem that arises imediately, is post length. What if someone posts a "3 page" article by word-processing-program standards, and then outputted this to the website? It would be a really long page and if the page was setup with a specific UI size design in mind, it would blow this apart. I'm sure you can understand what I mean. So, I need to be able to get the post's length, figure out how many pages I'll need to break that length up, then break it apart for output to the screen in segments with links for next page continuing the article. Now, the post's length isn't hard, (strlen) and figuring out how many pages isn't that hard, dividing the post's length by the desired amount of characters wanted in the UI. The part I'm stumped on is breaking apart the post into many peices that break at 'spaces' not in the middle of words, and that continue where the last one left off, not leaving any words out. If this has already been covered, or someone knows of another site that has it, please post it! If someone knows of a really simple way to do this, by all means, dazzle me!
Preventing Multiple Data Insertion On Page Reload
I am developing a PHP-mysql database. It is noted that when the browser window is refreshed the data is inserted again in the database. unfortunately there is no unique keys that I can use to verify the existance of the data, so as to prevent the multiple insertion. Is there any other way to prevent it otherthan introducing another field for this purpose and verifying its existance?
Eliminating Passed URL Variables For Multiple Listings On A Page
I have a page with a list of several users, each hyperlinked to another page of 'more info' about that user. The hyperlink contains the UserNumber, UserRegion, and UserStatus, and the receiving page picks up the data in the passed URL. This works well, but I'd like to eliminate the passing of these variables in the URL. One way is to make a graphic ('More Info') that can be clicked to submit a form. Each 'More info' graphic from the dynamically created page could hold the UserNumber, but how can I pass several variables with a single click? On some pages, there can be 100+ users, and I hate to have 100+ separate forms and hidden fields. I thought of using session variables, how can I know which user was clicked to set the session variables?
Multiple Object Oriented Forms Within The Same Page Layout ?
I am looking for a php class and page layout framework allowing smooth object oriented insertion of several, possibly different, forms within the same page layout. All of that while retaining the very desirable properties of a great php class : - self contained - auto validation - contextual error messages - build in input types - etc. I looked at hundreds of form classes and frameworks on the web, but couldn't find any that would fit all of these simple requirements. Does such a framework exists somewhere ? May I point out that I am definitely NOT looking for multi page forms, the kind used to make wizards or assistants.
Multiple Navigation Tables On One Page (master - Slave)
I just wanted to refresh only part of the page, i.e., table2 on my php page. here is my javascript code which performs the refresh it works fine and my php file display all the records. the only problem is: I have got two tables on the same page and i only want to refresh the second table when i click the a row of my first table rows. Code:
|