Saving Png
I used GD and created a png image, and then you press a "Save" button and it runs my save.php file,this file creates the image and then uses
<?php
Header('Content-type: image/png');
ImagePNG($im,$location);
ImageDestroy($im);
?>
to save it, the image shows up in the folder, but when I view it, it is just ablack box, my image wasn't really created. I can preview the image and see that it works, is there something I am missing?
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Saving XML To Db
What would be the best way to save XML to a database? I mean I can use the example 'http://www.php.net/manual/en/function.mysql-real-escape-string.php'. they give a function to prevent any SQL Injection, function quote_smart($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not integer if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value) . "'"; } return $value; } but then how do I get the data back, (as intended), from the db? what would be the reverse of the above code?
View Replies !
View Related
Csv Saving
i have a form and it saves all logs into the enquiry.csv everything is working fine except that for the message text area, when i type something with spaces example test1 test2 test2 the output in my csv is being moved into other cells below is my current code:
View Replies !
View Related
Saving To PS Or PDF
I'm writing an application that needs to parse a database and then print the output with a header graphic to specific printers, depending on a field in the database. To do this, I'm thinking if parsing the database with php than somehow saving this output to a Postscript or PDF file with the graphic header, then printing this to the specific printer using lpr. Can someone point me to a site or utility that'll let me save an HTML page in PHP to PS or PDF? Or if someone knows of a simpler way of doing this, please let me know.
View Replies !
View Related
Saving File
When saving the file, I would like let the user to browse through the directory where they want to save the file (like window pop up sreen). may I know is it can be done using php?
View Replies !
View Related
Daylight Saving
i still have the problem with daylight saving last Sun of March will increase 1 hour of the normal time and first Sun of Oct will set back to normal time: I try date("I") and it's doesn't work.
View Replies !
View Related
Saving A Session
I have been trying to find out how I can save a session - so far without success. I use PHP in combination with MySql and I would like my users to be able to save their sessions in my database so that they can retrieve it later... Meanwhile, this will also allow me to analyze their choices (what searches they did, etc...). I have been searching the net, but so far without a lot of success.
View Replies !
View Related
Saving Streamed Jpg
I have a requirement to programmatically save some images, which appear to be streamed jpgs. If I make a call to the page which serves these images, using a browser, then the picture appears, under a different URL, almost as though the page was forwarded. The picture appears fine if I put a link on a web page. But the usual copy() command doesn't work.
View Replies !
View Related
Saving A Textarea
I have a textarea input box in a form. My client needs to be able to cut text from a document and paste it into the textarea for saving in the mySQL database. This part works correctly. Code:
View Replies !
View Related
Saving To A Floppy?
Hey, is there any way to save a file to a floppy disk using php? The server will be linux and the local computer will be windows. I need it so the user can put a disk in the drive, hit go, the php page will create an excel file, save it to the users floppy drive and then tell him to put another disk in and hit ok to restart the cycle again. This will continue until all the needed files are build. I know how to do everything except the save to the floppy part and I am hoping it's possible. If it's not, does anyone know another way?
View Replies !
View Related
Saving Php Results
I have an html code which contains callings to a php script which generates JPEG images via GD library. When I select 'save as' in any browser two options are given (.html or .txt) but none of them allows to save the page as it is shown in the browser (with images). Where images should be there are only empty links....Does anyone have an idea about it?
View Replies !
View Related
Daytime Saving
I live in new zealand which has dayLight Saving which push 1 hour forward on the 1st Sunday of October, and put back on the last Sunday of March, I know that there is a daylight saving function in php DATE (I - capital i) anyone know how to use it? as I remeber, it changes the setting when it's 3.00AM but not sure.. it may change the time when it's 0.00am i am not 100% sure about this .
View Replies !
View Related
Saving Word Into .txt
I need to change a sentence from an input text box into words and store it in a text file (file.txt) Eg. "Can someone pls help me" . Can someone pls help me and then store all these into file.txt file.
View Replies !
View Related
Saving From Textarea
I have a textarea field, and I enter text into it. Like this: Today is... a Nice day and I save all from that field to a db field. Now when I extract it from the db, it looks like this: Today is...a Nice day So there is no break after the "is..." any ideas?
View Replies !
View Related
Saving JPG Images
This line of code aparently saves the jpg file: imagejpeg($image2,$src,95) If the default value is set to 100, some of the saved files are larger in size than what they were uploaded (ie: uploaded as 300K, saved as 450K). To keep the file size from bloating, I set the parameter to 95. But this causes the images to pixelate in 8x8 arrays, some worse than others. Is there a better function to save jpg images so that they don't weird out?
View Replies !
View Related
Cookies Are Not Saving
I have the following $username="test"; $username="pass"; setcookie("username", $username, time()+3600); setcookie("password", $password, time()+3600); echo "<br>username:".$_COOKIE["username"]; echo "<br>password:".$_COOKIE["password"]; echo "Thank You. Your username is:".$username." <br>Your Password is:".$password; for some reason the cookies are not saving -- what am i doing wrong?
View Replies !
View Related
Not Saving To Database
I'm making a website for a racing game, and I'd like to have a section of the site where drivers can post tips or tricks for setting up a car. Problem is, sometimes the tips post, sometimes they don't. I've tried LOTS of different combinations ... tip length, special characters, etc . Code:
View Replies !
View Related
Saving Object
I'm a java programmer learning PHP. I was wondering how to save a class over a session. As a simple example, if I wanted to have a Class called Sum, which had the methods addToSum($a), and printSum(). Could I save that object into a session, so that I could use it later as the user navigates my webpage? Is a session the best way to store data as a user goes between webpages?
View Replies !
View Related
Saving Input
What is the standard approach to saving input from a form if on submit the database connection fails? I'm thinking along the lines of after the submit the first thing to do is save the text somewhere (cookie?) and then check for the presence of the cookie on the form page and if it exists load the text from it. Destroying the cookie after a successful insert. Am I close or is there a better way?
View Replies !
View Related
Saving Snippets
When I try to save a code snippet, like this one it forces me to save the file as download.php, which it is not a php file its a zip file. But if I change the file type, I still cannot open it.
View Replies !
View Related
Saving Data
So I have an imaginary share.php. Say 10 users are submitting data to that script. every time they submit their own data, they get the most recent submissions of others as their response. Now, this will happen very often, every couple of seconds at least. File IO is slow, so writing to a temporary file is terrible. Similarly, hitting a DB everytime feels very inefficient (though I suppose if the DB is smart, it'll keep the row in memory so I just suffer a few API calls but no real File IO or processing costs). I'm under the impression the mod_php keeps the same interpretter running for all script calls, so it seems reasonable that I should be able to modify the actual interpretter's state with data (or do the functional equivalent. perhaps some deliberately exposed "Global" object). I know that Java servlets are perfect for this, but I'm unfortunately limited to a PHP environment. Ultimately, is there any way in PHP to save data directly to the interpretter's state, so subsequent script executions can pull the data directly from memory and alter it themselves instead of relying on some indirect data storage mechanism?
View Replies !
View Related
Saving Filenames
I have a PHP web app using MySQL. when I save a .jpg file named test's.jpg I see that the filename on the unix server is: test's.jpg. the filename I end up saving in my SQL table is named test's.jpg. when I use an image tag to display the photo on my web page, no image displays. I tried to strip the slash out of the filename but the image still won't display on the web page. maybe I'm all goofed up here and don't understand what's going on with this slash char in the filename on the server. how to get the image to display on the web page?
View Replies !
View Related
Saving Images
i've been searching for days but im not really sure how to search for what im trying to do. i want a script that will take a defined remote img (http://whatever.com/img.jpg) and save it to the directory of the script. i cant seem to find any image functions that will handle remote images. what should i be looking for?
View Replies !
View Related
Saving Problem
I've got a form in php that enables a user to add records to a mysql database, but for some reason when the Status_Report exceeds 700 characters it doesn't want to save to the database, the datatype of the field in the database is set to text and the limit set to 5000. any sollutions out there?
View Replies !
View Related
Saving A Page
I work in Dreamweaver 8 and can produce dynamic PHP page with no problem. Now I would like to be able to save these pages as a static HTML page in a folder on the server. My old programmer said this could be done using the fopen command. I would like to be able to specify the folder, as well as the file names prefix, the unique id will complete the files name. I blend Dreamweaver pages with hardcoded code to get what I need. I just done know where to go from here.
View Replies !
View Related
Saving Variables
I have a menu made up of images where users can click an image to load the next page. I want each image to send a unique id number to the page the user loads. Based on this id number, the page that will be loaded will display something different. Since I'm not using a form to post data, I decided to save the id number as a session variable. The loaded page will read the variable when determining what to load. The problem I'm encountering is where to put the code to get the first page to save the id number (I know how to save and retrieve session variables, so that's not an issue).
View Replies !
View Related
Saving With Variables
I'm using php to save a webpage to the webserver. The saved file's name is supposed to be equal to the variable $uic I can't get it to display the value of $uic heres the code: $return = file_put_contents('../../../archives/docs/account_details/$uic.txt', $content); that saves the file called $uic.txt instead of printing: 7706869110330709208613965.txt.
View Replies !
View Related
Saving Form
i want to break it up into 4 pages of 40 feilds. so here is the thing i need it so people click on "save and quit" and it saves everything then when you come back it brings you back to page 1 with all the feilds filled in. this is how i thought about doing it, have a database with all the feilds in it, then have a cookie that stores the id to that specific record. now i dont know how to accually call a cookie to tell the query how to pull the id, also i dont know how to check if the person already has a cookie or not, and if do do i tell it to update the database feild or insert into it. i was thinking if they have a cookie id it will bring it up and i will use an update to do it, (when you click save and quit it inserts what you have filled out into the database) but then i will need a different form to do the one if you dont have a cookie id already so then you need to insert into a new one, im trying to do this with out repeating to much...
View Replies !
View Related
Saving Database
This is the deal. I've coded together a site that publishes random links everyday. The major problem is that I need them to be written to the html file in some way, so they'll be the same once someone updates the site. Once there's a new day, the site will automatically publish random links, but the old ones will remain the same. The problem I have is that the old ones keep being random. I've tried to find some sort of 'write' function on www.php.net and I've searched through this forum after the answear.
View Replies !
View Related
Image Saving
i created an image resizing script, and am having trouble saving the resized image to the server. PHP Code: imagejpeg($image_resized, $imagelocation); should save the image to where i designate $imagelocation as, but it doesn't. Should i use fopen instead. Also, is there any way i can make it so this script scan folders and apply the script to certian files in them. PHP Code: <?php      //dan's lame image resizer // Load image $image = open_image('flower.jpg'); if ($image === false) { die ('Unable to open image'); }.
View Replies !
View Related
Saving The Values
I'm writing a form that requires validation. After submission, the form fields (mostly textboxes) are validated and if any is incorrect, the form is redisplayed with all the value sin place so the user doesn't have to retype everything. I'm achieving the latter this way: <input type="text" name="whatever" value="<?php echo $_POST['whatever'] ?>" >
View Replies !
View Related
Saving To A Text File.
I haven't been able to find a way to save the results of a MYsql query into a tab delimited text file... Anyone know how to do this, or if there are any already written scripts out there that perform this, or a similar function?
View Replies !
View Related
Creating And Saving Files With PHP
Hi, hope someone has some ideas !. Is there a way to use PHP and Mysql(if needed) in the following way: Lets say I used a script that when a person enters their birthday info, this script produces an onscreen report (like horoscope), how could this browser screen be saved as a file(html or other) so I could then include it into the body of an email or attach!.
View Replies !
View Related
Saving To A .php File With A Php Script
Can I write a script that would change the .php file? As in save changes to it. For instance, if I wanted to have a password variable that could change (I realize I can store the value in a database...that's my back up plan). The next session would have to have the new variable value...not the original one that I coded in.
View Replies !
View Related
Saving A Variable With '$' To A File
I am creating a config.php on the fly during a user setup period. here is my code (edited for readablity): 1.) $filepointer=fopen"http://www.mysite.org/newusers/" . $SESSION_UID . "/config.php", "w+"); 2.) $data = "<? $name = '" . $SESSION_VARSAVE . "' ?>"; 3.) fputs($filepointer, $data); 4.) fclose($filepointer); This isn't working. Line 2 is wrong. I want my config.php file to containthe below line, where VARSAVE will change depending on the user: <? $name="Web Page Title." ?> This is used for populating php pages and the viewer does NOT log-in. Anybody who visits the page needs to see the web page title. How can I format line 2 properly?
View Replies !
View Related
Saving Variables From Flash
I am currently setting up a flash site as a front end for a flat file database using .txt for the data storage as it is minimal. I have st up the flash to post the variables to the PHP file when an order is sent. I have used the following PHP to save the variables to a .txt file PHP Code:
View Replies !
View Related
Saving A File From One Server To Another
I'm half-way there with this, but I need some assistance, please. I'm attempting to save a JPG file from one server to another. I'm using fopen() to open the remote file, fread to get the contents, closing, using fwrite(rb) to open a new file on my server, writing the contents, and closing. However, it seems that I'm not getting the entire file from the remote server. Am I going about this wrong? Is there a better, easier way (that doesn't involve CURL or any of those other acronyms) to get these images?
View Replies !
View Related
JPG>GIF (resizing And Saving As Copy)
I was just wondering how I take a JPG file on the server, shrink it, and save it as a copy, and in GIF format? For example: I have a file called 'desktop.jpg', and I would like to shrink it to an image called 'desktop.gif' (based on the jpeg's name, so if it had been 'boat.jpg' it would be saved as 'boat.gif'), and resized to 120x96 pixels, and save the gif in the same directory. How do I do this?
View Replies !
View Related
Saving The Output Of A Form To XML
I have some clients who want to do a bit of the maintenance of their homepages themselves and I would appreciate this because that will save me a lot of work. Is it possible to generate the output of a form into XML instead of generating it into a database or into an e-mail? I have already got a PHP script which converts the XML into HTML.
View Replies !
View Related
Saving Formatting In Variables
I am writing a 'tell a friend' page for my www site. Essentially, the user opens the page, fills out a form, click submit, the text of the email that will be sent to their friend is presented on screen. If they like it, they press send, and an email is sent to their friend. The main body of the email is in a variable, which contains paragraph formatting etc. The problem I am having is that the paragraph formatting is not transmitted to the html page that they review, and that page looks messy. Of course, I tried putting in html formatting in the variable, but then this literally appears in the email. Does anyone know a way of solving this problem?
View Replies !
View Related
Saving A Decoded Php File
What i am doing is getting a pregenrated label in either php,tif,jpeg or gif...(currently it is pdf) and what i want to do is get the image save the image with a unique file name and save the path into mysql db and save the file on to my server. the image is incoded with base 64. so far i have decoded the image so this is were i am at $LabelImage = "$DeliveryConfirmationLabel[1]"; echo base64_decode($LabelImage); when i echo the file apears in a pdf viewer.. so far i have tryed to save the file but i just can't seem to get it to work.... here is my code $LabelImage = "$DeliveryConfirmationLabel[1]"; $decodeimage = base64_decode($LabelImage); this so far i know works... and then something like this $data = $decodeimage; header('Content-type: application/pdf'); header('Content-disposition: inline; filename=decodedimage.pdf'); header('Content-length: ' . strlen($data)); then something like this fwrite($data, decodedimage.pdf) I don't have a good grasp of what is going on... i am having a hard time with fwrite() all the examples i read have me open a file with $filepointer = fopen("nameoffile.txt","w") and then it has me close the file with fclose($filepointer) or fwrite but they are making the assumption that i have a saved file that i am working with...
View Replies !
View Related
Saving Form Information
Say I have a webpage which takes in many user inputs through a form. Once i click the submit button in the bottom the information is sent to the server. I fill in the user inputs and would like to save the webpage with in input data filled before submitting. Is it possible to save the webpage with user inputs filled?
View Replies !
View Related
|